SPADES Class Reference
SPADES API
|
#include <SPADES.H>
Public Member Functions | |
SPADES () | |
~SPADES () override | |
void | init_data () |
Initializes data. | |
void | evolve () |
Advance solution to final time. | |
void | MakeNewLevelFromCoarse (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
Make a new level. | |
void | RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
Remake an existing level. | |
void | ClearLevel (int lev) override |
Delete level data. | |
void | MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
Make a level from scratch. | |
void | ErrorEst (int, amrex::TagBoxArray &, amrex::Real, int) override |
Tag cells for refinement. | |
std::unique_ptr< amrex::MultiFab > | get_field (const std::string &name, const int ngrow) |
Get a field based on a variable name. | |
void | plot_file_mf () |
Put together the MultiFab for output. | |
void | initialize_state () |
Initialize state. | |
void | init_particle_containers () |
Initialize the particle containers. | |
void | process_messages () |
Process messages. | |
void | rollback () |
Perform rollback. | |
void | rollback_statistics () |
Print rollback statistics. | |
void | update_gvt () |
Update the global virtual time. | |
void | update_lbts () |
Update the Lower Bound on Incoming Time Stamp. | |
Static Public Member Functions | |
static amrex::Real | est_time_step () |
Compute the time step. | |
Static Public Attributes | |
static constexpr int | LEV {0} |
Level index. | |
Private Member Functions | |
void | read_parameters () |
Read parameters. | |
void | compute_dt () |
Wrapper for EstTimeStep. | |
void | time_step (const amrex::Real time) |
Advance by the time step. | |
void | advance (const amrex::Real time, const amrex::Real dt) |
Advance for a single time step. | |
bool | check_field_existence (const std::string &name) |
Check if a field exists. | |
void | set_ics () |
Set the user defined IC functions. | |
std::string | plot_file_name (const int step) const |
Get plotfile name. | |
std::string | chk_file_name (const int step) const |
Get checkpoint file name. | |
amrex::Vector< std::string > | plot_file_var_names () const |
Set plotfile variables names. | |
void | write_plot_file () |
Write plotfile to disk. | |
void | write_checkpoint_file () const |
Write checkpoint file to disk. | |
void | read_checkpoint_file () |
Read checkpoint file from disk. | |
void | write_info_file (const std::string &path) const |
Write job info to disk. | |
void | write_rng_file (const std::string &path) const |
Write random number generator seed info. | |
void | read_rng_file (const std::string &path) const |
Read random number generator seed info. | |
void | init_rng () const |
Initialize the random number generator. | |
void | write_data_file (const bool is_init) const |
Write simulation information. | |
void | summary () |
Compute summary data. | |
Static Private Member Functions | |
static void | post_time_step () |
Perform work after a time step. | |
static int | get_field_component (const std::string &name, const amrex::Vector< std::string > &varnames) |
Get field component. | |
Private Attributes | |
int | m_istep {0} |
Current step. | |
amrex::Real | m_gvt {constants::LOW_NUM} |
Global virtual time. | |
amrex::Real | m_t_new {0.0} |
New time. | |
amrex::Real | m_t_old {constants::LOW_NUM} |
Old time. | |
amrex::Real | m_dt {constants::LARGE_NUM} |
Time step. | |
amrex::Real | m_lbts {constants::LOW_NUM} |
Lower bound on incoming time stamp. | |
amrex::Long | m_ncells {0} |
Cell count. | |
amrex::Long | m_ntotal_messages {0} |
Total message count. | |
amrex::Vector< amrex::Long > | m_nmessages |
Message counts. | |
amrex::Vector< amrex::Long > | m_min_messages |
Min of message counts. | |
amrex::Vector< amrex::Long > | m_max_messages |
Max of message counts. | |
amrex::Long | m_nprocessed_messages {0} |
Count of processed messages. | |
amrex::Long | m_ntotal_entities {0} |
Total entity count. | |
amrex::Long | m_nentities {0} |
Entity count. | |
amrex::Vector< int > | m_nrollbacks |
Number of rollbacks. | |
amrex::Vector< amrex::Real > | m_min_timings |
Min timings for each step. | |
amrex::Vector< amrex::Real > | m_max_timings |
Max timings for each step. | |
amrex::Vector< amrex::Real > | m_avg_timings |
Average timings for each step. | |
int | m_max_step = std::numeric_limits<int>::max() |
Maximum number of steps. | |
amrex::Real | m_stop_time = std::numeric_limits<amrex::Real>::max() |
Stop time. | |
amrex::Vector< std::string > | m_spades_varnames |
All variable names for output. | |
amrex::Vector< std::string > | m_state_varnames |
State variable names for output. | |
amrex::Vector< std::string > | m_message_counts_varnames |
Message count names for output. | |
amrex::Vector< std::string > | m_entity_counts_varnames |
Entity count names for output. | |
amrex::MultiFab | m_state |
Multifabs to store the solution. | |
amrex::MultiFab | m_plt_mf |
Multifabs for output. | |
const int | m_state_ngrow = 0 |
Number of ghost cells. | |
std::string | m_restart_chkfile |
Restart file name, restart from this checkpoint if it is not empty. | |
std::string | m_plot_file {"plt"} |
Plotfile prefix (optional user input) | |
int | m_plot_int = -1 |
Plotfile frequency (optional user input) | |
std::string | m_chk_file {"chk"} |
Checkpoint prefix (optional user input) | |
int | m_chk_int = -1 |
Checkpoint frequency (optional user input) | |
int | m_nfiles {constants::TWO_TO_EIGHT} |
Number of plot and checkpoint data files per write. | |
int | m_file_name_digits {constants::FILE_NAME_DIGITS} |
Digits used in the plotfile and checkpoint file names. | |
int | m_rng_file_name_digits {constants::RNG_FILE_NAME_DIGITS} |
Digits used in the rng seed file names. | |
bool | m_write_messages {false} |
Boolean to output messages (optional user input) | |
bool | m_write_entities {false} |
Boolean to output entities (optional user input) | |
std::string | m_data_fname {"data.csv"} |
Filename for simulation data. | |
const int | m_data_precision {6} |
Data precision for data output. | |
amrex::Real | m_lookahead {1.0} |
Lookahead value (optional user input) | |
amrex::Real | m_window_size {constants::LARGE_NUM} |
Window size for processing messages (optional user input) | |
int | m_messages_per_step {1} |
Number of messages to process in each step (optional user input) | |
int | m_entities_per_lp {1} |
Number of entities per logical process (optional user input) | |
int | m_messages_per_lp {1} |
Number of messages per logical process (optional user input) | |
int | m_seed {0} |
Random number generator seed (optional user input) | |
amrex::Real | m_lambda {1.0} |
std::unique_ptr< ic::InitializerBase > | m_ic_op |
Initial condition operator. | |
std::string | m_ic_type |
Initial condition type (optional user input) | |
std::unique_ptr< particles::MessageParticleContainer > | m_message_pc |
Message particle container. | |
std::unique_ptr< particles::EntityParticleContainer > | m_entity_pc |
Entity article container. | |
Detailed Description
Main SPADES class.
Constructor & Destructor Documentation
◆ SPADES()
spades::SPADES::SPADES | ( | ) |
◆ ~SPADES()
|
overridedefault |
Member Function Documentation
◆ advance()
|
private |
Advance for a single time step.
- Parameters
-
time [in] time dt [in] time step
◆ check_field_existence()
|
private |
Check if a field exists.
- Parameters
-
name [in] field name
- Returns
- True if field of
name
exists
◆ chk_file_name()
|
nodiscardprivate |
Get checkpoint file name.
- Parameters
-
step [in] current time step
- Returns
- chkfile name
◆ ClearLevel()
|
override |
Delete level data.
Overrides the pure virtual function in AmrCore.
- Parameters
-
lev [in] level
◆ compute_dt()
|
private |
Wrapper for EstTimeStep.
◆ ErrorEst()
|
inlineoverride |
Tag cells for refinement.
Overrides the pure virtual function in AmrCore
◆ est_time_step()
|
static |
Compute the time step.
- Returns
- the time step
◆ evolve()
void spades::SPADES::evolve | ( | ) |
Advance solution to final time.
◆ get_field()
std::unique_ptr< amrex::MultiFab > spades::SPADES::get_field | ( | const std::string & | name, |
const int | ngrow ) |
Get a field based on a variable name.
- Parameters
-
name [in] field name ngrow [in] number of grow cells
- Returns
- the requested field
◆ get_field_component()
|
staticprivate |
Get field component.
- Parameters
-
name [in] field name varnames [in] vector of the field names
- Returns
- field component
◆ init_data()
void spades::SPADES::init_data | ( | ) |
Initializes data.
◆ init_particle_containers()
void spades::SPADES::init_particle_containers | ( | ) |
Initialize the particle containers.
◆ init_rng()
|
private |
Initialize the random number generator.
◆ initialize_state()
void spades::SPADES::initialize_state | ( | ) |
Initialize state.
◆ MakeNewLevelFromCoarse()
|
override |
Make a new level.
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data. Overrides the pure virtual function in AmrCore.
- Parameters
-
lev [in] level time [in] time ba [in] box array dm [in] distribution map
◆ MakeNewLevelFromScratch()
|
override |
Make a level from scratch.
Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization. Overrides the pure virtual function in AmrCore
- Parameters
-
lev [in] level time [in] time ba [in] box array dm [in] distribution map
◆ plot_file_mf()
void spades::SPADES::plot_file_mf | ( | ) |
Put together the MultiFab for output.
◆ plot_file_name()
|
nodiscardprivate |
Get plotfile name.
- Parameters
-
step [in] current time step
- Returns
- plotfile name
◆ plot_file_var_names()
|
nodiscardprivate |
Set plotfile variables names.
- Returns
- vector of variable names
◆ post_time_step()
|
staticprivate |
Perform work after a time step.
◆ process_messages()
void spades::SPADES::process_messages | ( | ) |
Process messages.
◆ read_checkpoint_file()
|
private |
Read checkpoint file from disk.
◆ read_parameters()
|
private |
Read parameters.
◆ read_rng_file()
|
private |
Read random number generator seed info.
- Parameters
-
path [in] path for file
◆ RemakeLevel()
|
override |
Remake an existing level.
Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data. Overrides the pure virtual function in AmrCore.
- Parameters
-
lev [in] level time [in] time ba [in] box array dm [in] distribution map
◆ rollback()
void spades::SPADES::rollback | ( | ) |
Perform rollback.
◆ rollback_statistics()
void spades::SPADES::rollback_statistics | ( | ) |
Print rollback statistics.
◆ set_ics()
|
private |
Set the user defined IC functions.
◆ summary()
|
private |
Compute summary data.
◆ time_step()
|
private |
Advance by the time step.
- Parameters
-
time [in] time
◆ update_gvt()
void spades::SPADES::update_gvt | ( | ) |
◆ update_lbts()
void spades::SPADES::update_lbts | ( | ) |
Update the Lower Bound on Incoming Time Stamp.
◆ write_checkpoint_file()
|
private |
Write checkpoint file to disk.
◆ write_data_file()
|
private |
Write simulation information.
- Parameters
-
is_init [in] boolean indicating if this is the initializing step
◆ write_info_file()
|
private |
Write job info to disk.
- Parameters
-
path [in] path for file
◆ write_plot_file()
|
private |
Write plotfile to disk.
◆ write_rng_file()
|
private |
Write random number generator seed info.
- Parameters
-
path [in] path for file
Member Data Documentation
◆ LEV
|
staticconstexpr |
Level index.
◆ m_avg_timings
|
private |
Average timings for each step.
◆ m_chk_file
|
private |
Checkpoint prefix (optional user input)
◆ m_chk_int
|
private |
Checkpoint frequency (optional user input)
◆ m_data_fname
|
private |
Filename for simulation data.
◆ m_data_precision
|
private |
Data precision for data output.
◆ m_dt
|
private |
Time step.
◆ m_entities_per_lp
|
private |
Number of entities per logical process (optional user input)
◆ m_entity_counts_varnames
|
private |
Entity count names for output.
◆ m_entity_pc
|
private |
Entity article container.
◆ m_file_name_digits
|
private |
Digits used in the plotfile and checkpoint file names.
◆ m_gvt
|
private |
Global virtual time.
◆ m_ic_op
|
private |
Initial condition operator.
◆ m_ic_type
|
private |
Initial condition type (optional user input)
◆ m_istep
|
private |
Current step.
◆ m_lambda
|
private |
Width of exponential distribution (optional user input) smaller values of lambda = larger variance in random values larger values of lambda = smaller variance in random values
◆ m_lbts
|
private |
Lower bound on incoming time stamp.
◆ m_lookahead
|
private |
Lookahead value (optional user input)
◆ m_max_messages
|
private |
Max of message counts.
◆ m_max_step
|
private |
Maximum number of steps.
◆ m_max_timings
|
private |
Max timings for each step.
◆ m_message_counts_varnames
|
private |
Message count names for output.
◆ m_message_pc
|
private |
Message particle container.
◆ m_messages_per_lp
|
private |
Number of messages per logical process (optional user input)
◆ m_messages_per_step
|
private |
Number of messages to process in each step (optional user input)
◆ m_min_messages
|
private |
Min of message counts.
◆ m_min_timings
|
private |
Min timings for each step.
◆ m_ncells
|
private |
Cell count.
◆ m_nentities
|
private |
Entity count.
◆ m_nfiles
|
private |
Number of plot and checkpoint data files per write.
◆ m_nmessages
|
private |
Message counts.
◆ m_nprocessed_messages
|
private |
Count of processed messages.
◆ m_nrollbacks
|
private |
Number of rollbacks.
◆ m_ntotal_entities
|
private |
Total entity count.
◆ m_ntotal_messages
|
private |
Total message count.
◆ m_plot_file
|
private |
Plotfile prefix (optional user input)
◆ m_plot_int
|
private |
Plotfile frequency (optional user input)
◆ m_plt_mf
|
private |
Multifabs for output.
◆ m_restart_chkfile
|
private |
Restart file name, restart from this checkpoint if it is not empty.
◆ m_rng_file_name_digits
|
private |
Digits used in the rng seed file names.
◆ m_seed
|
private |
Random number generator seed (optional user input)
◆ m_spades_varnames
|
private |
All variable names for output.
◆ m_state
|
private |
Multifabs to store the solution.
◆ m_state_ngrow
|
private |
Number of ghost cells.
◆ m_state_varnames
|
private |
State variable names for output.
◆ m_stop_time
|
private |
Stop time.
◆ m_t_new
|
private |
New time.
◆ m_t_old
|
private |
Old time.
◆ m_window_size
|
private |
Window size for processing messages (optional user input)
◆ m_write_entities
|
private |
Boolean to output entities (optional user input)
◆ m_write_messages
|
private |
Boolean to output messages (optional user input)
The documentation for this class was generated from the following files:
- /home/runner/work/spades/spades/Source/SPADES.H
- /home/runner/work/spades/spades/Source/SPADES.cpp
Generated by