Block-Structured AMR Software Framework
amrex::StateDescriptor Class Reference

Attributes of StateData. More...

#include <AMReX_StateDescriptor.H>

Classes

class  BndryFunc
 

Public Types

enum  TimeCenter { Point = 0 , Interval }
 Defines the temporal centeredness of data. More...
 

Public Member Functions

 StateDescriptor () noexcept
 The default constructor. More...
 
 StateDescriptor (IndexType btyp, TimeCenter ttyp, int ident, int nextra, int num_comp, InterpBase *interp, bool extrap=false, bool store_in_checkpoint=true)
 Constructor that sets all data members. More...
 
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. More...
 
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. More...
 
void setComponent (int comp, const std::string &nm, const BCRec &bc, const BndryFunc &func, InterpBase *interp, bool a_primary, int groupsize)
 Sets details of comp component. More...
 
void resetComponentBCs (int comp, const BCRec &bcr, const BndryFunc &func)
 Resets boundary condition data for comp component. More...
 
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. More...
 
void dumpNames (std::ostream &os, int start_comp, int num_comp) const
 Output names of components. More...
 
IndexType getType () const noexcept
 Returns the IndexType. More...
 
StateDescriptor::TimeCenter timeType () const noexcept
 Returns StateDescriptor::TimeCenter. More...
 
int nComp () const noexcept
 Returns number of components. More...
 
int nExtra () const noexcept
 Returns the grow factor. More...
 
InterpBaseinterp () const noexcept
 Returns the interpolater. More...
 
InterpBaseinterp (int i) const noexcept
 Returns the interpolater of specified component. More...
 
const std::string & name (int i) const noexcept
 Returns the name of specified component. More...
 
const BCRecgetBC (int i) const noexcept
 Returns the BCRec of specified component. More...
 
const Vector< BCRec > & getBCs () const noexcept
 Returns all BCRecs. More...
 
const BndryFuncbndryFill (int i) const noexcept
 Returns the BndryFunc of specified component. More...
 
int inRange (int sc, int nc) const noexcept
 Is sc>=0 && sc+nc<=ncomp ? More...
 
bool identicalInterps (int scomp, int ncomp) const noexcept
 Are the interpolaters in the specified range identical? More...
 
std::vector< std::pair< int, int > > sameInterps (int scomp, int ncomp) const
 
bool extrap () const noexcept
 Can extrapolate in time. More...
 
bool store_in_checkpoint () const noexcept
 Should store this StateData in the checkpoint file. More...
 
bool primary (int i) const noexcept
 
int groupsize (int i) const noexcept
 
bool RunOnGPU () const noexcept
 will it run on gpu? More...
 
bool hasBndryFuncFab () const noexcept
 has new fab version of BndryFunc? More...
 

Static Public Member Functions

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. More...
 
static void setBndryFuncThreadSafety (int ext_dir_safe) noexcept
 

Static Private Member Functions

static bool bf_thread_safety (const int *lo, const int *hi, const int *dom_lo, const int *dom_hi, const int *bc, int ng)
 

Private Attributes

IndexType type
 Cell centered, node centered ... More...
 
TimeCenter t_type {Point}
 Temporal centering. More...
 
int id {-1}
 Unique id. More...
 
int ncomp {0}
 Number of components. More...
 
int ngrow {0}
 Grow factor. More...
 
InterpBasemapper {nullptr}
 Default interpolator. More...
 
bool m_extrap {false}
 Can extrapolate in time? More...
 
bool m_store_in_checkpoint {true}
 Should store this in the checkpoint file? More...
 
Vector< std::string > names
 Printable names of components. More...
 
Vector< BCRecbc
 Array of bndry types for entire level. More...
 
Vector< std::unique_ptr< BndryFunc > > bc_func
 Array of pointers to bndry fill functions. More...
 
Vector< intm_primary
 Are we a primary or secondary? (true or false) More...
 
Vector< intm_groupsize
 Groupsize if we're a primary. More...
 
Vector< InterpBase * > mapper_comp
 If mapper_comp[icomp] != 0, that map is used instead of mapper when interpolating icomp; otherwise, mapper is used. More...
 
Vector< intmax_map_start_comp
 For component icomp, max_map_start_comp[icomp] and min_map_end_comp[icomp] represent the maximum starting index and minimum ending index with which to use mapper_comp[icomp] when interpolating component icomp. These are convenient for using with "coupled" multiple component maps like CellConservativeLinear. More...
 
Vector< intmin_map_end_comp
 

Static Private Attributes

static int bf_ext_dir_threadsafe = 0
 

Friends

class DescriptorList
 

Detailed Description

Attributes of StateData.

Member Enumeration Documentation

◆ TimeCenter

Defines the temporal centeredness of data.

Enumerator
Point 
Interval 

Constructor & Destructor Documentation

◆ StateDescriptor() [1/2]

amrex::StateDescriptor::StateDescriptor ( )
inlinenoexcept

The default constructor.

◆ StateDescriptor() [2/2]

amrex::StateDescriptor::StateDescriptor ( IndexType  btyp,
StateDescriptor::TimeCenter  ttyp,
int  ident,
int  nextra,
int  num_comp,
InterpBase interp,
bool  extrap = false,
bool  store_in_checkpoint = true 
)

Constructor that sets all data members.

Parameters
btyp
ttyp
ident
nextra
num_comp
interp
extrap
store_in_checkpoint

Member Function Documentation

◆ bf_thread_safety()

bool amrex::StateDescriptor::bf_thread_safety ( const int lo,
const int hi,
const int dom_lo,
const int dom_hi,
const int bc,
int  ng 
)
staticprivate

◆ bndryFill()

const StateDescriptor::BndryFunc & amrex::StateDescriptor::bndryFill ( int  i) const
noexcept

Returns the BndryFunc of specified component.

Parameters
i

◆ cleanUpMaps()

void amrex::StateDescriptor::cleanUpMaps ( InterpBase **&  maps,
int *&  map_start_comp,
int *&  map_num_comp,
int *&  max_start_comp,
int *&  min_end_comp 
)
static

Cleanup interpolaters for a subset of the state vector components.

Parameters
maps
map_start_comp
map_num_comp
max_start_comp
min_end_comp

◆ define()

void amrex::StateDescriptor::define ( IndexType  btyp,
StateDescriptor::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.

Parameters
btyp
ttyp
ident
nextra
num_comp
interp
extrap
store_in_checkpoint

◆ dumpNames()

void amrex::StateDescriptor::dumpNames ( std::ostream &  os,
int  start_comp,
int  num_comp 
) const

Output names of components.

Parameters
os
start_comp
num_comp

◆ extrap()

bool amrex::StateDescriptor::extrap ( ) const
noexcept

Can extrapolate in time.

◆ getBC()

const BCRec & amrex::StateDescriptor::getBC ( int  i) const
noexcept

Returns the BCRec of specified component.

Parameters
i

◆ getBCs()

const Vector< BCRec > & amrex::StateDescriptor::getBCs ( ) const
noexcept

Returns all BCRecs.

◆ getType()

IndexType amrex::StateDescriptor::getType ( ) const
noexcept

Returns the IndexType.

◆ groupsize()

int amrex::StateDescriptor::groupsize ( int  i) const
inlinenoexcept

◆ hasBndryFuncFab()

bool amrex::StateDescriptor::hasBndryFuncFab ( ) const
inlinenoexcept

has new fab version of BndryFunc?

◆ identicalInterps()

bool amrex::StateDescriptor::identicalInterps ( int  scomp,
int  ncomp 
) const
noexcept

Are the interpolaters in the specified range identical?

Parameters
scomp
ncomp

◆ inRange()

int amrex::StateDescriptor::inRange ( int  sc,
int  nc 
) const
noexcept

Is sc>=0 && sc+nc<=ncomp ?

Parameters
sc
nc

◆ interp() [1/2]

InterpBase * amrex::StateDescriptor::interp ( ) const
noexcept

Returns the interpolater.

◆ interp() [2/2]

InterpBase * amrex::StateDescriptor::interp ( int  i) const
noexcept

Returns the interpolater of specified component.

Parameters
i

◆ name()

const std::string & amrex::StateDescriptor::name ( int  i) const
noexcept

Returns the name of specified component.

Parameters
i

◆ nComp()

int amrex::StateDescriptor::nComp ( ) const
noexcept

Returns number of components.

◆ nExtra()

int amrex::StateDescriptor::nExtra ( ) const
noexcept

Returns the grow factor.

◆ primary()

bool amrex::StateDescriptor::primary ( int  i) const
inlinenoexcept

◆ resetComponentBCs()

void amrex::StateDescriptor::resetComponentBCs ( int  comp,
const BCRec bcr,
const BndryFunc func 
)

Resets boundary condition data for comp component.

Parameters
comp
bcr
func

◆ RunOnGPU()

bool amrex::StateDescriptor::RunOnGPU ( ) const
inlinenoexcept

will it run on gpu?

◆ sameInterps()

std::vector< std::pair< int, int > > amrex::StateDescriptor::sameInterps ( int  scomp,
int  ncomp 
) const

◆ setBndryFuncThreadSafety()

static void amrex::StateDescriptor::setBndryFuncThreadSafety ( int  ext_dir_safe)
inlinestaticnoexcept

◆ setComponent() [1/2]

void amrex::StateDescriptor::setComponent ( int  comp,
const std::string &  nm,
const BCRec bc,
const BndryFunc func,
InterpBase interp,
bool  a_primary,
int  groupsize 
)

Sets details of comp component.

Parameters
comp
nm
bc
func
interp
primary_or_secondary
groupsize

◆ setComponent() [2/2]

void amrex::StateDescriptor::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.

Parameters
comp
nm
bc
func
interp
max_map_start_comp
min_map_end_comp

◆ setUpMaps()

void amrex::StateDescriptor::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.

Parameters
use_default_map
default_map
start_comp
num_comp
maps
nmaps
map_start_comp
map_num_comp
max_start_comp
min_end_comp

◆ store_in_checkpoint()

bool amrex::StateDescriptor::store_in_checkpoint ( ) const
noexcept

Should store this StateData in the checkpoint file.

◆ timeType()

StateDescriptor::TimeCenter amrex::StateDescriptor::timeType ( ) const
noexcept

Friends And Related Function Documentation

◆ DescriptorList

friend class DescriptorList
friend

Member Data Documentation

◆ bc

Vector<BCRec> amrex::StateDescriptor::bc
private

Array of bndry types for entire level.

◆ bc_func

Vector<std::unique_ptr<BndryFunc> > amrex::StateDescriptor::bc_func
private

Array of pointers to bndry fill functions.

◆ bf_ext_dir_threadsafe

int amrex::StateDescriptor::bf_ext_dir_threadsafe = 0
staticprivate

◆ id

int amrex::StateDescriptor::id {-1}
private

Unique id.

◆ m_extrap

bool amrex::StateDescriptor::m_extrap {false}
private

Can extrapolate in time?

◆ m_groupsize

Vector<int> amrex::StateDescriptor::m_groupsize
private

Groupsize if we're a primary.

◆ m_primary

Vector<int> amrex::StateDescriptor::m_primary
private

Are we a primary or secondary? (true or false)

◆ m_store_in_checkpoint

bool amrex::StateDescriptor::m_store_in_checkpoint {true}
private

Should store this in the checkpoint file?

◆ mapper

InterpBase* amrex::StateDescriptor::mapper {nullptr}
private

Default interpolator.

◆ mapper_comp

Vector<InterpBase*> amrex::StateDescriptor::mapper_comp
private

If mapper_comp[icomp] != 0, that map is used instead of mapper when interpolating icomp; otherwise, mapper is used.

◆ max_map_start_comp

Vector<int> amrex::StateDescriptor::max_map_start_comp
private

For component icomp, max_map_start_comp[icomp] and min_map_end_comp[icomp] represent the maximum starting index and minimum ending index with which to use mapper_comp[icomp] when interpolating component icomp. These are convenient for using with "coupled" multiple component maps like CellConservativeLinear.

If there is no need to "couple" a component, max_map_start_comp[icomp] and min_map_end_comp[icomp] simply equal icomp.

◆ min_map_end_comp

Vector<int> amrex::StateDescriptor::min_map_end_comp
private

◆ names

Vector<std::string> amrex::StateDescriptor::names
private

Printable names of components.

◆ ncomp

int amrex::StateDescriptor::ncomp {0}
private

Number of components.

◆ ngrow

int amrex::StateDescriptor::ngrow {0}
private

Grow factor.

◆ t_type

TimeCenter amrex::StateDescriptor::t_type {Point}
private

Temporal centering.

◆ type

IndexType amrex::StateDescriptor::type
private

Cell centered, node centered ...


The documentation for this class was generated from the following files: