Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
61 changes: 49 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,66 @@ 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 */
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 :)

*/
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
30 changes: 28 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,42 @@

#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
Copy link
Member

Choose a reason for hiding this comment

The 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>
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
26 changes: 24 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,12 +20,25 @@

#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
Expand All @@ -35,9 +48,18 @@ namespace ionization
* - 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
64 changes: 0 additions & 64 deletions src/picongpu/include/particles/ionization/byField/BSI/BSI.hpp

This file was deleted.

Loading