12 #ifndef MFEM_SIDREDATACOLLECTION
13 #define MFEM_SIDREDATACOLLECTION
15 #include "../config/config.hpp"
20 #include <sidre/sidre.hpp>
175 Mesh *the_mesh = NULL,
176 bool owns_mesh_data =
false);
195 axom::sidre::Group * global_grp,
196 axom::sidre::Group * domain_grp,
197 bool owns_mesh_data =
false);
233 const std::string &buffer_name,
234 axom::sidre::SidreLength offset);
243 if (!nodes_name.empty()) { m_meshNodesGFName = nodes_name; }
267 axom::sidre::Group * domain_grp);
282 void Save(
const std::string& filename,
const std::string& protocol);
296 void Load(
const std::string& path,
const std::string& protocol);
303 virtual void Load(
int cycle_ = 0)
345 axom::sidre::SidreLength sz,
346 axom::sidre::TypeID type =
347 axom::sidre::DOUBLE_ID);
357 const bool m_owns_datastore;
364 const bool m_owns_mesh_data;
370 std::string m_meshNodesGFName;
374 axom::sidre::DataStore * m_datastore_ptr;
385 const std::string &view_name);
389 const std::string &view_name,
390 const axom::sidre::DataType &dtype);
394 const std::string &group_name);
397 std::string
get_file_path(
const std::string &filename)
const;
402 axom::sidre::Group * bp_grp;
403 axom::sidre::Group * bp_index_grp;
406 axom::sidre::Group * named_bufs_grp;
410 void RegisterFieldInBPIndex(
const std::string& field_name,
412 void DeregisterFieldInBPIndex(
const std::string & field_name);
427 void addScalarBasedGridFunction(
const std::string& field_name,
429 const std::string &buffer_name,
430 axom::sidre::SidreLength offset);
441 void addVectorBasedGridFunction(
const std::string& field_name,
443 const std::string &buffer_name,
444 axom::sidre::SidreLength offset);
450 void createMeshBlueprintStubs(
bool hasBP);
456 void createMeshBlueprintState(
bool hasBP);
462 void createMeshBlueprintCoordset(
bool hasBP);
472 void createMeshBlueprintTopologies(
bool hasBP,
const std::string& mesh_name);
480 void createMeshBlueprintAdjacencies(
bool hasBP);
484 void verifyMeshBlueprint();
axom::sidre::View * alloc_view(axom::sidre::Group *grp, const std::string &view_name)
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.
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.
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...
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.
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)
virtual void Save()
Save the collection to file.
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.
std::string name
Name of the collection, used as a directory name when saving.
virtual void Load(int cycle_=0)
Load SidreDataCollection from file.
axom::sidre::Group * named_buffers_grp() const