Current and previous level-time data. More...
#include <AMReX_StateData.H>
Classes | |
| struct | TimeInterval |
Public Member Functions | |
| StateData () | |
| The default constructor. | |
| StateData (const Box &p_domain, const BoxArray &grds, const DistributionMapping &dm, const StateDescriptor *d, Real cur_time, Real dt, const FabFactory< FArrayBox > &factory) | |
| Constructor that properly initializes data members. | |
| ~StateData () | |
| The destructor. | |
| StateData (StateData &&rhs) noexcept | |
| StateData & | operator= (StateData const &rhs) |
| StateData (StateData const &rhs)=delete | |
| StateData & | operator= (StateData &&rhs)=delete |
| void | define (const Box &p_domain, const BoxArray &grds, const DistributionMapping &dm, const StateDescriptor &d, Real cur_time, Real dt, const FabFactory< FArrayBox > &factory) |
| Initializes data members if you used default constructor. | |
| void | copyOld (const StateData &state) |
| Copies old data from another StateData object and sets the same time level. If old data is uninitialized, allocates it with same properties as the input data. | |
| void | copyNew (const StateData &state) |
| Copies new data from another StateData object and sets the same time level. If new data is uninitialized, allocates it with the same properties as the input data. | |
| void | allocOldData () |
| Allocates space for old timestep data. | |
| void | removeOldData () |
| Deletes the space used by the old timestep data. | |
| void | reset () |
| Reverts back to initial state. | |
| void | swapTimeLevels (Real dt) |
| Old data becomes new data and new time is incremented by dt. | |
| void | replaceOldData (MultiFab &&mf) |
| Swaps old data with a new MultiFab. Deletes the previous old data. | |
| void | replaceOldData (StateData &s) |
| Swaps old data with another StateData. Does not delete the previous old data. | |
| void | replaceNewData (MultiFab &&mf) |
| Swaps new data with a new MultiFab. Deletes the previous new data. | |
| void | replaceNewData (StateData &s) |
| Swaps new data with another StateData. Does not delete the previous new data. | |
| void | setTimeLevel (Real time, Real dt_old, Real dt_new) |
| Sets time of old and new data. | |
| void | setOldTimeLevel (Real time) |
| Sets time of old data. | |
| void | setNewTimeLevel (Real time) |
| Sets time of new data. | |
| void | syncNewTimeLevel (Real time) |
| void | RegisterData (MultiFabCopyDescriptor &multiFabCopyDesc, Vector< MultiFabId > &mfid) |
| void | InterpAddBox (MultiFabCopyDescriptor &multiFabCopyDesc, Vector< MultiFabId > &mfid, BoxList *returnedUnfillableBoxes, Vector< FillBoxId > &returnedFillBoxIds, const Box &subbox, Real time, int src_comp, int dest_comp, int num_comp, bool extrap=false) |
| void | InterpFillFab (MultiFabCopyDescriptor &fabCopyDesc, const Vector< MultiFabId > &mfid, const Vector< FillBoxId > &fillBoxIds, FArrayBox &dest, Real time, int src_comp, int dest_comp, int num_comp, bool extrap=false) |
| void | FillBoundary (FArrayBox &dest, Real time, const Real *dx, const RealBox &prob_domain, int dest_comp, int src_comp, int num_comp=1) |
| Set physical bndry values. | |
| void | FillBoundary (Box const &bx, FArrayBox &dest, Real time, Geometry const &geom, int dest_comp, int src_comp, int num_comp) |
| void | checkPoint (const std::string &name, const std::string &fullpathname, std::ostream &os, VisMF::How how, bool dump_old=true) |
| Write the state data to a checkpoint file. | |
| void | restart (std::istream &is, const Box &p_domain, const BoxArray &grds, const DistributionMapping &dm, const FabFactory< FArrayBox > &factory, const StateDescriptor &d, const std::string &chkfile) |
| Restart with domain box, grids, and dmap provided. | |
| void | restart (const StateDescriptor &d, const StateData &rhs) |
| or from another similar state | |
| const StateDescriptor * | descriptor () const noexcept |
| Returns the StateDescriptor. | |
| const Box & | getDomain () const noexcept |
| Returns the valid domain. | |
| const BoxArray & | boxArray () const noexcept |
| Returns the BoxArray. | |
| void | setBoxArray (BoxArray const &a_grids) noexcept |
| const DistributionMapping & | DistributionMap () const noexcept |
| void | setDistributionMap (DistributionMapping &new_dmap) noexcept |
| const FabFactory< FArrayBox > & | Factory () const noexcept |
| void | setFactory (FabFactory< FArrayBox > const &a_factory) |
| Real | curTime () const noexcept |
| Returns the current time. | |
| Real | prevTime () const noexcept |
| Returns the previous time. | |
| MultiFab & | newData () noexcept |
| Returns the new data. | |
| const MultiFab & | newData () const noexcept |
| Returns the new data. | |
| MultiFab & | oldData () noexcept |
| Returns the old data. | |
| const MultiFab & | oldData () const noexcept |
| Returns the old data. | |
| FArrayBox & | newGrid (int i) noexcept |
| Returns the FAB of new data at grid index ‘i’. | |
| FArrayBox & | oldGrid (int i) noexcept |
| Returns the FAB of old data at grid index ‘i’. | |
| BCRec | getBC (int comp, int i) const noexcept |
| Returns boundary conditions of specified component on the specified grid. | |
| void | printTimeInterval (std::ostream &os) const |
| Prints out the time interval. | |
| bool | hasOldData () const noexcept |
| True if there is any old data available. | |
| bool | hasNewData () const noexcept |
| True if there is any new data available. | |
| void | getData (Vector< MultiFab * > &data, Vector< Real > &datatime, Real time) const |
| Arena * | getArena () const noexcept |
| Get the Arena used. | |
| void | setArena (Arena *ar) noexcept |
| Set the Arena used. | |
Static Public Member Functions | |
| static const Vector< std::string > & | FabArrayHeaderNames () |
| These facilitate prereading FabArray headers to avoid synchronization when reading multiple FabArrays. | |
| static void | ClearFabArrayHeaderNames () |
| static void | SetFAHeaderMapPtr (std::map< std::string, Vector< char > > *fahmp) |
Private Member Functions | |
| void | restartDoit (std::istream &is, const std::string &chkfile) |
Private Attributes | |
| std::unique_ptr< FabFactory< FArrayBox > > | m_factory |
| const StateDescriptor * | desc {nullptr} |
| Pointer to data descriptor. | |
| Box | domain |
| Problem domain. | |
| BoxArray | grids |
| Grids defined at this level. | |
| DistributionMapping | dmap |
| TimeInterval | new_time |
| Time variable assoc with new data. | |
| TimeInterval | old_time |
| Time variable assoc with old data. | |
| std::unique_ptr< MultiFab > | new_data |
| Pointer to new-time data. | |
| std::unique_ptr< MultiFab > | old_data |
| Pointer to previous time data. | |
| Arena * | arena {nullptr} |
| Arena we should use for allocating the data. | |
Static Private Attributes | |
| static Vector< std::string > | fabArrayHeaderNames |
| This is used as a temporary collection of FabArray header names written during a checkpoint. | |
| static std::map< std::string, Vector< char > > * | faHeaderMap |
| This is used to store preread FabArray headers. | |
Friends | |
| class | StateDataPhysBCFunct |
Current and previous level-time data.
StateData holds state data on a level for the current and previous time step.
| amrex::StateData::StateData | ( | ) |
The default constructor.
| amrex::StateData::StateData | ( | const Box & | p_domain, |
| const BoxArray & | grds, | ||
| const DistributionMapping & | dm, | ||
| const StateDescriptor * | d, | ||
| Real | cur_time, | ||
| Real | dt, | ||
| const FabFactory< FArrayBox > & | factory | ||
| ) |
Constructor that properly initializes data members.
| p_domain | |
| grds | |
| dm | |
| d | |
| cur_time | |
| dt | |
| factory |
| amrex::StateData::~StateData | ( | ) |
The destructor.
|
noexcept |
|
delete |
| void amrex::StateData::allocOldData | ( | ) |
Allocates space for old timestep data.
| void amrex::StateData::checkPoint | ( | const std::string & | name, |
| const std::string & | fullpathname, | ||
| std::ostream & | os, | ||
| VisMF::How | how, | ||
| bool | dump_old = true |
||
| ) |
Write the state data to a checkpoint file.
| name | |
| fullpathname | |
| os | |
| how | |
| dump_old |
|
inlinestatic |
| void amrex::StateData::copyNew | ( | const StateData & | state | ) |
Copies new data from another StateData object and sets the same time level. If new data is uninitialized, allocates it with the same properties as the input data.
| state |
| void amrex::StateData::copyOld | ( | const StateData & | state | ) |
Copies old data from another StateData object and sets the same time level. If old data is uninitialized, allocates it with same properties as the input data.
| state |
|
inlinenoexcept |
Returns the current time.
| void amrex::StateData::define | ( | const Box & | p_domain, |
| const BoxArray & | grds, | ||
| const DistributionMapping & | dm, | ||
| const StateDescriptor & | d, | ||
| Real | cur_time, | ||
| Real | dt, | ||
| const FabFactory< FArrayBox > & | factory | ||
| ) |
Initializes data members if you used default constructor.
| p_domain | |
| grds | |
| dm | |
| d | |
| cur_time | |
| dt | |
| factory |
|
inlinenoexcept |
Returns the StateDescriptor.
|
inlinenoexcept |
|
inlinestatic |
These facilitate prereading FabArray headers to avoid synchronization when reading multiple FabArrays.
|
inlinenoexcept |
| void amrex::StateData::FillBoundary | ( | Box const & | bx, |
| FArrayBox & | dest, | ||
| Real | time, | ||
| Geometry const & | geom, | ||
| int | dest_comp, | ||
| int | src_comp, | ||
| int | num_comp | ||
| ) |
| void amrex::StateData::FillBoundary | ( | FArrayBox & | dest, |
| Real | time, | ||
| const Real * | dx, | ||
| const RealBox & | prob_domain, | ||
| int | dest_comp, | ||
| int | src_comp, | ||
| int | num_comp = 1 |
||
| ) |
Set physical bndry values.
| dest | |
| time | |
| dx | |
| prob_domain | |
| dest_comp | |
| src_comp | |
| num_comp |
|
noexcept |
Returns boundary conditions of specified component on the specified grid.
| comp | |
| i |
| void amrex::StateData::getData | ( | Vector< MultiFab * > & | data, |
| Vector< Real > & | datatime, | ||
| Real | time | ||
| ) | const |
|
inlinenoexcept |
Returns the valid domain.
|
inlinenoexcept |
True if there is any new data available.
|
inlinenoexcept |
True if there is any old data available.
| void amrex::StateData::InterpAddBox | ( | MultiFabCopyDescriptor & | multiFabCopyDesc, |
| Vector< MultiFabId > & | mfid, | ||
| BoxList * | returnedUnfillableBoxes, | ||
| Vector< FillBoxId > & | returnedFillBoxIds, | ||
| const Box & | subbox, | ||
| Real | time, | ||
| int | src_comp, | ||
| int | dest_comp, | ||
| int | num_comp, | ||
| bool | extrap = false |
||
| ) |
| void amrex::StateData::InterpFillFab | ( | MultiFabCopyDescriptor & | fabCopyDesc, |
| const Vector< MultiFabId > & | mfid, | ||
| const Vector< FillBoxId > & | fillBoxIds, | ||
| FArrayBox & | dest, | ||
| Real | time, | ||
| int | src_comp, | ||
| int | dest_comp, | ||
| int | num_comp, | ||
| bool | extrap = false |
||
| ) |
|
inlinenoexcept |
Returns the new data.
|
inlinenoexcept |
Returns the new data.
|
inlinenoexcept |
Returns the FAB of new data at grid index ‘i’.
| i |
|
inlinenoexcept |
Returns the old data.
|
inlinenoexcept |
Returns the old data.
|
inlinenoexcept |
Returns the FAB of old data at grid index ‘i’.
| i |
|
inlinenoexcept |
Returns the previous time.
| void amrex::StateData::printTimeInterval | ( | std::ostream & | os | ) | const |
Prints out the time interval.
| os |
| void amrex::StateData::RegisterData | ( | MultiFabCopyDescriptor & | multiFabCopyDesc, |
| Vector< MultiFabId > & | mfid | ||
| ) |
|
inline |
Deletes the space used by the old timestep data.
| void amrex::StateData::replaceNewData | ( | MultiFab && | mf | ) |
Swaps new data with a new MultiFab. Deletes the previous new data.
| mf |
| void amrex::StateData::replaceNewData | ( | StateData & | s | ) |
Swaps new data with another StateData. Does not delete the previous new data.
| s |
| void amrex::StateData::replaceOldData | ( | MultiFab && | mf | ) |
Swaps old data with a new MultiFab. Deletes the previous old data.
| mf |
| void amrex::StateData::replaceOldData | ( | StateData & | s | ) |
Swaps old data with another StateData. Does not delete the previous old data.
| s |
| void amrex::StateData::reset | ( | ) |
Reverts back to initial state.
| void amrex::StateData::restart | ( | const StateDescriptor & | d, |
| const StateData & | rhs | ||
| ) |
or from another similar state
| d | |
| rhs |
| void amrex::StateData::restart | ( | std::istream & | is, |
| const Box & | p_domain, | ||
| const BoxArray & | grds, | ||
| const DistributionMapping & | dm, | ||
| const FabFactory< FArrayBox > & | factory, | ||
| const StateDescriptor & | d, | ||
| const std::string & | chkfile | ||
| ) |
Restart with domain box, grids, and dmap provided.
| is | |
| p_domain | |
| grds | |
| dm | |
| factory | |
| d | |
| chkfile |
|
private |
|
inlinenoexcept |
|
inlinenoexcept |
| new_dmap |
|
inline |
|
inlinestatic |
| void amrex::StateData::setNewTimeLevel | ( | Real | time | ) |
Sets time of new data.
| void amrex::StateData::setOldTimeLevel | ( | Real | time | ) |
Sets time of old data.
| void amrex::StateData::setTimeLevel | ( | Real | time, |
| Real | dt_old, | ||
| Real | dt_new | ||
| ) |
Sets time of old and new data.
| time | |
| dt_old | |
| dt_new |
| void amrex::StateData::swapTimeLevels | ( | Real | dt | ) |
Old data becomes new data and new time is incremented by dt.
| dt |
| void amrex::StateData::syncNewTimeLevel | ( | Real | time | ) |
|
friend |
|
private |
Pointer to data descriptor.
|
private |
|
private |
Problem domain.
|
staticprivate |
This is used as a temporary collection of FabArray header names written during a checkpoint.
|
staticprivate |
This is used to store preread FabArray headers.
|
private |
Grids defined at this level.
|
private |
|
private |
Pointer to new-time data.
|
private |
Time variable assoc with new data.
|
private |
Pointer to previous time data.
|
private |
Time variable assoc with old data.