ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | Static Public Member Functions | List of all members
PerCellGenerator Class Reference

#include <PerCellGenerator.h>

Inheritance diagram for PerCellGenerator:
InputBase

Public Member Functions

void readXML (XMLfileUnits &xmlconfig) override
 
void readPhaseSpaceHeader (Domain *domain, double timestep) override
 read the phase space components and header information More...
 
unsigned long readPhaseSpace (ParticleContainer *particleContainer, Domain *domain, DomainDecompBase *domainDecomp) override
 read the actual phase space information More...
 

Static Public Member Functions

static void fillContainer (ParticleContainer *particleContainer, Component *component, unsigned int numMoleculesPerCell, bool fillHalo)
 
static void generateTwoParticles (ParticleContainer *particleContainer, Component *component)
 

Detailed Description

Class that generates equally distributed particles with exactly the given number of particles per cell.

Note
: Currently only adds molecules with the first component.

Member Function Documentation

◆ fillContainer()

void PerCellGenerator::fillContainer ( ParticleContainer particleContainer,
Component component,
unsigned int  numMoleculesPerCell,
bool  fillHalo 
)
static

Fills the container with the specified number of molecules (with given component) per cell.

Parameters
particleContainer
component
numMoleculesPerCell
fillHaloIndicates whether to fill the halo cells as well.

◆ generateTwoParticles()

void PerCellGenerator::generateTwoParticles ( ParticleContainer particleContainer,
Component component 
)
static

Generates two particles/molecules at random positions within the boundaries of particleContainer.

Parameters
particleContainer
componentThe component of the particles.

◆ readPhaseSpace()

unsigned long PerCellGenerator::readPhaseSpace ( ParticleContainer particleContainer,
Domain domain,
DomainDecompBase domainDecomp 
)
overridevirtual

read the actual phase space information

Returns
number of read in molecules added to the particle containers of all processes

Implements InputBase.

◆ readPhaseSpaceHeader()

void PerCellGenerator::readPhaseSpaceHeader ( Domain domain,
double  timestep 
)
inlineoverridevirtual

read the phase space components and header information

Parameters
domainpointer to domain object
timesteptimestep length

Implements InputBase.

◆ readXML()

void PerCellGenerator::readXML ( XMLfileUnits xmlconfig)
overridevirtual

The following xml object structure is handled by this method:

<generator name="PerCellGenerator">
<!-- required field: number of molecules per cell -->
<numMoleculesPerCell>UNSIGNED INT<numMoleculesPerCell/>
<!-- required field: initial temperature -->
<initTemperature>DOUBLE<initTemperature/>
<!-- optional field (default=true): Iff true: Generates two particles per process if numMoleculesPerCell==0.
If no particles were generated at all, the simulation crashes.-->
<generateAtLeastTwoParticles>BOOL</generateAtLeastTwoParticles>
</generator>
Parameters
xmlconfig

Reimplemented from InputBase.


The documentation for this class was generated from the following files: