Skip to content
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

fileOutput.param: Sort file and add Hints #495

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#pragma once

#include "simulation_defines.hpp"
#include "fields/Fields.def"
#include "particles/traits/GetShape.hpp"

namespace picongpu
{
Expand Down Expand Up @@ -74,5 +76,74 @@ public:
BoxTmp& tmpBox);
};

/** Predefined Calculations for \see fieldOutput.param
*/

/* Density */
template<typename T_Species>
struct CreateDensityOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcDensity
> ParticleDensity;

typedef FieldTmpOperation< ParticleDensity, T_Species > type;
};

/* ParticleCounter */
template<typename T_Species>
struct CreateCounterOperation
{
typedef ComputeGridValuePerFrame<
particles::shapes::Counter,
ComputeGridValueOptions::calcCounter
> ParticleCounter;

typedef FieldTmpOperation< ParticleCounter, T_Species > type;
};

/* EnergyDensity */
template<typename T_Species>
struct CreateEnergyDensityOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcEnergyDensity
> ParticleEnergyDensity;

typedef FieldTmpOperation< ParticleEnergyDensity, T_Species > type;
};

/* Energy */
template<typename T_Species>
struct CreateEnergyOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcEnergy
> ParticleEnergy;

typedef FieldTmpOperation< ParticleEnergy, T_Species > type;
};

#if(ENABLE_RADIATION == 1)
template<typename T_Species>
struct CreateLarmorEnergyOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcLarmorEnergy
> ParticleLarmorEnergy;

typedef FieldTmpOperation< ParticleLarmorEnergy, T_Species > type;
};
#endif


} // namespace particleToGrid
} // namespace picongpu
83 changes: 26 additions & 57 deletions src/picongpu/include/simulation_defines/param/fileOutput.param
Original file line number Diff line number Diff line change
Expand Up @@ -30,83 +30,40 @@
/** some forward declarations we need */
#include "fields/Fields.def"
#include "particles/particleToGrid/ComputeGridValuePerFrame.def"
#include "particles/traits/GetShape.hpp"

namespace picongpu
{
/** Note: you will need at least FieldE and FieldB for restart
* capabilities!
* Possible fields: FieldE, FieldB, FieldJ
*/
typedef typename MakeSeq<FieldE, FieldB>::type NativeFileOutputFields;

/** TimeAvg Fields
* \todo Reduce/Avg on host-side RAM with a plugin
*/

/** FieldTmp output (calculated at runtime)
/** FieldTmp output (calculated at runtime) *******************************
*
* you can choose any of these particle to grid projections:
* - CreateDensityOperation: particle position + shape on the grid
* - CreateCounterOperation: counts point like particles per cell
* - CreateEnergyDensityOperation: particle energy density with respect to shape
* - CreateEnergyOperation: particle energy with respect to shape
* - CreateLarmorEnergyOperation: radiated larmor energy (needs ENABLE_RADIATION)
*/
using namespace particleToGrid;

/* ############## ParticleDensity section ################################*/

template<typename T_Species>
struct CreateDensityOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcDensity
> ParticleDensity;

typedef FieldTmpOperation< ParticleDensity, T_Species > type;
};

/* Density section */
typedef typename bmpl::transform<
VectorAllSpecies,
CreateDensityOperation<bmpl::_1>
>::type Density_Seq;

/* ############## ParticleCounter section ################################*/

template<typename T_Species>
struct CreateCounterOperation
{
typedef ComputeGridValuePerFrame<
particles::shapes::Counter,
ComputeGridValueOptions::calcCounter
> ParticleCounter;

typedef FieldTmpOperation< ParticleCounter, T_Species > type;
};

typedef bmpl::inserter< bmpl::vector<>, bmpl::insert<bmpl::_1, bmpl::_2> > vector_inserter;
/* ParticleCounter section */
typedef typename bmpl::transform<
VectorAllSpecies,
CreateCounterOperation<bmpl::_1>
>::type Counter_Seq;

/* ############## ParticleCounter section ################################*/

template<typename T_Species>
struct CreateEnergyDensityOperation
{
typedef typename GetShape<T_Species>::type shapeType;
typedef ComputeGridValuePerFrame<
shapeType,
ComputeGridValueOptions::calcEnergyDensity
> ParticleEnergyDensity;

typedef FieldTmpOperation< ParticleEnergyDensity, T_Species > type;
};

typedef bmpl::inserter< bmpl::vector<>, bmpl::insert<bmpl::_1, bmpl::_2> > vector_inserter;
/* EnergyDensity section */
typedef typename bmpl::transform<
VectorAllSpecies,
CreateEnergyDensityOperation<bmpl::_1>
>::type EnergyDensity_Seq;

/** FieldTmpSolvers groups all solver those needed FieldTmp

/** FieldTmpSolvers groups all solvers that create data for FieldTmp ******
*
* FieldTmpSolvers is used in @see FieldTmp to calculate the exchange size
*/
Expand All @@ -116,12 +73,24 @@ namespace picongpu
EnergyDensity_Seq
>::type FieldTmpSolvers;

/** This list is use to dump fields to a file. */

/** FileOutputFields: Groups all Fields that shall be dumped *************/

/** Possible native fields: FieldE, FieldB, FieldJ
*/
typedef typename MakeSeq<FieldE, FieldB>::type NativeFileOutputFields;

typedef typename MakeSeq<
NativeFileOutputFields,
FieldTmpSolvers
>::type FileOutputFields;


/** FileOutputParticles: Groups all Species that shall be dumped **********
*
* hint: to disable particle output set to
* typedef bmpl::vector0< > FileOutputParticles;
*/
typedef VectorAllSpecies FileOutputParticles;

}