17 #ifndef GEOSX_DATAREPOSITORY_WRAPPERBASE_HPP_ 18 #define GEOSX_DATAREPOSITORY_WRAPPERBASE_HPP_ 24 #include "rajaInterface/GEOS_RAJA_Interface.hpp" 39 namespace dataRepository
63 Group *
const parent );
97 virtual void const * voidPointer()
const = 0;
103 virtual localIndex elementByteSize()
const = 0;
110 virtual void resize(
int num_dims,
localIndex const *
const dims ) = 0;
116 virtual void reserve(
localIndex const newCapacity ) = 0;
127 virtual void resize(
localIndex newsize ) = 0;
152 virtual string typeRegex()
const = 0;
160 virtual bool hasDefaultValue()
const = 0;
166 virtual std::string getDefaultValueString()
const = 0;
183 virtual void addBlueprintField( conduit::Node & fields,
186 std::vector< std::string >
const & componentNames = {} )
const = 0;
194 virtual void populateMCArray( conduit::Node & node, std::vector< std::string >
const & componentNames = {} )
const = 0;
204 virtual std::unique_ptr< WrapperBase > averageOverSecondDim(
std::string const & name,
Group & group )
const = 0;
214 virtual void registerToWrite()
const = 0;
219 virtual void finishWriting()
const = 0;
225 virtual bool loadFromConduit() = 0;
249 bool isPackable(
bool onDevice )
const = 0;
283 localIndex PackSize(
bool withMetadata,
bool onDevice )
const = 0;
332 return m_sizedFromParent;
342 m_sizedFromParent = val;
359 m_restart_flags = flags;
396 if( input == InputFlags::OPTIONAL || input == InputFlags::REQUIRED )
398 this->setSizedFromParent( 0 );
399 m_restart_flags = RestartFlags::WRITE;
421 m_description = description;
431 return m_description;
439 string dumpInputOptions(
bool const outputHeader )
const;
448 return m_registeringObjects;
458 m_registeringObjects.insert( objectName );
473 virtual void copyWrapperAttributes(
WrapperBase const & source );
484 virtual std::unique_ptr< WrapperBase > clone(
string const & name,
485 Group *
const parent ) = 0;
491 virtual void copyData(
WrapperBase const & source ) = 0;
497 virtual void copyWrapper(
WrapperBase const & source ) = 0;
503 virtual std::type_info
const & get_typeid()
const = 0;
507 #if defined(USE_TOTALVIEW_OUTPUT) 513 virtual string totalviewTypeName()
const = 0;
520 virtual int setTotalviewDisplay()
const;
528 conduit::Node & getConduitNode()
530 return m_conduitNode;
string m_name
Name of the object that is being wrapped.
int sizedFromParent() const
Check whether this wrapper is resized when its parent is resized.
InputFlags m_inputFlag
Flag to store if this wrapped object should be read from input.
pugi::xml_node xmlNode
Alias for the type of an xml node.
WrapperBase * setPlotLevel(PlotLevel const flag)
Set the PlotLevel of the wrapper.
InputFlags getInputFlag() const
Get the InputFlag of the wrapper.
string m_description
A string description of the wrapped object.
std::set< string > m_registeringObjects
A vector of the names of the objects that created this Wrapper.
RestartFlags m_restart_flags
Flag to determine the restart behavior for this wrapped object.
This class serves to provide a "view" of a multidimensional array.
constexpr void copy(DST_VECTOR &&LVARRAY_RESTRICT_REF dstVector, SRC_VECTOR const &LVARRAY_RESTRICT_REF srcVector)
Copy srcVector into dstVector.
WrapperBase * setSizedFromParent(int val)
Set whether this wrapper is resized when its parent is resized.
Group * m_parent
Pointer to Group that holds this WrapperBase.
RestartFlags getRestartFlags() const
Get the RestartFlags of the wrapper.
string const & getName() const
Get name of the wrapper.
Base class for all wrappers containing common operations.
WrapperBase * setRestartFlags(RestartFlags flags)
Set the RestartFlags of the wrapper.
signed char buffer_unit_type
Type stored in communication buffers.
MemorySpace
An enum containing the available memory spaces.
WrapperBase * setInputFlag(InputFlags const input)
Set the InputFlag of the wrapper.
std::set< string > const & getRegisteringObjects() const
Get the list of names of groups that registered this wrapper.
WrapperBase * setRegisteringObjects(string const &objectName)
Add a new name to the list of groups that register this wrapper.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
WrapperBase * setDescription(string const &description)
Set the description string of the wrapper.
int m_sizedFromParent
Integer to indicate whether or not this wrapped object should be resized when m_parent is resized...
std::string string
String type.
PlotLevel m_plotLevel
Flag to store the plotLevel.
std::enable_if< can_history_io< T >, HistoryMetadata >::type getHistoryMetadata(string const &name, ArrayView< T const, 1, 0 > const &arr, localIndex sizeOverride=-1)
Produce a HistoryMetadata object for a supported one-dimensional array type.
A minimal class to specify information about time history information being collected and output...
PlotLevel getPlotLevel() const
Get PlotLevel for this wrapper.
string const & getDescription() const
Get the description string of the wrapper.
conduit::Node & m_conduitNode
A reference to the corresponding conduit::Node.