2 #ifndef AMREX_StateData_H_
3 #define AMREX_StateData_H_
4 #include <AMReX_Config.H>
24 class StateDataPhysBCFunct;
195 BoxList* returnedUnfillableBoxes,
202 bool extrap =
false);
212 bool extrap =
false);
252 const std::string& fullpathname,
255 bool dump_old =
true);
268 void restart (std::istream& is,
274 const std::string& chkfile);
454 void restartDoit (std::istream& is,
const std::string& chkfile);
464 Real time,
int bccomp);
467 Real time,
int bccomp) {
468 this->
operator()(mf,dest_comp,num_comp,nghost,time,bccomp);
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
A virtual base class for objects that manage their own dynamic memory allocation.
Definition: AMReX_Arena.H:100
Boundary Condition Records. Necessary information and functions for computing boundary conditions.
Definition: AMReX_BCRec.H:17
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
A class for managing a List of Boxes that share a common IndexType. This class implements operations ...
Definition: AMReX_BoxList.H:52
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_MFCopyDescriptor.H:46
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
A Box with real dimensions. A RealBox is OK iff volume >= 0.
Definition: AMReX_RealBox.H:21
Definition: AMReX_StateData.H:458
void FillBoundary(MultiFab &mf, int dest_comp, int num_comp, IntVect const &nghost, Real time, int bccomp)
Definition: AMReX_StateData.H:466
StateData * statedata
Definition: AMReX_StateData.H:471
const Geometry * geom
Definition: AMReX_StateData.H:473
void operator()(MultiFab &mf, int dest_comp, int num_comp, IntVect const &nghost, Real time, int bccomp)
Definition: AMReX_StateData.cpp:870
int src_comp
Definition: AMReX_StateData.H:472
StateDataPhysBCFunct(StateData &sd, int sc, const Geometry &geom_)
Definition: AMReX_StateData.cpp:863
Current and previous level-time data.
Definition: AMReX_StateData.H:33
static const Vector< std::string > & FabArrayHeaderNames()
These facilitate prereading FabArray headers to avoid synchronization when reading multiple FabArrays...
Definition: AMReX_StateData.H:403
void removeOldData()
Deletes the space used by the old timestep data.
Definition: AMReX_StateData.H:116
std::unique_ptr< MultiFab > new_data
Pointer to new-time data.
Definition: AMReX_StateData.H:437
void replaceNewData(MultiFab &&mf)
Swaps new data with a new MultiFab. Deletes the previous new data.
Definition: AMReX_StateData.cpp:420
static void SetFAHeaderMapPtr(std::map< std::string, Vector< char > > *fahmp)
Definition: AMReX_StateData.H:406
void setOldTimeLevel(Real time)
Sets time of old data.
Definition: AMReX_StateData.cpp:327
void replaceOldData(MultiFab &&mf)
Swaps old data with a new MultiFab. Deletes the previous old data.
Definition: AMReX_StateData.cpp:406
void copyOld(const StateData &state)
Copies old data from another StateData object and sets the same time level. If old data is uninitiali...
Definition: AMReX_StateData.cpp:138
const DistributionMapping & DistributionMap() const noexcept
Definition: AMReX_StateData.H:300
MultiFab & newData() noexcept
Returns the new data.
Definition: AMReX_StateData.H:329
StateData & operator=(StateData const &rhs)
Definition: AMReX_StateData.cpp:65
FArrayBox & oldGrid(int i) noexcept
Returns the FAB of old data at grid index āiā.
Definition: AMReX_StateData.H:358
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.
Definition: AMReX_StateData.cpp:178
const MultiFab & oldData() const noexcept
Returns the old data.
Definition: AMReX_StateData.H:344
~StateData()
The destructor.
Definition: AMReX_StateData.cpp:302
Real curTime() const noexcept
Returns the current time.
Definition: AMReX_StateData.H:313
TimeInterval old_time
Time variable assoc with old data.
Definition: AMReX_StateData.H:434
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.
Definition: AMReX_StateData.cpp:92
Box domain
Problem domain.
Definition: AMReX_StateData.H:423
const StateDescriptor * desc
Pointer to data descriptor.
Definition: AMReX_StateData.H:420
Arena * getArena() const noexcept
Get the Arena used.
Definition: AMReX_StateData.H:392
const MultiFab & newData() const noexcept
Returns the new data.
Definition: AMReX_StateData.H:334
static std::map< std::string, Vector< char > > * faHeaderMap
This is used to store preread FabArray headers.
Definition: AMReX_StateData.H:452
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)
Definition: AMReX_StateData.cpp:662
void syncNewTimeLevel(Real time)
Definition: AMReX_StateData.cpp:353
void setDistributionMap(DistributionMapping &new_dmap) noexcept
Definition: AMReX_StateData.H:306
void getData(Vector< MultiFab * > &data, Vector< Real > &datatime, Real time) const
Definition: AMReX_StateData.cpp:717
Arena * arena
Arena we should use for allocating the data.
Definition: AMReX_StateData.H:443
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.
Definition: AMReX_StateData.cpp:434
const BoxArray & boxArray() const noexcept
Returns the BoxArray.
Definition: AMReX_StateData.H:298
const FabFactory< FArrayBox > & Factory() const noexcept
Definition: AMReX_StateData.H:308
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.
Definition: AMReX_StateData.cpp:773
BCRec getBC(int comp, int i) const noexcept
Returns boundary conditions of specified component on the specified grid.
Definition: AMReX_StateData.cpp:319
FArrayBox & newGrid(int i) noexcept
Returns the FAB of new data at grid index āiā.
Definition: AMReX_StateData.H:351
void setTimeLevel(Real time, Real dt_old, Real dt_new)
Sets time of old and new data.
Definition: AMReX_StateData.cpp:370
StateData()
The default constructor.
Definition: AMReX_StateData.cpp:31
std::unique_ptr< MultiFab > old_data
Pointer to previous time data.
Definition: AMReX_StateData.H:440
void setNewTimeLevel(Real time)
Sets time of new data.
Definition: AMReX_StateData.cpp:340
void RegisterData(MultiFabCopyDescriptor &multiFabCopyDesc, Vector< MultiFabId > &mfid)
Definition: AMReX_StateData.cpp:579
StateData(StateData const &rhs)=delete
DistributionMapping dmap
Definition: AMReX_StateData.H:428
void printTimeInterval(std::ostream &os) const
Prints out the time interval.
Definition: AMReX_StateData.cpp:849
Real prevTime() const noexcept
Returns the previous time.
Definition: AMReX_StateData.H:321
MultiFab & oldData() noexcept
Returns the old data.
Definition: AMReX_StateData.H:339
std::unique_ptr< FabFactory< FArrayBox > > m_factory
Definition: AMReX_StateData.H:411
void allocOldData()
Allocates space for old timestep data.
Definition: AMReX_StateData.cpp:308
void swapTimeLevels(Real dt)
Old data becomes new data and new time is incremented by dt.
Definition: AMReX_StateData.cpp:389
void reset()
Reverts back to initial state.
Definition: AMReX_StateData.cpp:170
static void ClearFabArrayHeaderNames()
Definition: AMReX_StateData.H:404
void copyNew(const StateData &state)
Copies new data from another StateData object and sets the same time level. If new data is uninitiali...
Definition: AMReX_StateData.cpp:154
TimeInterval new_time
Time variable assoc with new data.
Definition: AMReX_StateData.H:431
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)
Definition: AMReX_StateData.cpp:588
void restartDoit(std::istream &is, const std::string &chkfile)
Definition: AMReX_StateData.cpp:213
const Box & getDomain() const noexcept
Returns the valid domain.
Definition: AMReX_StateData.H:293
void setArena(Arena *ar) noexcept
Set the Arena used.
Definition: AMReX_StateData.H:397
static Vector< std::string > fabArrayHeaderNames
This is used as a temporary collection of FabArray header names written during a checkpoint.
Definition: AMReX_StateData.H:449
BoxArray grids
Grids defined at this level.
Definition: AMReX_StateData.H:426
const StateDescriptor * descriptor() const noexcept
Returns the StateDescriptor.
Definition: AMReX_StateData.H:288
bool hasOldData() const noexcept
True if there is any old data available.
Definition: AMReX_StateData.H:378
bool hasNewData() const noexcept
True if there is any new data available.
Definition: AMReX_StateData.H:383
Attributes of StateData.
Definition: AMReX_StateDescriptor.H:33
StateDescriptor::TimeCenter timeType() const noexcept
Returns StateDescriptor::TimeCenter.
Definition: AMReX_StateDescriptor.cpp:233
@ Point
Definition: AMReX_StateDescriptor.H:39
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
How
How we write out FabArray<FArrayBox>s. These are deprecated, we always use NFiles....
Definition: AMReX_VisMF.H:41
Definition: AMReX_Amr.cpp:49
Definition: AMReX_StateData.H:414
Real start
Definition: AMReX_StateData.H:415
Real stop
Definition: AMReX_StateData.H:416