GEOSX
|
Base class for all wrappers containing common operations. More...
#include <WrapperBase.hpp>
Public Member Functions | |
virtual bool | hasDefaultValue () const =0 |
Return true iff this wrapper has a valid default value. More... | |
virtual string | getDefaultValueString () const =0 |
Return a string representing the default value. More... | |
virtual bool | processInputFile (xmlWrapper::xmlNode const &targetNode)=0 |
Initialize the wrapper from the input xml node. More... | |
virtual void | addBlueprintField (conduit::Node &fields, string const &name, string const &topology, std::vector< string > const &componentNames={}) const =0 |
Push the data in the wrapper into a Conduit blueprint field. More... | |
virtual void | populateMCArray (conduit::Node &node, std::vector< string > const &componentNames={}) const =0 |
Push the data in the wrapper into a Conduit Blueprint mcarray. More... | |
virtual std::unique_ptr< WrapperBase > | averageOverSecondDim (string const &name, Group &group) const =0 |
Create a new Wrapper with values averaged over the second dimension. More... | |
virtual HistoryMetadata | getHistoryMetadata (localIndex const packCount) const =0 |
Get a description of the wrapped data for time history collection/output. More... | |
Constructor, desctructor | |
WrapperBase (string const &name, Group &parent) | |
Constructor. More... | |
virtual | ~WrapperBase () |
Default destructor. | |
Methods that delegate to the wrapped type | |
These functions will call the corresponding method on the wrapped object, if such method is declared in wrapped type. | |
virtual localIndex | size () const =0 |
Calls T::size() More... | |
virtual void const * | voidPointer () const =0 |
virtual localIndex | elementByteSize () const =0 |
virtual void | resize (int num_dims, localIndex const *const dims)=0 |
Calls T::resize( num_dims, dims ) More... | |
virtual void | reserve (localIndex const newCapacity)=0 |
Calls T::reserve( newCapacity ) if it exists, otherwise a no-op. More... | |
virtual localIndex | capacity () const =0 |
virtual void | resize (localIndex newsize)=0 |
Calls T::resize(newsize) if it exists. More... | |
void | resize () |
Calls resize(newsize) where newsize is taken from the parent Group. | |
virtual void | copy (localIndex const sourceIndex, localIndex const destIndex)=0 |
Calls T::copy(sourceIndex, destIndex) More... | |
virtual void | move (LvArray::MemorySpace const space, bool const touch) const =0 |
Calls T::move(space, touch) More... | |
virtual string | typeRegex () const =0 |
Calls TypeRegex< T >::get(). More... | |
Restart output methods | |
virtual void | registerToWrite () const =0 |
Register the wrapper's data for writing with Conduit. | |
virtual void | finishWriting () const =0 |
Write the wrapped data into Conduit. | |
virtual bool | loadFromConduit ()=0 |
Read the wrapped data from Conduit. More... | |
Methods for buffer packing/unpacking | |
This group of functions is used to pack/unpack wrapped object to/from binary buffers | |
virtual bool | isPackable (bool onDevice) const =0 |
Check whether wrapped type is can be packed into a buffer on host or device. More... | |
virtual localIndex | pack (buffer_unit_type *&buffer, bool withMetadata, bool onDevice, parallelDeviceEvents &events) const =0 |
Pack the entire wrapped object into a buffer. More... | |
virtual localIndex | packByIndex (buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList, bool withMetadata, bool onDevice, parallelDeviceEvents &events) const =0 |
For indexable types, pack selected indices of wrapped object into a buffer. More... | |
virtual localIndex | packSize (bool withMetadata, bool onDevice, parallelDeviceEvents &events) const =0 |
Get the buffer size needed to pack the entire wrapped object. More... | |
virtual localIndex | packByIndexSize (arrayView1d< localIndex const > const &packList, bool withMetadata, bool onDevice, parallelDeviceEvents &events) const =0 |
Get the buffer size needed to pack the selected indices wrapped object. More... | |
virtual localIndex | unpack (buffer_unit_type const *&buffer, bool withMetadata, bool onDevice, parallelDeviceEvents &events)=0 |
Unpack the entire wrapped object from a buffer. More... | |
virtual localIndex | unpackByIndex (buffer_unit_type const *&buffer, arrayView1d< localIndex const > const &unpackIndices, bool withMetadata, bool onDevice, parallelDeviceEvents &events)=0 |
For indexable types, unpack selected indices of wrapped object from a buffer. More... | |
Wrapper attribute getters and setters | |
int | sizedFromParent () const |
Check whether this wrapper is resized when its parent is resized. More... | |
WrapperBase & | setSizedFromParent (int val) |
Set whether this wrapper is resized when its parent is resized. More... | |
RestartFlags | getRestartFlags () const |
Get the RestartFlags of the wrapper. More... | |
WrapperBase & | setRestartFlags (RestartFlags flags) |
Set the RestartFlags of the wrapper. More... | |
PlotLevel | getPlotLevel () const |
Get PlotLevel for this wrapper. More... | |
WrapperBase & | setPlotLevel (PlotLevel const flag) |
Set the PlotLevel of the wrapper. More... | |
string const & | getName () const |
Get name of the wrapper. More... | |
string | getPath () const |
Return the path to this Wrapper in the data repository. More... | |
WrapperBase & | setInputFlag (InputFlags const input) |
Set the InputFlag of the wrapper. More... | |
InputFlags | getInputFlag () const |
Get the InputFlag of the wrapper. More... | |
bool | getSuccessfulReadFromInput () const |
Returns flag that indicates whether the contents of the wrapper have been successfully read from the input file. More... | |
WrapperBase & | setDescription (string const &description) |
Set the description string of the wrapper. More... | |
string const & | getDescription () const |
Get the description string of the wrapper. More... | |
string | dumpInputOptions (bool const outputHeader) const |
std::set< string > const & | getRegisteringObjects () const |
Get the list of names of groups that registered this wrapper. More... | |
WrapperBase & | setRegisteringObjects (string const &objectName) |
Add a new name to the list of groups that register this wrapper. More... | |
Miscellaneous | |
virtual void | copyWrapperAttributes (WrapperBase const &source) |
Copy attributes from another wrapper. More... | |
virtual std::unique_ptr< WrapperBase > | clone (string const &name, Group &parent)=0 |
Creates a clone of *this WrapperBase. More... | |
virtual void | copyData (WrapperBase const &source)=0 |
Copy the the data contained in another wrapper into this wrapper. More... | |
virtual void | copyWrapper (WrapperBase const &source)=0 |
Copies the contents of a Wrapper into *this. More... | |
virtual std::type_info const & | getTypeId () const =0 |
Get the typeid of T. More... | |
virtual int | numArrayDims () const =0 |
Return the number of dimensions of the array. More... | |
virtual localIndex | numArrayComp () const =0 |
Return the number of components in a multidimensional array. More... | |
virtual WrapperBase & | setDimLabels (integer dim, Span< string const > labels)=0 |
Set dimension labels for an array. More... | |
virtual Span< string const > | getDimLabels (integer dim) const =0 |
Get dimension labels of an array. More... | |
Protected Attributes | |
string | m_name |
Name of the object that is being wrapped. | |
Group * | m_parent |
Pointer to Group that holds this WrapperBase. | |
int | m_sizedFromParent |
Integer to indicate whether or not this wrapped object should be resized when m_parent is resized. | |
RestartFlags | m_restart_flags |
Flag to determine the restart behavior for this wrapped object. | |
PlotLevel | m_plotLevel |
Flag to store the plotLevel. | |
InputFlags | m_inputFlag |
Flag to store if this wrapped object should be read from input. | |
bool | m_successfulReadFromInput |
Flag to indicate if wrapped object was successfully read from input. | |
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. | |
conduit::Node & | m_conduitNode |
A reference to the corresponding conduit::Node. | |
Base class for all wrappers containing common operations.
Definition at line 53 of file WrapperBase.hpp.
Constructor.
[in] | name | name of the object |
[in] | parent | pointer to Group that holds this WrapperBase |
|
pure virtual |
Push the data in the wrapper into a Conduit blueprint field.
fields | The Conduit Node containg the blueprint fields. |
name | The name of the field. |
topology | The topology associated with the field. |
componentNames | The name of the components, if not specified they are auto generated. |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Create a new Wrapper with values averaged over the second dimension.
name | The name to give the new wrapper. |
group | The group to hang the new Wrapper from. |
group
. Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Creates a clone of *this
WrapperBase.
[in] | name | name of the clone |
[in] | parent | parent Group that will hold this clone |
The overridden function will create a copy of the derived Wrapper<T> the using the provided values of name and parent to differentiate itself from the source.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Calls T::copy(sourceIndex, destIndex)
[in] | sourceIndex | index to copy from |
[in] | destIndex | index to copy to |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Copy the the data contained in another wrapper into this wrapper.
source | The wrapper that holds the data to copy. |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Copies the contents of a Wrapper into *this.
[in] | source | The wrapper to copy |
Implemented in geosx::dataRepository::Wrapper< T >.
|
virtual |
Copy attributes from another wrapper.
[in] | source | the source wrapper, must wrap the same type T |
Reimplemented in geosx::dataRepository::Wrapper< T >.
string geosx::dataRepository::WrapperBase::dumpInputOptions | ( | bool const | outputHeader | ) | const |
outputHeader | If true outputs the table header, otherwise just outputs a row. |
|
pure virtual |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Return a string representing the default value.
Implemented in geosx::dataRepository::Wrapper< T >.
|
inline |
Get the description string of the wrapper.
Definition at line 476 of file WrapperBase.hpp.
|
pure virtual |
Get dimension labels of an array.
dim | dimension index (must be less than number of array dimensions) |
An error is raised if wrapped type is not LvArray::Array.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Get a description of the wrapped data for time history collection/output.
packCount | The number of indices from the wrapped data to collect, |
Implemented in geosx::dataRepository::Wrapper< T >.
|
inline |
Get the InputFlag of the wrapper.
Definition at line 446 of file WrapperBase.hpp.
|
inline |
string geosx::dataRepository::WrapperBase::getPath | ( | ) | const |
|
inline |
Get PlotLevel for this wrapper.
Definition at line 397 of file WrapperBase.hpp.
|
inline |
Get the list of names of groups that registered this wrapper.
Definition at line 493 of file WrapperBase.hpp.
|
inline |
Get the RestartFlags of the wrapper.
Definition at line 380 of file WrapperBase.hpp.
|
inline |
Returns flag that indicates whether the contents of the wrapper have been successfully read from the input file.
Definition at line 456 of file WrapperBase.hpp.
|
pure virtual |
Get the typeid of T.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Return true iff this wrapper has a valid default value.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Check whether wrapped type is can be packed into a buffer on host or device.
[in] | onDevice | determine whether the wrapper is packable on host vs device |
true
if T
is packable, false
otherwise Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Read the wrapped data from Conduit.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Calls T::move(space, touch)
[in] | space | A CHAI execution space to move the data into |
[in] | touch | whether to register a touch in target space |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Return the number of components in a multidimensional array.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Return the number of dimensions of the array.
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Pack the entire wrapped object into a buffer.
[in,out] | buffer | the binary buffer pointer, advanced upon completion |
[in] | withMetadata | whether to pack string metadata with the underlying data |
[in] | onDevice | whether to use device-based packing functions (buffer must be either pinned or a device pointer) |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units packed Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
For indexable types, pack selected indices of wrapped object into a buffer.
[in,out] | buffer | the binary buffer pointer, advanced upon completion |
[in] | packList | the list of indices to pack |
[in] | withMetadata | whether to pack string metadata with the underlying data |
[in] | onDevice | whether to use device-based packing functions (buffer must be either pinned or a device pointer) |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units packed Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Get the buffer size needed to pack the selected indices wrapped object.
[in] | packList | the list of indices to pack |
[in] | withMetadata | whether to pack string metadata with the underlying data |
[in] | onDevice | whether to use device-based packing functions (buffer must be either pinned or a device pointer) |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units needed to pack Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Get the buffer size needed to pack the entire wrapped object.
[in] | withMetadata | whether to pack string metadata with the underlying data |
[in] | onDevice | whether to use device-based packing functions this matters as the size on device differs from the size on host as we pack less metadata on device |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units needed to pack Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Push the data in the wrapper into a Conduit Blueprint mcarray.
node | The Conduit Node to put the data into. |
componentNames | The names of the components, if not specified they are auto generated. |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Initialize the wrapper from the input xml node.
targetNode | the xml node to initialize from. |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Calls T::reserve( newCapacity ) if it exists, otherwise a no-op.
[in] | newCapacity | the new capacity of the T. |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Calls T::resize( num_dims, dims )
[in] | num_dims | number of dimensions in T |
[in] | dims | pointer to the new dims |
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Calls T::resize(newsize) if it exists.
[in] | newsize | parameter to pass to T::resize(newsize) |
Implemented in geosx::dataRepository::Wrapper< T >.
|
inline |
Set the description string of the wrapper.
description | the description |
Definition at line 466 of file WrapperBase.hpp.
|
pure virtual |
Set dimension labels for an array.
dim | dimension index (must be less than number of array dimensions) |
labels | array of labels |
this
(for convenience of call chaining)Dimension labels are typically used in visualization output to give context to plots of multidimensional data, such as fluid component and phase names. This method provides a way for physics modules (solvers and constitutive models) to communicate meaningful labels to output drivers (such as VTK and Silo).
An error is raised if wrapped type is not LvArray::Array.
Implemented in geosx::dataRepository::Wrapper< T >.
|
inline |
Set the InputFlag of the wrapper.
input | the new InputFlags value |
Definition at line 430 of file WrapperBase.hpp.
|
inline |
Set the PlotLevel of the wrapper.
flag | the new PlotLevel value |
Definition at line 404 of file WrapperBase.hpp.
|
inline |
Add a new name to the list of groups that register this wrapper.
objectName | name of the registering object |
Definition at line 503 of file WrapperBase.hpp.
|
inline |
Set the RestartFlags of the wrapper.
flags | the new RestartFlags value |
Definition at line 387 of file WrapperBase.hpp.
|
inline |
Set whether this wrapper is resized when its parent is resized.
val | an int that is converted into a bool |
Definition at line 370 of file WrapperBase.hpp.
|
pure virtual |
|
inline |
Check whether this wrapper is resized when its parent is resized.
true
if wrapper is resized with parent group, false
otherwise Definition at line 360 of file WrapperBase.hpp.
|
pure virtual |
Calls TypeRegex< T >::get().
Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Unpack the entire wrapped object from a buffer.
[in,out] | buffer | the binary buffer pointer, advanced upon completion |
[in] | withMetadata | whether to expect string metadata with the underlying data |
[in] | onDevice | whether to use device-based packing functions (buffer must be either pinned or a device pointer) |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units unpacked Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
For indexable types, unpack selected indices of wrapped object from a buffer.
[in,out] | buffer | the binary buffer pointer, advanced upon completion |
[in] | unpackIndices | the list of indices to pack |
[in] | withMetadata | whether to include metadata in the packing |
[in] | onDevice | whether to use device-based packing functions (buffer must be either pinned or a device pointer) |
[out] | events | a collection of events to poll for completion of async packing kernels ( device packing is incomplete until all events are finalized ) |
buffer_unit_type
units unpacked Implemented in geosx::dataRepository::Wrapper< T >.
|
pure virtual |
Implemented in geosx::dataRepository::Wrapper< T >.