12 #ifndef MFEM_SIDREDATACOLLECTION
13 #define MFEM_SIDREDATACOLLECTION
15 #include "../config/config.hpp"
20 #include <sidre/sidre.hpp>
179 Mesh *the_mesh = NULL,
180 bool owns_mesh_data =
false);
199 axom::sidre::Group * global_grp,
200 axom::sidre::Group * domain_grp,
201 bool owns_mesh_data =
false);
237 const std::string &buffer_name,
238 axom::sidre::SidreLength offset);
268 if (!nodes_name.empty()) { m_meshNodesGFName = nodes_name; }
288 virtual void SetMesh(MPI_Comm comm,
Mesh *new_mesh);
299 axom::sidre::Group * domain_grp);
314 void Save(
const std::string& filename,
const std::string& protocol);
328 void Load(
const std::string& path,
const std::string& protocol);
335 virtual void Load(
int cycle_ = 0)
377 axom::sidre::SidreLength sz,
378 axom::sidre::TypeID type =
379 axom::sidre::DOUBLE_ID);
389 const bool m_owns_datastore;
396 const bool m_owns_mesh_data;
402 std::string m_meshNodesGFName;
406 axom::sidre::DataStore * m_datastore_ptr;
413 const std::string &view_name);
417 const std::string &view_name,
418 const axom::sidre::DataType &dtype);
422 const std::string &group_name);
425 std::string
get_file_path(
const std::string &filename)
const;
430 axom::sidre::Group * bp_grp;
431 axom::sidre::Group * bp_index_grp;
434 axom::sidre::Group * named_bufs_grp;
438 void RegisterFieldInBPIndex(
const std::string& field_name,
440 void DeregisterFieldInBPIndex(
const std::string & field_name);
442 void RegisterAttributeFieldInBPIndex(
const std::string& attr_name);
443 void DeregisterAttributeFieldInBPIndex(
const std::string& attr_name);
458 void addScalarBasedGridFunction(
const std::string& field_name,
460 const std::string &buffer_name,
461 axom::sidre::SidreLength offset);
472 void addVectorBasedGridFunction(
const std::string& field_name,
474 const std::string &buffer_name,
475 axom::sidre::SidreLength offset);
479 void addIntegerAttributeField(
const std::string& field_name,
bool is_bdry);
485 void createMeshBlueprintStubs(
bool hasBP);
491 void createMeshBlueprintState(
bool hasBP);
497 void createMeshBlueprintCoordset(
bool hasBP);
507 void createMeshBlueprintTopologies(
bool hasBP,
const std::string& mesh_name);
515 void createMeshBlueprintAdjacencies(
bool hasBP);
519 void verifyMeshBlueprint();
axom::sidre::View * alloc_view(axom::sidre::Group *grp, const std::string &view_name)
bool HasAttributeField(const std::string &field_name) const
axom::sidre::Group * GetBPGroup()
Class for grid function - Vector with associated FE space.
void Load(const std::string &path, const std::string &protocol)
Load the Sidre DataStore from file.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
virtual void SetMesh(Mesh *new_mesh)
Set/change the mesh associated with the collection.
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Register a GridFunction in the Sidre DataStore.
SidreDataCollection(const std::string &collection_name, Mesh *the_mesh=NULL, bool owns_mesh_data=false)
Constructor that allocates and initializes a Sidre DataStore.
void LoadExternalData(const std::string &path)
Load external data after registering externally owned fields.
bool Has(const std::string &fname) const
Predicate to check if a field is associated with name fname.
axom::sidre::View * AllocNamedBuffer(const std::string &buffer_name, axom::sidre::SidreLength sz, axom::sidre::TypeID type=axom::sidre::DOUBLE_ID)
Return newly allocated or existing named buffer for buffer_name.
virtual void DeregisterField(const std::string &field_name)
De-register field_name from the SidreDataCollection.
axom::sidre::View * GetNamedBuffer(const std::string &buffer_name) const
Get a pointer to the sidre::View holding the named buffer for buffer_name.
Data collection with Sidre routines following the Conduit mesh blueprint specification.
void SetMeshNodesName(const std::string &nodes_name)
Set the name of the mesh nodes field.
bool HasBoundaryMesh() const
void RegisterAttributeField(const std::string &name, bool is_bdry)
Registers an attribute field in the Sidre DataStore.
axom::sidre::Group * GetBPIndexGroup()
Type
Constants for the classes derived from Element.
void SetGroupPointers(axom::sidre::Group *global_grp, axom::sidre::Group *domain_grp)
Reset the domain and global datastore group pointers.
void UpdateStateToDS()
Updates the data store's cycle, time, and time-step variables with the values from the SidreDataColle...
NamedFieldsMap< Array< int > > AttributeFieldMap
void UpdateStateFromDS()
Updates the DataCollection's cycle, time, and time-step variables with the values from the data store...
virtual ~SidreDataCollection()
Delete all owned data.
AttributeFieldMap attr_map
std::string get_file_path(const std::string &filename) const
virtual void PrepareToSave()
Prepare the DataStore for writing.
axom::sidre::Group * alloc_group(axom::sidre::Group *grp, const std::string &group_name)
Array< int > * GetAttributeField(const std::string &field_name) const
virtual void Save()
Save the collection to file.
Lightweight adaptor over an std::map from strings to pointer to T.
void FreeNamedBuffer(const std::string &buffer_name)
Deallocate the named buffer buffer_name.
void SetComm(MPI_Comm comm)
Associate an MPI communicator with the collection.
T * Get(const std::string &fname) const
Get a pointer to the field associated with name fname.
std::string name
Name of the collection, used as a directory name when saving.
virtual void Load(int cycle_=0)
Load SidreDataCollection from file.
void DeregisterAttributeField(const std::string &name)
axom::sidre::Group * named_buffers_grp() const