GInX
Geodesics Integrator tool for particles in GRMHD using Adaptive Mesh Refinement using AMReX.
GInX::BaseParticleContainer< OtherContainer, StructType > Class Template Referenceabstract

BaseParticleContainer abstract class definition. More...

#include <BaseParticleContainer.hxx>

+ Inheritance diagram for GInX::BaseParticleContainer< OtherContainer, StructType >:
+ Collaboration diagram for GInX::BaseParticleContainer< OtherContainer, StructType >:

Public Member Functions

 BaseParticleContainer (amrex::AmrCore *amr_core)
 
virtual ~BaseParticleContainer ()=default
 
template<typename Function >
void initialize (Function initializer_function, const CCTK_REAL *real_params, const CCTK_INT *int_params)
 Initialize the particles given a custom initialization function. More...
 
template<typename Function >
void initialize (Function initializer_function, const amrex::MultiFab &metric, const int &level, const CCTK_REAL *real_params, const CCTK_INT *int_params)
 Initialize the particles given a custom initialization function. More...
 
virtual void evolve (const amrex::MultiFab &lapse, const amrex::MultiFab &shift, const amrex::MultiFab &metric, const amrex::MultiFab &curv, const CCTK_REAL &dt, const int &lev)=0
 
void check_banned_zones (const int &level, const CCTK_INT4 &zones, const CCTK_REAL(&x)[10], const CCTK_REAL(&y)[10], const CCTK_REAL(&z)[10], const CCTK_REAL(&radius)[10])
 
void outputParticlesAscii (const int &it, const int &plot_every, const std::string &out_dir)
 
void outputParticlesPlot (const int &it, const int &plot_every, const std::string &out_dir)
 

Public Attributes

const std::string name = StructType::name
 

Static Public Attributes

static constexpr int n_attributes = StructType::n_attributes
 

Detailed Description

template<typename OtherContainer, typename StructType>
class GInX::BaseParticleContainer< OtherContainer, StructType >

BaseParticleContainer abstract class definition.

The BaseParticleContainer abstract class defines the methods that must be defined for the other <Particle>Containers derived classes. This is templated on the new Container and the struct that defines the parameters of the particles.

It inherits from the AMRex AmrParticleContainer class, using a number of real attributes defined inside the particle struct.

Constructor & Destructor Documentation

◆ BaseParticleContainer()

template<typename OtherContainer , typename StructType >
GInX::BaseParticleContainer< OtherContainer, StructType >::BaseParticleContainer ( amrex::AmrCore *  amr_core)
inline

The BaseParticleContainer constructor initialize the AmrCore superclass receiving an external AmrCore instance.

Parameters
amr_coreA pointer to an amrex::AmrCore instance.

◆ ~BaseParticleContainer()

template<typename OtherContainer , typename StructType >
virtual GInX::BaseParticleContainer< OtherContainer, StructType >::~BaseParticleContainer ( )
virtualdefault

Member Function Documentation

◆ check_banned_zones()

template<typename OtherContainer , typename StructType >
void GInX::BaseParticleContainer< OtherContainer, StructType >::check_banned_zones ( const int &  level,
const CCTK_INT4 &  zones,
const CCTK_REAL(&)  x[10],
const CCTK_REAL(&)  y[10],
const CCTK_REAL(&)  z[10],
const CCTK_REAL(&)  radius[10] 
)
inline

The check banned zones function check for user defined invalid particles zones.

Parameters
levelAdaptive Mesh Refinement level
zonesNumber of banned zones
xx-coordinates array for each region
yy-coordinates array for each region
zz-coordinates array for each region
radiusRadius array for each region

◆ evolve()

template<typename OtherContainer , typename StructType >
virtual void GInX::BaseParticleContainer< OtherContainer, StructType >::evolve ( const amrex::MultiFab &  lapse,
const amrex::MultiFab &  shift,
const amrex::MultiFab &  metric,
const amrex::MultiFab &  curv,
const CCTK_REAL &  dt,
const int &  lev 
)
pure virtual

The evolve abstract method evolve the system given the differential equations and the computed rhs. Has to be override for each different type particle.

Parameters
lapseADM lapse function
shiftADM shift vector
metricADM induced metric
curvADM extrinsic curvature
dtTime step
levAMR level

Implemented in GInX::ParticlesContainer< StructType >.

◆ initialize() [1/2]

template<typename OtherContainer , typename StructType >
template<typename Function >
void GInX::BaseParticleContainer< OtherContainer, StructType >::initialize ( Function  initializer_function,
const amrex::MultiFab &  metric,
const int &  level,
const CCTK_REAL *  real_params,
const CCTK_INT *  int_params 
)
inline

Initialize the particles given a custom initialization function.

The initialize method receives a function and use it to assign the initial conditions over the particles. This function can be implemented by other users or use the ones defined in the file Initializers.hxx.

Parameters
initializer_functionFunction that receives a BaseParticleContainer instance, one array full of doubles and another full of integers as parameters, how to use this parameters have to be defined inside of the custom function.
metric3D ADM Metric.
levelCurrent refinement level.
real_paramsDouble type array that contains the real parameters needed to initialize the particles.
int_paramsInteger type array that contains the integer parameters needed to initialize the particles.

◆ initialize() [2/2]

template<typename OtherContainer , typename StructType >
template<typename Function >
void GInX::BaseParticleContainer< OtherContainer, StructType >::initialize ( Function  initializer_function,
const CCTK_REAL *  real_params,
const CCTK_INT *  int_params 
)
inline

Initialize the particles given a custom initialization function.

The initialize method receives a function and use it to assign the initial conditions over the particles. This function can be implemented by other users or use the ones defined in the file Initializers.hxx.

Parameters
initializer_functionFunction that receives a BaseParticleContainer instance, one array full of doubles and another full of integers as parameters, how to use this parameters have to be defined inside of the custom function.
real_paramsDouble type array that contains the real parameters needed to initialize the particles.
int_paramsInteger type array that contains the integer parameters needed to initialize the particles.

◆ outputParticlesAscii()

template<typename OtherContainer , typename StructType >
void GInX::BaseParticleContainer< OtherContainer, StructType >::outputParticlesAscii ( const int &  it,
const int &  plot_every,
const std::string &  out_dir 
)
inline

Print out particle data into files using ascii.

Parameters
itCurrent iteration.
plot_everyPrint after plot_every iterations.
out_dirSimulation directory path to output the data.

◆ outputParticlesPlot()

template<typename OtherContainer , typename StructType >
void GInX::BaseParticleContainer< OtherContainer, StructType >::outputParticlesPlot ( const int &  it,
const int &  plot_every,
const std::string &  out_dir 
)
inline

Print out particle data into files using binary managed by AMReX.

Parameters
itCurrent iteration.
plot_everyPrint after plot_every iterations.
out_dirSimulation directory path to output the data.

Member Data Documentation

◆ n_attributes

template<typename OtherContainer , typename StructType >
constexpr int GInX::BaseParticleContainer< OtherContainer, StructType >::n_attributes = StructType::n_attributes
staticconstexpr

◆ name

template<typename OtherContainer , typename StructType >
const std::string GInX::BaseParticleContainer< OtherContainer, StructType >::name = StructType::name

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