-
Notifications
You must be signed in to change notification settings - Fork 225
Refactor ionization: remove from Particles class member functions
#874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
55390e3
f5e1487
7257298
0e5af6a
6d1cff2
3051171
f030d45
b13488e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /** | ||
| * Copyright 2014 Rene Widera, Marco Garten | ||
| * Copyright 2014-2015 Rene Widera, Marco Garten | ||
| * | ||
| * This file is part of PIConGPU. | ||
| * | ||
|
|
@@ -155,29 +155,66 @@ struct CallUpdate | |
| } | ||
| }; | ||
|
|
||
| /* Tests if species can be ionized and calls the function to do that */ | ||
| /** \struct CallIonization | ||
| * \brief Tests if species can be ionized and calls the kernel to do that */ | ||
| template<typename T_SpeciesName> | ||
| struct CallIonization | ||
| { | ||
| typedef T_SpeciesName SpeciesName; | ||
| typedef typename SpeciesName::type SpeciesType; | ||
|
|
||
| typedef typename SpeciesType::FrameType FrameType; | ||
| /* SelectIonizer will be either the specified one or fallback: None */ | ||
| typedef typename GetIonizer<SpeciesType>::type SelectIonizer; | ||
|
|
||
| /* describes the instance of CallIonization */ | ||
| template<typename T_StorageTuple> | ||
| /* Functor implementation | ||
| * \tparam T_StorageStuple contains info about the particle species | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| * \tparam T_CellDescription contains the number of blocks and blocksize | ||
| * that is later passed to the kernel | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pls describe the |
||
| */ | ||
| template<typename T_StorageTuple, typename T_CellDescription> | ||
| HINLINE void operator()( | ||
| T_StorageTuple& tuple, | ||
| T_CellDescription* cellDesc, | ||
| const uint32_t currentStep | ||
| ) const | ||
| { | ||
|
|
||
| /* alias for pointer on source species */ | ||
| PMACC_AUTO(speciesPtr, tuple[SpeciesName()]); | ||
| /* instance of particle ionizer that was flagged in speciesDefinition.param */ | ||
| SelectIonizer myIonizer; | ||
| myIonizer(*speciesPtr, tuple, currentStep); | ||
|
|
||
| /* only if an ionizer has been specified, this is executed */ | ||
| typedef typename HasFlag<FrameType, ionizer<> >::type hasIonizer; | ||
| if (hasIonizer::value) | ||
| { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very well documented, great! |
||
|
|
||
| /* define the type of the species to be created | ||
| * from inside the ionization model specialization | ||
| */ | ||
| typedef typename SelectIonizer::DestSpecies DestSpecies; | ||
| /* alias for pointer on source species */ | ||
| PMACC_AUTO(srcSpeciesPtr, tuple[SpeciesName()]); | ||
| /* alias for pointer on destination species */ | ||
| PMACC_AUTO(electronsPtr, tuple[typename MakeIdentifier<DestSpecies>::type()]); | ||
|
|
||
| /* 3-dim vector : number of threads to be started in every dimension */ | ||
| dim3 block( MappingDesc::SuperCellSize::toRT().toDim3() ); | ||
|
|
||
| /** kernelIonizeParticles | ||
| * \brief calls the ionization model and handles that electrons are created correctly | ||
| * while cycling through the particle frames | ||
| * | ||
| * kernel call : instead of name<<<blocks, threads>>> (args, ...) | ||
| * "blocks" will be calculated from "this->cellDescription" and "CORE + BORDER" | ||
| * "threads" is calculated from the previously defined vector "block" | ||
| */ | ||
| __picKernelArea( particles::ionization::kernelIonizeParticles, *cellDesc, CORE + BORDER ) | ||
| (block) | ||
| ( srcSpeciesPtr->getDeviceParticlesBox( ), | ||
| electronsPtr->getDeviceParticlesBox( ), | ||
| SelectIonizer(currentStep) | ||
| ); | ||
| /* fill the gaps in the created species' particle frames to ensure that only | ||
| * the last frame is not completely filled but every other before is full | ||
| */ | ||
| electronsPtr->fillAllGaps(); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| }; // struct CallIonization | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,16 +20,42 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include "types.h" | ||
|
|
||
| namespace picongpu | ||
| { | ||
| namespace particles | ||
| { | ||
| namespace ionization | ||
| { | ||
|
|
||
| /** \struct None_Impl | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, better use a headline instead. brief is implicit when using a free line in between
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll put in a new line after the headline but I'd like to keep the |
||
| * \brief Empty ionization model | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty ionization model [that must be used for all species that shall not be ionized]. |
||
| * | ||
| * \tparam T_DestSpecies electron species to be created | ||
| * \tparam T_SrcSpecies particle species that is ionized | ||
| * default is boost::mpl placeholder because specialization | ||
| * cannot be known in list of particle species' flags | ||
| * \see speciesDefinition.param | ||
| */ | ||
| template<typename T_DestSpecies, typename T_SrcSpecies = bmpl::_1> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @n01r Could you write a comment on why you are using |
||
| struct None_Impl; | ||
|
|
||
| /** \struct None | ||
| * \brief Fallback for all species that cannot/should not be ionized */ | ||
| struct None; | ||
| * \brief Fallback for all species that cannot/should not be ionized | ||
| * | ||
| * \tparam T_DestSpecies electron species to be created | ||
| * | ||
| * wrapper class, | ||
| * needed because the SrcSpecies cannot be known during the | ||
| * first specialization of the ionization model in the particle definition | ||
| * \see speciesDefinition.param | ||
| */ | ||
| template<typename T_DestSpecies> | ||
| struct None | ||
| { | ||
| typedef None_Impl<T_DestSpecies> type; | ||
| }; | ||
|
|
||
| } // namespace ionization | ||
| } // namespace particles | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use the doxygen syntax we usually use:
Writing the name of the class as the headline is not ideal, it does not add documentation value. or did doxygen noch realize this lines are for the following class?
in that case it's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it does realize that the documentation is for the following class
Actually it is:
I just skipped the longer one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you only need those if not put directly over the classes (which would be messy).
the only thing one needs of those is actually
\filefor a general file description.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we should maybe add file descriptions in a separate pull request?