2 #ifndef AMREX_StateDescriptor_H_
3 #define AMREX_StateDescriptor_H_
4 #include <AMReX_Config.H>
24 int dcomp,
int numcomp,
89 void operator () (Real* data,
const int* lo,
const int* hi,
90 const int* dom_lo,
const int* dom_hi,
91 const Real* dx,
const Real* grd_lo,
92 const Real* time,
const int*
bc)
const;
108 void operator () (Real* data,
const int* lo,
const int* hi,
109 const int* dom_lo,
const int* dom_hi,
110 const Real* dx,
const Real* grd_lo,
111 const Real* time,
const int*
bc,
int ng)
const;
114 int dcomp,
int numcomp,
194 const std::string& nm,
196 const BndryFunc& func,
213 const std::string& nm,
215 const BndryFunc& func,
229 const BndryFunc& func);
251 int*& map_start_comp,
253 int*& max_start_comp,
254 int*& min_end_comp)
const;
266 int*& map_start_comp,
268 int*& max_start_comp,
269 int*& min_end_comp) ;
295 [[nodiscard]]
int nComp () const noexcept;
300 [[nodiscard]]
int nExtra () const noexcept;
319 [[nodiscard]] const std::
string&
name (
int i) const noexcept;
326 [[nodiscard]] const
BCRec&
getBC (
int i) const noexcept;
338 [[nodiscard]] const BndryFunc&
bndryFill (
int i) const noexcept;
346 [[nodiscard]]
int inRange (
int sc,
int nc) const noexcept;
358 [[nodiscard]] std::vector< std::pair<
int,
int> >
sameInterps (
int scomp,
int ncomp) const;
363 [[nodiscard]]
bool extrap () const noexcept;
427 const int* dom_lo,
const int* dom_hi,
428 const int*
bc,
int ng);
448 [[nodiscard]]
int size ()
const noexcept;
469 bool store_in_checkpoint =
true);
498 const std::string& nm,
502 int max_map_start_comp = -1,
503 int min_map_end_comp = -1);
Boundary Condition Records. Necessary information and functions for computing boundary conditions.
Definition: AMReX_BCRec.H:17
Definition: AMReX_StateDescriptor.H:437
const StateDescriptor & operator[](int k) const noexcept
Definition: AMReX_StateDescriptor.cpp:163
void clear()
Set the list to its default state.
Definition: AMReX_StateDescriptor.cpp:112
void resetComponentBCs(int indx, int comp, const BCRec &bc, const StateDescriptor::BndryFunc &func)
Calls resetComponentBCs() on StateDescriptor at index indx.
Definition: AMReX_StateDescriptor.cpp:124
void setComponent(int indx, int comp, const std::string &nm, const BCRec &bc, const StateDescriptor::BndryFunc &func, InterpBase *interp=nullptr, int max_map_start_comp=-1, int min_map_end_comp=-1)
Calls setComponent() on StateDescriptor at index indx.
Definition: AMReX_StateDescriptor.cpp:133
int size() const noexcept
Returns number of elements in the list.
Definition: AMReX_StateDescriptor.cpp:118
void addDescriptor(int indx, IndexType typ, StateDescriptor::TimeCenter ttyp, int nextra, int num_comp, InterpBase *interp, bool extrap=false, bool store_in_checkpoint=true)
Adds new StateDescriptor at index indx to list.
Definition: AMReX_StateDescriptor.cpp:169
Vector< std::unique_ptr< StateDescriptor > > desc
Definition: AMReX_StateDescriptor.H:528
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_InterpBase.H:26
Definition: AMReX_StateDescriptor.H:47
BndryFuncDefault m_gfunc
Definition: AMReX_StateDescriptor.H:129
BndryFunc() noexcept=default
Bogus constructor.
bool m_run_on_gpu
Definition: AMReX_StateDescriptor.H:132
BndryFunc(BndryFuncFabDefault inFunc) noexcept
Definition: AMReX_StateDescriptor.H:62
BndryFunc(BndryFunc3DDefault inFunc, BndryFunc3DDefault gFunc) noexcept
Definition: AMReX_StateDescriptor.H:73
bool RunOnGPU() const noexcept
Definition: AMReX_StateDescriptor.H:119
BndryFunc3DDefault m_gfunc3D
Definition: AMReX_StateDescriptor.H:130
void setRunOnGPU(bool b) noexcept
Definition: AMReX_StateDescriptor.H:121
BndryFunc(BndryFunc3DDefault inFunc) noexcept
Definition: AMReX_StateDescriptor.H:60
void operator()(Real *data, const int *lo, const int *hi, const int *dom_lo, const int *dom_hi, const Real *dx, const Real *grd_lo, const Real *time, const int *bc) const
Definition: AMReX_StateDescriptor.cpp:30
BndryFuncFabDefault m_funcfab
Definition: AMReX_StateDescriptor.H:131
bool hasFabVersion() const noexcept
Definition: AMReX_StateDescriptor.H:123
BndryFuncDefault m_func
Definition: AMReX_StateDescriptor.H:127
BndryFunc(BndryFuncDefault inFunc, BndryFuncDefault gFunc) noexcept
Another Constructor.
Definition: AMReX_StateDescriptor.H:70
BndryFunc3DDefault m_func3D
Definition: AMReX_StateDescriptor.H:128
Attributes of StateData.
Definition: AMReX_StateDescriptor.H:33
Vector< BCRec > bc
Array of bndry types for entire level.
Definition: AMReX_StateDescriptor.H:400
InterpBase * interp() const noexcept
Returns the interpolater.
Definition: AMReX_StateDescriptor.cpp:251
InterpBase * mapper
Default interpolator.
Definition: AMReX_StateDescriptor.H:396
Vector< InterpBase * > mapper_comp
If mapper_comp[icomp] != 0, that map is used instead of mapper when interpolating icomp; otherwise,...
Definition: AMReX_StateDescriptor.H:409
Vector< std::string > names
Printable names of components.
Definition: AMReX_StateDescriptor.H:399
const std::string & name(int i) const noexcept
Returns the name of specified component.
Definition: AMReX_StateDescriptor.cpp:263
bool identicalInterps(int scomp, int ncomp) const noexcept
Are the interpolaters in the specified range identical?
Definition: AMReX_StateDescriptor.cpp:517
const BCRec & getBC(int i) const noexcept
Returns the BCRec of specified component.
Definition: AMReX_StateDescriptor.cpp:269
bool primary(int i) const noexcept
Definition: AMReX_StateDescriptor.H:370
StateDescriptor::TimeCenter timeType() const noexcept
Returns StateDescriptor::TimeCenter.
Definition: AMReX_StateDescriptor.cpp:233
void setComponent(int comp, const std::string &nm, const BCRec &bc, const BndryFunc &func, InterpBase *interp=nullptr, int max_map_start_comp=-1, int min_map_end_comp=-1)
Sets details of comp component.
Definition: AMReX_StateDescriptor.cpp:337
int inRange(int sc, int nc) const noexcept
Is sc>=0 && sc+nc<=ncomp ?
Definition: AMReX_StateDescriptor.cpp:300
bool m_extrap
Can extrapolate in time?
Definition: AMReX_StateDescriptor.H:397
Vector< std::unique_ptr< BndryFunc > > bc_func
Array of pointers to bndry fill functions.
Definition: AMReX_StateDescriptor.H:401
bool RunOnGPU() const noexcept
will it run on gpu?
Definition: AMReX_StateDescriptor.H:378
Vector< int > m_groupsize
Groupsize if we're a primary.
Definition: AMReX_StateDescriptor.H:403
void resetComponentBCs(int comp, const BCRec &bcr, const BndryFunc &func)
Resets boundary condition data for comp component.
Definition: AMReX_StateDescriptor.cpp:216
static void setBndryFuncThreadSafety(int ext_dir_safe) noexcept
Definition: AMReX_StateDescriptor.H:385
bool store_in_checkpoint() const noexcept
Should store this StateData in the checkpoint file.
Definition: AMReX_StateDescriptor.cpp:287
TimeCenter t_type
Temporal centering.
Definition: AMReX_StateDescriptor.H:392
Vector< int > m_primary
Are we a primary or secondary? (true or false)
Definition: AMReX_StateDescriptor.H:402
bool extrap() const noexcept
Can extrapolate in time.
Definition: AMReX_StateDescriptor.cpp:281
int nComp() const noexcept
Returns number of components.
Definition: AMReX_StateDescriptor.cpp:239
bool m_store_in_checkpoint
Should store this in the checkpoint file?
Definition: AMReX_StateDescriptor.H:398
void define(IndexType btyp, TimeCenter ttyp, int ident, int nextra, int num_comp, InterpBase *interp, bool extrap=false, bool store_in_checkpoint=true)
Define the data members if constructed with default constructor.
Definition: AMReX_StateDescriptor.cpp:306
int groupsize(int i) const noexcept
Definition: AMReX_StateDescriptor.H:372
std::vector< std::pair< int, int > > sameInterps(int scomp, int ncomp) const
Definition: AMReX_StateDescriptor.cpp:535
Vector< int > max_map_start_comp
For component icomp, max_map_start_comp[icomp] and min_map_end_comp[icomp] represent the maximum star...
Definition: AMReX_StateDescriptor.H:421
TimeCenter
Defines the temporal centeredness of data.
Definition: AMReX_StateDescriptor.H:39
@ Interval
Definition: AMReX_StateDescriptor.H:39
@ Point
Definition: AMReX_StateDescriptor.H:39
void setUpMaps(int &use_default_map, const InterpBase *default_map, int start_comp, int num_comp, InterpBase **&maps, int &nmaps, int *&map_start_comp, int *&map_num_comp, int *&max_start_comp, int *&min_end_comp) const
Set interpolaters for a subset of the state vector components.
Definition: AMReX_StateDescriptor.cpp:398
Vector< int > min_map_end_comp
Definition: AMReX_StateDescriptor.H:422
int ncomp
Number of components.
Definition: AMReX_StateDescriptor.H:394
const Vector< BCRec > & getBCs() const noexcept
Returns all BCRecs.
Definition: AMReX_StateDescriptor.cpp:275
static bool bf_thread_safety(const int *lo, const int *hi, const int *dom_lo, const int *dom_hi, const int *bc, int ng)
Definition: AMReX_StateDescriptor.cpp:14
bool hasBndryFuncFab() const noexcept
has new fab version of BndryFunc?
Definition: AMReX_StateDescriptor.H:383
IndexType getType() const noexcept
Returns the IndexType.
Definition: AMReX_StateDescriptor.cpp:227
IndexType type
Cell centered, node centered ...
Definition: AMReX_StateDescriptor.H:391
StateDescriptor() noexcept
The default constructor.
Definition: AMReX_StateDescriptor.H:138
int ngrow
Grow factor.
Definition: AMReX_StateDescriptor.H:395
int nExtra() const noexcept
Returns the grow factor.
Definition: AMReX_StateDescriptor.cpp:245
const BndryFunc & bndryFill(int i) const noexcept
Returns the BndryFunc of specified component.
Definition: AMReX_StateDescriptor.cpp:294
static int bf_ext_dir_threadsafe
Definition: AMReX_StateDescriptor.H:424
static void cleanUpMaps(InterpBase **&maps, int *&map_start_comp, int *&map_num_comp, int *&max_start_comp, int *&min_end_comp)
Cleanup interpolaters for a subset of the state vector components.
Definition: AMReX_StateDescriptor.cpp:503
void dumpNames(std::ostream &os, int start_comp, int num_comp) const
Output names of components.
Definition: AMReX_StateDescriptor.cpp:385
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
Definition: AMReX_Amr.cpp:49
std::function< void(Box const &bx, FArrayBox &data, int dcomp, int numcomp, Geometry const &geom, Real time, const Vector< BCRec > &bcr, int bcomp, int scomp)> BndryFuncFabDefault
Definition: AMReX_StateDescriptor.H:27
void(*)(Real *data, const int *lo, const int *hi, const int *dom_lo, const int *dom_hi, const Real *dx, const Real *grd_lo, const Real *time, const int *bc) BndryFunc3DDefault
Definition: AMReX_PhysBCFunct.H:25
void(*)(Real *data, AMREX_ARLIM_P(lo), AMREX_ARLIM_P(hi), const int *dom_lo, const int *dom_hi, const Real *dx, const Real *grd_lo, const Real *time, const int *bc) BndryFuncDefault
Definition: AMReX_PhysBCFunct.H:21