Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/picongpu/include/particles/Particles.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2013-2014 Axel Huebl, Heiko Burau, Rene Widera, Felix Schmitt,
* Copyright 2013-2015 Axel Huebl, Heiko Burau, Rene Widera, Felix Schmitt,
* Marco Garten
*
* This file is part of PIConGPU.
Expand Down Expand Up @@ -72,10 +72,6 @@ class Particles : public ParticlesBase<T_ParticleDescription, MappingDesc>, publ

void syncToDevice();

//Ionization
template<typename T_Elec>
void ionize(T_Elec electrons, uint32_t currentStep);

private:
SimulationDataId datasetID;
GridLayout<simDim> gridLayout;
Expand Down
5 changes: 1 addition & 4 deletions src/picongpu/include/particles/Particles.tpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2013-2014 Axel Huebl, Heiko Burau, Rene Widera, Richard Pausch, Felix Schmitt
* Copyright 2013-2015 Axel Huebl, Heiko Burau, Rene Widera, Richard Pausch, Felix Schmitt
*
* This file is part of PIConGPU.
*
Expand Down Expand Up @@ -30,9 +30,6 @@

#include "particles/Particles.kernel"

// Ionization
#include "particles/ionization/ionization.hpp"

#include "dataManagement/DataConnector.hpp"
#include "mappings/kernel/AreaMapping.hpp"

Expand Down
69 changes: 57 additions & 12 deletions src/picongpu/include/particles/ParticlesFunctors.hpp
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.
*
Expand Down Expand Up @@ -155,29 +155,74 @@ struct CallUpdate
}
};

/* Tests if species can be ionized and calls the function to do that */
/** \struct CallIonization
Copy link
Member

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:

/** Headline
 *
 * longer description
 * 
 * \tparam T_SpeciesName [... description ...]
 */

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

/** \struct ClassName
 *
 * \brief longer description
 * 
 * \tparam T_SpeciesName [... description ...]
 */

Copy link
Member Author

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:

/** \struct ClassName
 *
 * \brief shorter description (one-liner maybe)   
 *   
 * longer description ... blabla
 *  
 * \tparam T_SpeciesName [... description ...]
 */

I just skipped the longer one

Copy link
Member

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 \file for a general file description.

Copy link
Member Author

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?

*
* \brief Tests if species can be ionized and calls the kernel to do that
*
* \tparam T_SpeciesName name of particle species that is checked for ionization
*/
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • /** ...
  • new line after headline

* \tparam T_CellDescription contains the number of blocks and blocksize
* that is later passed to the kernel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls describe the \params, too :)

* \param tuple An n-tuple containing the type-info of multiple particle species
* \param cellDesc points to logical block information like dimension and cell sizes
* \param currentStep The current time step
*/
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)
{
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down
13 changes: 10 additions & 3 deletions src/picongpu/include/particles/ionization/None/AlgorithmNone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@

#include "types.h"

/** IONIZATION ALGORITHM
/** \file AlgorithNone.hpp
*
* IONIZATION ALGORITHM for the model None
*
* - implements the calculation of ionization probability and changes charge states
* - is called with the IONIZATION MODEL, specifically by setting the flag in @see speciesDefinition.param */
* - is called with the IONIZATION MODEL, specifically by setting the flag in @see speciesDefinition.param
*/

namespace picongpu
{
Expand All @@ -34,11 +38,14 @@ namespace ionization
{

/** \struct AlgorithmNone
* \brief ionization algorithm that does nothing */
*
* \brief ionization algorithm that does nothing
*/
struct AlgorithmNone
{

/** Functor implementation
*
* \tparam EType type of electric field
* \tparam BType type of magnetic field
* \tparam ParticleType type of particle to be ionized
Expand Down
32 changes: 30 additions & 2 deletions src/picongpu/include/particles/ionization/None/None.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,44 @@

#pragma once

#include "types.h"

namespace picongpu
{
namespace particles
{
namespace ionization
{

/** \struct None_Impl
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member Author

Choose a reason for hiding this comment

The 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 because in some docs I also write sth longer later without a \details command.

*
* \brief Empty ionization model [that is used for all species that are not 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@n01r Could you write a comment on why you are using T_SrcSpecies = bmpl::_1 here? (chicken-and-egg problem) (as in BSI)

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#pragma once

#include "types.h"
#include "particles/ionization/None/None.def"
#include "particles/ionization/None/AlgorithmNone.hpp"

Expand All @@ -29,17 +30,35 @@ namespace particles
{
namespace ionization
{

/* fallback for all species that cannot/should not be ionized */
struct None
template<typename T_DestSpecies, typename T_SrcSpecies>
struct None_Impl
{
template<typename T_SrcSpecies, typename T_ParticleStorage>
void operator()(T_SrcSpecies& src, T_ParticleStorage& pst, const uint32_t currentStep)
{
// Do nothing
}
typedef T_DestSpecies DestSpecies;
typedef T_SrcSpecies SrcSpecies;

private:

public:

None_Impl(const uint32_t currentStep)
{

}

DINLINE void init(const DataSpace<simDim>& blockCell, const int& linearThreadIdx, const DataSpace<simDim>& totalCellOffset) const
{

}

template<typename FrameType>
DINLINE void operator()(FrameType& ionFrame, int localIdx, unsigned int& newMacroElectrons) const
{

}
};

} // namespace ionization
} // namespace particles
} // namespace picongpu
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
#include "traits/attribute/GetChargeState.hpp"
#include "algorithms/math/floatMath/floatingPoint.tpp"

/** IONIZATION ALGORITHM
/** \file AlgorithmBSI.hpp
*
* IONIZATION ALGORITHM for the BSI model
*
* - implements the calculation of ionization probability and changes charge states
* by decreasing the number of bound electrons
* - is called with the IONIZATION MODEL, specifically by setting the flag in @see speciesDefinition.param */
* - is called with the IONIZATION MODEL, specifically by setting the flag in @see speciesDefinition.param
*/

namespace picongpu
{
Expand All @@ -39,11 +43,14 @@ namespace ionization
{

/** \struct AlgorithmBSI
* \brief calculation for the Barrier Suppression Ionization model */
*
* \brief calculation for the Barrier Suppression Ionization model
*/
struct AlgorithmBSI
{

/** Functor implementation
*
* \tparam EType type of electric field
* \tparam BType type of magnetic field
* \tparam ParticleType type of particle to be ionized
Expand All @@ -59,9 +66,9 @@ namespace ionization

const float_X protonNumber = GetAtomicNumbers<ParticleType>::type::numberOfProtons;
float_X chargeState = attribute::getChargeState(parentIon);

uint32_t cs = math::float2int_rd(chargeState);

/* ionization condition */
if (math::abs(eField)*UNIT_EFIELD >= SI::IONIZATION_EFIELD[cs] && chargeState < protonNumber)
{
Expand Down
28 changes: 26 additions & 2 deletions src/picongpu/include/particles/ionization/byField/BSI/BSI.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,48 @@

#pragma once

#include "types.h"

namespace picongpu
{
namespace particles
{
namespace ionization
{
/** \struct BSI_Impl
*
* \brief Barrier Suppression Ionization - Implementation
*
* \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>
struct BSI_Impl;

/** \struct BSI
*
* \brief Barrier Suppression Ionization
*
* - takes the ionization energies of the various charge states of ions
* - calculates the corresponding field strengths necessary to overcome the binding energy of the electron to the core
* - if the field strength is locally exceeded: increase the charge state
* - see for example: Delone, N. B.; Krainov, V. P. (1998). "Tunneling and barrier-suppression ionization of atoms and ions in a laser radiation field"
*
* \tparam T_DestSpecies electron species to be created */
* \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 BSI;
struct BSI
{
typedef BSI_Impl<T_DestSpecies> type;
};

} // namespace ionization
} // namespace particles
Expand Down
Loading