12 #ifndef MFEM_CONDUITDATACOLLECTION 13 #define MFEM_CONDUITDATACOLLECTION 15 #include "../config/config.hpp" 17 #ifdef MFEM_USE_CONDUIT 20 #include <conduit.hpp> 79 const std::string &file_protocol=
"hdf5");
91 const conduit::Node &n_mesh,
92 const std::string &file_protocol);
96 const conduit::Node &n_mesh,
97 const std::string &file_protocol);
106 const std::string &file_protocol);
167 const std::string &coordset_name =
"coords",
168 const std::string &main_topology_name =
"main",
169 const std::string &boundary_topology_name =
"boundary",
170 const std::string &main_adjset_name =
"main_adjset");
184 const std::string &main_topology_name =
"main");
197 const std::string &main_toplogy_name =
"",
198 bool zero_copy =
false);
209 const conduit::Node &n_field,
210 bool zero_copy =
false);
214 static std::string ElementTypeToShapeName(
Element::Type element_type);
Class for grid function - Vector with associated FE space.
void SaveMeshAndFields(int domain_id, const conduit::Node &n_mesh, const std::string &file_protocol)
Saves all meshes and fields for the current cycle.
std::string RootFileName()
Returns blueprint root file name for the current cycle.
Data collection that uses the Conduit Mesh Blueprint specification.
static void MeshToBlueprintMesh(Mesh *m, conduit::Node &out, const std::string &coordset_name="coords", const std::string &main_topology_name="main", const std::string &boundary_topology_name="boundary", const std::string &main_adjset_name="main_adjset")
Describes a MFEM mesh using the mesh blueprint.
std::string relay_protocol
virtual void Load(int cycle=0)
Load the collection based blueprint data.
ConduitDataCollection(const std::string &collection_name, Mesh *mesh=NULL)
Constructor. The collection name is used when saving the data.
static Mesh * BlueprintMeshToMesh(const conduit::Node &n_mesh, const std::string &main_toplogy_name="", bool zero_copy=false)
Constructs and MFEM mesh from a Conduit Blueprint Description.
Mesh * mesh
The (common) mesh for the collected fields.
virtual ~ConduitDataCollection()
We will delete the mesh and fields if we own them.
int cycle
Time cycle; for time-dependent simulations cycle >= 0, otherwise = -1.
std::string MeshFileName(int domain_id, const std::string &file_protocol="hdf5")
Returns the mesh file name for a given domain at the current cycle.
Type
Constants for the classes derived from Element.
virtual void Save()
Save the collection and a Conduit blueprint root file.
void LoadRootFile(conduit::Node &n_root_out)
Loads contents of the root field for the current cycle into n_root_out.
void SaveRootFile(int num_domains, const conduit::Node &n_mesh, const std::string &file_protocol)
Saves root file for the current cycle.
void LoadMeshAndFields(int domain_id, const std::string &file_protocol)
Loads all meshes and fields of a given domain id for the current cycle.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
std::string MeshDirectoryName()
Returns the mesh output directory for the current cycle.
std::string MeshFilePattern(const std::string &file_protocol="hdf5")
Returns the mesh file pattern for the current cycle.
static void GridFunctionToBlueprintField(GridFunction *gf, conduit::Node &out, const std::string &main_topology_name="main")
Describes a MFEM grid function using the mesh blueprint.
static GridFunction * BlueprintFieldToGridFunction(Mesh *mesh, const conduit::Node &n_field, bool zero_copy=false)
Constructs and MFEM Grid Function from a Conduit Blueprint Description.
void SetProtocol(const std::string &protocol)
Set the Conduit relay i/o protocol to use.