SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt > Class Template Reference
SPADES API
|
Main SPADES particle container. More...
#include <SpadesParticleContainer.H>
Public Types | |
using | ParticleType |
using | ParticleTileType |
using | IntVector |
using | RealVector |
Public Member Functions | |
SpadesParticleContainer (amrex::AmrParGDB *par_gdb, int ngrow=0) | |
Constructor. | |
SpadesParticleContainer (const amrex::Vector< amrex::Geometry > &geom, const amrex::Vector< amrex::DistributionMapping > &dmap, const amrex::Vector< amrex::BoxArray > &ba, int ngrow=0) | |
Constructor. | |
void | initialize_state () |
Initialize particle states (counts and offsets) | |
void | clear_state () |
Delete particle states (counts and offsets) | |
void | update_counts () |
Update the particle counts and offsets. | |
void | count_particles () |
Update the particle counts. | |
void | count_offsets () |
Update the particle offsets. | |
const amrex::iMultiFab & | counts () const |
Get the particle counts. | |
const amrex::iMultiFab & | offsets () const |
Get the particle offsets. | |
amrex::Long | total_count (const int typ) const |
Get the total number of particles of typ . | |
amrex::Long | min_count (const int typ) const |
Get the minimum number of particles of typ . | |
amrex::Long | max_count (const int typ) const |
Get the maximum number of particles of typ . | |
void | check_sort (const amrex::MFIter &mfi) |
Check the result of the sort operation. | |
virtual void | sort ()=0 |
Sort the particles. | |
template<typename CompareFunctor > | |
void | sort_impl (const CompareFunctor &compare) |
Sort the particles implementation. | |
template<typename CompareFunctor > | |
void | nonencoded_sort_impl (const CompareFunctor &compare) |
Non-encoded sort the particles implementation. | |
void | encoded_sort_impl () |
Encoded sort the particles implementation. | |
void | print_messages (const std::string &header) |
Print all the particles to screen. | |
void | reposition_particles () |
Reposition the particles inside a cell for visualization. | |
virtual void | write_plot_file (const std::string &plt_filename)=0 |
Write the particles to file. | |
int | ngrow () const |
Number of grow cells. | |
virtual void | initialize_variable_names ()=0 |
Initialize variable names. | |
void | write_plot_file_impl (const std::string &plt_filename, const std::string &name) |
Write the particles to file (implementation) | |
virtual void | read_parameters () |
Read user parameters. | |
void | check_sort_type (const std::string &sort_type) |
Check valid sort type. | |
ParticleArrays< NArrayReal, NArrayInt, ParticleType, RealVector, IntVector > | particle_arrays (ParticleTileType &pti) const |
template<typename CompareFunc > | |
void | sort_impl (const CompareFunc &compare) |
template<typename CompareFunc > | |
void | nonencoded_sort_impl (const CompareFunc &compare) |
template<typename CompareFunc > | |
void | sort_impl (const CompareFunc &compare) |
template<typename CompareFunc > | |
void | nonencoded_sort_impl (const CompareFunc &compare) |
Static Public Member Functions | |
static std::string | identifier () |
Class identifier name. | |
Static Public Attributes | |
static constexpr int | LEV {0} |
Level index. | |
Protected Attributes | |
int | m_ngrow |
Number of grow cells. | |
amrex::Vector< int > | m_writeflags_real |
Flags for real data to write to file. | |
amrex::Vector< int > | m_writeflags_int |
Flags for int data to write to file. | |
amrex::Vector< std::string > | m_real_data_names |
Names for real data to write to file. | |
amrex::Vector< std::string > | m_int_data_names |
Names for int data to write to file. | |
std::string | m_sort_type {"nonencoded"} |
Sort type. | |
amrex::iMultiFab | m_counts |
Count of particles in each cell. | |
amrex::iMultiFab | m_offsets |
Offsets of particles in each cell. | |
amrex::MultiFab | m_min_timestamp |
Minimum timestamp in each cell for each type. | |
amrex::MultiFab | m_max_timestamp |
Maximum timestamp in each cell for each type. | |
Detailed Description
class spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >
Main SPADES particle container.
Member Typedef Documentation
◆ IntVector
using spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::IntVector |
◆ ParticleTileType
using spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleTileType |
◆ ParticleType
using spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleType |
◆ RealVector
using spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::RealVector |
Constructor & Destructor Documentation
◆ SpadesParticleContainer() [1/2]
|
explicit |
Constructor.
- Parameters
-
par_gdb [in] particle database ngrow [in] number of grow cells
◆ SpadesParticleContainer() [2/2]
|
explicit |
Constructor.
- Parameters
-
geom [in] geometry dmap [in] distribution map ba [in] box array ngrow [in] number of grow cells
Member Function Documentation
◆ check_sort()
void SpadesParticleContainer::check_sort | ( | const amrex::MFIter & | mfi | ) |
Check the result of the sort operation.
◆ check_sort_type()
|
inline |
Check valid sort type.
◆ clear_state()
void SpadesParticleContainer::clear_state | ( | ) |
Delete particle states (counts and offsets)
◆ count_offsets()
void SpadesParticleContainer::count_offsets | ( | ) |
Update the particle offsets.
◆ count_particles()
void SpadesParticleContainer::count_particles | ( | ) |
Update the particle counts.
◆ counts()
|
inline |
◆ encoded_sort_impl()
void SpadesParticleContainer::encoded_sort_impl | ( | ) |
Encoded sort the particles implementation.
◆ identifier()
|
inlinestatic |
Class identifier name.
- Returns
- class identifier
◆ initialize_state()
void SpadesParticleContainer::initialize_state | ( | ) |
Initialize particle states (counts and offsets)
◆ initialize_variable_names()
|
pure virtual |
Initialize variable names.
Implemented in spades::particles::EntityParticleContainer, and spades::particles::MessageParticleContainer.
◆ max_count()
|
inline |
◆ min_count()
|
inline |
◆ ngrow()
|
inline |
Number of grow cells.
◆ nonencoded_sort_impl() [1/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::nonencoded_sort_impl | ( | const CompareFunc & | compare | ) |
◆ nonencoded_sort_impl() [2/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::nonencoded_sort_impl | ( | const CompareFunc & | compare | ) |
◆ nonencoded_sort_impl() [3/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::nonencoded_sort_impl | ( | const CompareFunctor & | compare | ) |
Non-encoded sort the particles implementation.
- Parameters
-
compare [in] comparison functor
◆ offsets()
|
inline |
◆ particle_arrays()
|
inline |
◆ print_messages()
void SpadesParticleContainer::print_messages | ( | const std::string & | header | ) |
Print all the particles to screen.
◆ read_parameters()
|
inlinevirtual |
Read user parameters.
Reimplemented in spades::particles::EntityParticleContainer, and spades::particles::MessageParticleContainer.
◆ reposition_particles()
void SpadesParticleContainer::reposition_particles | ( | ) |
Reposition the particles inside a cell for visualization.
◆ sort()
|
pure virtual |
Sort the particles.
Implemented in spades::particles::EntityParticleContainer, and spades::particles::MessageParticleContainer.
◆ sort_impl() [1/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::sort_impl | ( | const CompareFunc & | compare | ) |
◆ sort_impl() [2/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::sort_impl | ( | const CompareFunc & | compare | ) |
◆ sort_impl() [3/3]
void spades::particles::SpadesParticleContainer< NType, NStructReal, NStructInt, NArrayReal, NArrayInt >::sort_impl | ( | const CompareFunctor & | compare | ) |
Sort the particles implementation.
- Parameters
-
compare [in] comparison functor
◆ total_count()
|
inline |
◆ update_counts()
void SpadesParticleContainer::update_counts | ( | ) |
Update the particle counts and offsets.
◆ write_plot_file()
|
pure virtual |
Write the particles to file.
- Parameters
-
plt_filename [in] file name for the plot file
Implemented in spades::particles::EntityParticleContainer, and spades::particles::MessageParticleContainer.
◆ write_plot_file_impl()
void SpadesParticleContainer::write_plot_file_impl | ( | const std::string & | plt_filename, |
const std::string & | name ) |
Write the particles to file (implementation)
- Parameters
-
plt_filename [in] file name for the plot file name [in] file name for the particle file
Member Data Documentation
◆ LEV
|
staticconstexpr |
Level index.
◆ m_counts
|
protected |
Count of particles in each cell.
◆ m_int_data_names
|
protected |
Names for int data to write to file.
◆ m_max_timestamp
|
protected |
Maximum timestamp in each cell for each type.
◆ m_min_timestamp
|
protected |
Minimum timestamp in each cell for each type.
◆ m_ngrow
|
protected |
Number of grow cells.
◆ m_offsets
|
protected |
Offsets of particles in each cell.
◆ m_real_data_names
|
protected |
Names for real data to write to file.
◆ m_sort_type
|
protected |
Sort type.
◆ m_writeflags_int
|
protected |
Flags for int data to write to file.
◆ m_writeflags_real
|
protected |
Flags for real data to write to file.
The documentation for this class was generated from the following files:
- /home/runner/work/spades/spades/Source/SpadesParticleContainer.H
- /home/runner/work/spades/spades/Source/SpadesParticleContainerImpl.H
Generated by