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 asctoolkit::sidre::DataGroup * global_grp,
196 asctoolkit::sidre::DataGroup * domain_grp,
197 bool owns_mesh_data =
false);
233 const std::string &buffer_name,
234 asctoolkit::sidre::SidreLength offset);
243 if (!nodes_name.empty()) { m_meshNodesGFName = nodes_name; }
267 asctoolkit::sidre::DataGroup * domain_grp);
269 asctoolkit::sidre::DataGroup *
GetBPGroup() {
return bp_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)
329 asctoolkit::sidre::DataView *
339 asctoolkit::sidre::DataView *
341 asctoolkit::sidre::SidreLength sz,
342 asctoolkit::sidre::TypeID type =
343 asctoolkit::sidre::DOUBLE_ID);
353 const bool m_owns_datastore;
360 const bool m_owns_mesh_data;
366 std::string m_meshNodesGFName;
370 asctoolkit::sidre::DataStore * m_datastore_ptr;
379 asctoolkit::sidre::DataView *
381 const std::string &view_name);
383 asctoolkit::sidre::DataView *
385 const std::string &view_name,
386 const asctoolkit::sidre::DataType &dtype);
388 asctoolkit::sidre::DataGroup *
390 const std::string &group_name);
393 std::string
get_file_path(
const std::string &filename)
const;
398 asctoolkit::sidre::DataGroup * bp_grp;
399 asctoolkit::sidre::DataGroup * bp_index_grp;
402 asctoolkit::sidre::DataGroup * named_bufs_grp;
406 void RegisterFieldInBPIndex(
const std::string& field_name,
408 void DeregisterFieldInBPIndex(
const std::string & field_name);
423 void addScalarBasedGridFunction(
const std::string& field_name,
425 const std::string &buffer_name,
426 asctoolkit::sidre::SidreLength offset);
437 void addVectorBasedGridFunction(
const std::string& field_name,
439 const std::string &buffer_name,
440 asctoolkit::sidre::SidreLength offset);
446 void createMeshBlueprintStubs(
bool hasBP);
452 void createMeshBlueprintState(
bool hasBP);
458 void createMeshBlueprintCoordset(
bool hasBP);
468 void createMeshBlueprintTopologies(
bool hasBP,
const std::string& mesh_name);
471 void verifyMeshBlueprint();
asctoolkit::sidre::DataView * AllocNamedBuffer(const std::string &buffer_name, asctoolkit::sidre::SidreLength sz, asctoolkit::sidre::TypeID type=asctoolkit::sidre::DOUBLE_ID)
Return newly allocated or existing named buffer for buffer_name.
asctoolkit::sidre::DataGroup * alloc_group(asctoolkit::sidre::DataGroup *grp, const std::string &group_name)
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.
asctoolkit::sidre::DataGroup * GetBPIndexGroup()
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Register a GridFunction in the Sidre DataStore.
asctoolkit::sidre::DataView * GetNamedBuffer(const std::string &buffer_name) const
Get a pointer to the sidre::DataView holding the named buffer for buffer_name.
asctoolkit::sidre::DataView * alloc_view(asctoolkit::sidre::DataGroup *grp, const std::string &view_name)
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.
virtual void DeregisterField(const std::string &field_name)
De-register field_name from the SidreDataCollection.
asctoolkit::sidre::DataGroup * named_buffers_grp() const
asctoolkit::sidre::DataGroup * GetBPGroup()
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.
Type
Constants for the classes derived from Element.
void SetGroupPointers(asctoolkit::sidre::DataGroup *global_grp, asctoolkit::sidre::DataGroup *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.
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.