MFEM  v3.4
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
sidredatacollection.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_SIDREDATACOLLECTION
13 #define MFEM_SIDREDATACOLLECTION
14 
15 #include "../config/config.hpp"
16 
17 #ifdef MFEM_USE_SIDRE
18 
19 #include "datacollection.hpp"
20 #include <sidre/sidre.hpp>
21 
22 namespace mfem
23 {
24 
25 /** @brief Data collection with Sidre routines following the Conduit mesh
26  blueprint specification. */
27 /** SidreDataCollection provides an HDF5-based file format for visualization or
28  restart capability. This functionality is aimed primarily at customers of
29  LLNL's axom project that run problems at extreme scales.
30 
31  For more information, see:
32  - Sidre component of LLNL's axom project (to be open-sourced), http://goo.gl/cZyJdn
33  - LLNL conduit/blueprint library, https://github.com/LLNL/conduit
34  - HDF5 library, https://support.hdfgroup.org/HDF5
35 
36  The layout created in the Sidre DataStore is: (`"──"` denote groups,
37  `"─•"` denote views, `"─>"` denote links, i.e. shallow-copy view)
38 
39  <root>
40  ├── <collection-name>_global (global group)
41  │ └── blueprint_index
42  │ └── <collection-name> (bp_index group)
43  │ ├── state
44  │ │ ├─• cycle
45  │ │ ├─• time
46  │ │ └─• number_of_domains = <mesh-mpi-comm-size>
47  │ ├── coordsets
48  │ │ └── coords
49  │ │ ├─• path = "<bp-path>/coordsets/coords"
50  │ │ ├─• type ─> <bp-grp>/coordsets/coords/type = "explicit"
51  │ │ └─• coord_system = "x"|"xy"|"xyz"
52  │ ├── topologies
53  │ │ ├── mesh
54  │ │ │ ├─• path = "<bp-path>/topologies/mesh"
55  │ │ │ ├─• type ─> <bp-grp>/topologies/mesh/type = "unstructured"
56  │ │ │ ├─• coordset ─> <bp-grp>/topologies/mesh/coordset = "coords"
57  │ │ │ ├─• grid_function ─> <bp-grp>/topologies/mesh/grid_function = "<nodes-field-name>"
58  │ │ │ └─• boundary_topology ─> <bp-grp>/topologies/mesh/boundary_topology = "boundary"
59  │ │ └── boundary
60  │ │ ├─• path = "<bp-path>/topologies/mesh"
61  │ │ ├─• type ─> <bp-grp>/topologies/boundary/type = "unstructured"
62  │ │ └─• coordset ─> <bp-grp>/topologies/boundary/coordset = "coords"
63  │ └── fields
64  │ ├── mesh_material_attribute
65  │ │ ├─• path = "<bp-path>/fields/mesh_material_attribute"
66  │ │ ├─• association ─> <bp-grp>/fields/mesh_material_attribute/association = "element"
67  │ │ ├─• topology ─> <bp-grp>/fields/mesh_material_attribute/topology = "mesh"
68  │ │ └─• number_of_components = 1
69  │ ├── boundary_material_attribute
70  │ │ ├─• path = "<bp-path>/fields/boundary_material_attribute"
71  │ │ ├─• association ─> <bp-grp>/fields/boundary_material_attribute/association = "element"
72  │ │ ├─• topology ─> <bp-grp>/fields/boundary_material_attribute/topology = "boundary"
73  │ │ └─• number_of_components = 1
74  │ ├── grid-function-1
75  │ │ ├─• path = "<bp-path>/fields/grid-function-1"
76  │ │ ├─• basis ─> <bp-grp>/fields/grid-function-1/basis = "<fe-coll-name>"
77  │ │ ├─• topology ─> <bp-grp>/fields/grid-function-1/topology = "mesh"
78  │ │ └─• number_of_components = gf1->VectorDim()
79  │ ├── grid-function-2
80  │ │ ├─• path = "<bp-path>/fields/grid-function-2"
81  │ │ ├─• basis ─> <bp-grp>/fields/grid-function-2/basis = "<fe-coll-name>"
82  │ │ ├─• topology ─> <bp-grp>/fields/grid-function-2/topology = "mesh"
83  │ │ └─• number_of_components = gf2->VectorDim()
84  │ ├── ...
85  │ ...
86  └── <collection-name> (domain group)
87  ├── blueprint (blueprint group)
88  │ ├── state
89  │ │ ├─• cycle
90  │ │ ├─• time
91  │ │ ├─• domain = <mesh-mpi-rank>
92  │ │ └─• time_step
93  │ ├── coordsets
94  │ │ └── coords
95  │ │ ├─• type = "explicit"
96  │ │ └── values
97  │ │ ├─• x = view in <vertex-coords-buffer>/<ext-double-data>
98  │ │ ├─• y = view in <vertex-coords-buffer>/<ext-double-data>
99  │ │ └─• z = view in <vertex-coords-buffer>/<ext-double-data>
100  │ ├── topologies
101  │ │ ├── mesh
102  │ │ │ ├─• type = "unstructured"
103  │ │ │ ├── elements
104  │ │ │ │ ├─• shape = "points"|"lines"|...
105  │ │ │ │ └─• connectivity = <vert-idx-array>
106  │ │ │ ├─• coordset = "coords"
107  │ │ │ ├─• grid_function = "<nodes-field-name>"
108  │ │ │ └─• boundary_topology = "boundary"
109  │ │ └── boundary
110  │ │ ├─• type = "unstructured"
111  │ │ ├── elements
112  │ │ │ ├─• shape = "points"|"lines"|...
113  │ │ │ └─• connectivity = <vert-idx-array>
114  │ │ └─• coordset = "coords"
115  │ └── fields
116  │ ├── mesh_material_attribute
117  │ │ ├─• association = "element"
118  │ │ ├─• topology = "mesh"
119  │ │ └─• values = <attr-array>
120  │ ├── boundary_material_attribute
121  │ │ ├─• association = "element"
122  │ │ ├─• topology = "boundary"
123  │ │ └─• values = <attr-array>
124  │ ├── grid-function-1 (name can include path)
125  │ │ ├─• basis = "<fe-coll-name>"
126  │ │ ├─• topology = "mesh"
127  │ │ └─• values = <ext-double-array>/<named-buffer> (vdim == 1)
128  │ ├── grid-function-2 (name can include path)
129  │ │ ├─• basis = "<fe-coll-name>"
130  │ │ ├─• topology = "mesh"
131  │ │ └── values (vdim > 1)
132  │ │ ├─• x0 = view into <ext-double-array>/<named-buffer>
133  │ │ ├─• x1 = view into <ext-double-array>/<named-buffer>
134  │ │ └─• x2 = view into <ext-double-array>/<named-buffer>
135  │ ├── ...
136  │ ...
137  └── named_buffers (named_buffers group)
138  ├─• vertex_coords = <double-array>
139  ├─• grid-function-1 = <double-array>
140  ├─• grid-function-2 = <double-array>
141  ...
142 
143  @note blueprint_index is used both in serial and in parallel. In parallel,
144  only rank 0 will add entries to the blueprint index.
145 
146  @note QuadratureFunction%s (q-fields) are not supported.
147 
148  @note SidreDataCollection does not manage the FiniteElementSpace%s and
149  FiniteElementCollection%s associated with registered GridFunction%s.
150  Therefore, field registration is left to the user of SidreDataCollection and
151  there are no methods that automatically register GridFunction%s using just
152  the content of the Sidre DataStore. Such capabilities can be implemented in
153  a derived class, adding any desired object management routines.
154 
155  @warning This class is still _experimental_, meaning that in future
156  releases, it may not be backward compatible, and the output files generated
157  by the current version may become unreadable.
158 */
160 {
161 public:
164 
165 public:
166 
167  /// Constructor that allocates and initializes a Sidre DataStore.
168  /**
169  @param[in] collection_name Name of the collection used as a file name
170  when saving
171  @param[in] the_mesh Mesh shared by all grid functions in the
172  collection (can be NULL)
173  @param[in] owns_mesh_data Does the SidreDC own the mesh vertices?
174 
175  With this constructor, the SidreDataCollection owns the allocated Sidre
176  DataStore.
177  */
178  SidreDataCollection(const std::string& collection_name,
179  Mesh *the_mesh = NULL,
180  bool owns_mesh_data = false);
181 
182  /// Constructor that links to an external Sidre DataStore.
183  /** Specifically, the global and domain groups can be at arbitrary paths.
184 
185  @param[in] collection_name Name of the collection used as a file name
186  when saving
187  @param[in] global_grp Pointer to the global group in the datastore,
188  see the above schematic
189  @param[in] domain_grp Pointer to the domain group in the datastore,
190  see the above schematic
191  @param[in] owns_mesh_data Does the SidreDC own the mesh vertices?
192 
193  With this constructor, the SidreDataCollection does not own the Sidre
194  DataStore.
195  @note No mesh or fields are read from the given Groups. The mesh has
196  to be set with SetMesh() and fields registered with RegisterField().
197  */
198  SidreDataCollection(const std::string& collection_name,
199  axom::sidre::Group * global_grp,
200  axom::sidre::Group * domain_grp,
201  bool owns_mesh_data = false);
202 
203 #ifdef MFEM_USE_MPI
204  /// Associate an MPI communicator with the collection.
205  /** If no mesh was associated with the collection, this method should be
206  called before using any of the Load() methods to read parallel data. */
207  void SetComm(MPI_Comm comm);
208 #endif
209 
210  /// Register a GridFunction in the Sidre DataStore.
211  /** This method is a shortcut for the call
212  `RegisterField(field_name, gf, field_name, 0)`.
213  */
214  virtual void RegisterField(const std::string &field_name, GridFunction *gf)
215  {
216  RegisterField(field_name, gf, field_name, 0);
217  }
218 
219  /// Register a GridFunction in the Sidre DataStore.
220  /** The registration procedure is as follows:
221  - if (@a gf's data is NULL), allocate named buffer with the name
222  @a buffer_name with size _offset + gf->FESpace()->GetVSize()_ and use
223  its data (plus the given @a offset) to set @a gf's data;
224  - else, if (DataStore has a named buffer @a buffer_name), replace @a gf's
225  data array with that named buffer plus the given @a offset;
226  - else, use @a gf's data as external data associated with @a field_name
227  in the DataStore;
228  - register @a field_name in #field_map.
229 
230  Both the @a field_name and @a buffer_name can contain a path prefix.
231  @note If @a field_name or @a buffer_name is empty, the method does
232  nothing.
233  @note If the GridFunction pointer @a gf or it's FiniteElementSpace
234  pointer are NULL, the method does nothing.
235  */
236  void RegisterField(const std::string &field_name, GridFunction *gf,
237  const std::string &buffer_name,
238  axom::sidre::SidreLength offset);
239 
240  /// Registers an attribute field in the Sidre DataStore
241  /** The registration process is similar to that of RegisterField()
242  The attribute field is associated with the elements of the mesh
243  when @a is_bdry is false, and with the boundary elements, when
244  @a is_bdry is true.
245  @sa RegisterField() */
246  void RegisterAttributeField(const std::string& name, bool is_bdry);
247  void DeregisterAttributeField(const std::string& name);
248 
249  /** Returns a pointer to the attribute field associated with
250  @a field_name, or NULL when there is no associated field */
251  Array<int>* GetAttributeField(const std::string& field_name) const
252  { return attr_map.Get(field_name); }
253 
254  /** Checks if there is an attribute field associated with @a field_name */
255  bool HasAttributeField(const std::string& field_name) const
256  { return attr_map.Has(field_name); }
257 
258  /** Checks if any rank in the mesh has boundary elements */
259  bool HasBoundaryMesh() const;
260 
261  /// Set the name of the mesh nodes field.
262  /** This name will be used by SetMesh() to register the mesh nodes, if not
263  already registered. Also, this method should be called if the mesh nodes
264  GridFunction was or will be registered directly by the user. The default
265  value for the name is "mesh_nodes". */
266  void SetMeshNodesName(const std::string &nodes_name)
267  {
268  if (!nodes_name.empty()) { m_meshNodesGFName = nodes_name; }
269  }
270 
271  /// De-register @a field_name from the SidreDataCollection.
272  /** The field is removed from the #field_map and the DataStore, including
273  deleting it from the named_buffers group, if allocated. */
274  virtual void DeregisterField(const std::string& field_name);
275 
276  /// Delete all owned data.
277  virtual ~SidreDataCollection();
278 
279  /// Set/change the mesh associated with the collection
280  /** Uses the field name "mesh_nodes" or the value set by SetMeshNodesName()
281  to register the mesh nodes GridFunction, if the mesh uses nodes. */
282  virtual void SetMesh(Mesh *new_mesh);
283 
284 #ifdef MFEM_USE_MPI
285  /// Set/change the mesh associated with the collection
286  /** Uses the field name "mesh_nodes" or the value set by SetMeshNodesName()
287  to register the mesh nodes GridFunction, if the mesh uses nodes. */
288  virtual void SetMesh(MPI_Comm comm, Mesh *new_mesh);
289 #endif
290 
291  /// Reset the domain and global datastore group pointers.
292  /** These are set in the constructor, but if a host code changes the
293  datastore contents ( such as wiping out the datastore and loading in new
294  contents from a file, i.e. a restart ) these pointers will need to be
295  reset to valid groups in the datastore.
296  @sa Load(const std::string &path, const std::string &protocol).
297  */
298  void SetGroupPointers(axom::sidre::Group * global_grp,
299  axom::sidre::Group * domain_grp);
300 
301  axom::sidre::Group * GetBPGroup() { return bp_grp; }
302  axom::sidre::Group * GetBPIndexGroup() { return bp_index_grp; }
303 
304  /// Prepare the DataStore for writing
305  virtual void PrepareToSave();
306 
307  /// Save the collection to file.
308  /** This method calls `Save(collection_name, "sidre_hdf5")`. */
309  virtual void Save();
310 
311  /// Save the collection to @a filename.
312  /** The collection path prefix is prepended to the @a filename and the
313  current cycle is appended, if cycle >= 0. */
314  void Save(const std::string& filename, const std::string& protocol);
315 
316  /// Load the Sidre DataStore from file.
317  /** No mesh or fields are read from the loaded DataStore.
318 
319  If the data collection created the datastore, it knows the layout of
320  where the domain and global groups are, and can restore them after the
321  Load().
322 
323  If, however, the data collection does not own the datastore (e.g. it did
324  not create the datastore), the host code must reset these pointers after
325  the load operation, using SetGroupPointers(), and also reset the state
326  variables, using UpdateStateFromDS().
327  */
328  void Load(const std::string& path, const std::string& protocol);
329 
330  /// Load SidreDataCollection from file.
331  /** The used file path is based on the current prefix path, collection name,
332  and the given @a cycle_. The protocol is "sidre_hdf5".
333  @sa Load(const std::string &path, const std::string &protocol).
334  */
335  virtual void Load(int cycle_ = 0)
336  {
337  SetCycle(cycle_);
338  Load(get_file_path(name), "sidre_hdf5");
339  }
340 
341  /// Load external data after registering externally owned fields.
342  void LoadExternalData(const std::string& path);
343 
344  /** @brief Updates the DataCollection's cycle, time, and time-step variables
345  with the values from the data store. */
346  void UpdateStateFromDS();
347 
348  /** @brief Updates the data store's cycle, time, and time-step variables with
349  the values from the SidreDataCollection. */
350  void UpdateStateToDS();
351 
352  /** @name Methods for named buffer access and manipulation. */
353  ///@{
354 
355  /** @brief Get a pointer to the sidre::View holding the named buffer for
356  @a buffer_name. */
357  /** If such named buffer is not allocated, the method returns NULL.
358  @note To access the underlying pointer, use View::getData().
359  @note To query the size of the buffer, use View::getNumElements().
360  */
361  axom::sidre::View *
362  GetNamedBuffer(const std::string& buffer_name) const
363  {
364  return named_buffers_grp()->hasView(buffer_name)
365  ? named_buffers_grp()->getView(buffer_name)
366  : NULL;
367  }
368 
369  /// Return newly allocated or existing named buffer for @a buffer_name.
370  /** The buffer is stored in the named_buffers group. If the currently
371  allocated buffer size is smaller than @a sz, then the buffer is
372  reallocated with size @a sz, destroying its contents.
373  @note To access the underlying pointer, use View::getData().
374  */
375  axom::sidre::View *
376  AllocNamedBuffer(const std::string& buffer_name,
377  axom::sidre::SidreLength sz,
378  axom::sidre::TypeID type =
379  axom::sidre::DOUBLE_ID);
380 
381  /// Deallocate the named buffer @a buffer_name.
382  void FreeNamedBuffer(const std::string& buffer_name)
383  { named_buffers_grp()->destroyViewAndData(buffer_name); }
384 
385  ///@}
386 
387 private:
388  // Used if the Sidre data collection is providing the datastore itself.
389  const bool m_owns_datastore;
390 
391  // TODO - Need to evaluate if this bool member can be combined with own_data
392  // in parent data collection class. m_owns_mesh_data indicates whether the
393  // Sidre dc owns the mesh element data and node positions gf. The DC base
394  // class own_data indicates if the dc owns the mesh object pointer itself and
395  // GF objects. Can we use one flag and just have DC own all objects vs none?
396  const bool m_owns_mesh_data;
397 
398  // Name to be used for registering the mesh nodes in the SidreDataCollection.
399  // This name is used by SetMesh() and can be overwritten by the method
400  // SetMeshNodesName().
401  // Default value: "mesh_nodes".
402  std::string m_meshNodesGFName;
403 
404  // If the data collection owns the datastore, it will store a pointer to it.
405  // Otherwise, this pointer is NULL.
406  axom::sidre::DataStore * m_datastore_ptr;
407 
408 protected:
409  axom::sidre::Group *named_buffers_grp() const;
410 
411  axom::sidre::View *
412  alloc_view(axom::sidre::Group *grp,
413  const std::string &view_name);
414 
415  axom::sidre::View *
416  alloc_view(axom::sidre::Group *grp,
417  const std::string &view_name,
418  const axom::sidre::DataType &dtype);
419 
420  axom::sidre::Group *
421  alloc_group(axom::sidre::Group *grp,
422  const std::string &group_name);
423 
424  // return the filename based on prefix_path, collection name and cycle.
425  std::string get_file_path(const std::string &filename) const;
426 
427 private:
428  // If the data collection does not own the datastore, it will need pointers
429  // to the blueprint and blueprint index group to use.
430  axom::sidre::Group * bp_grp;
431  axom::sidre::Group * bp_index_grp;
432 
433  // This is stored for convenience.
434  axom::sidre::Group * named_bufs_grp;
435 
436  // Private helper functions
437 
438  void RegisterFieldInBPIndex(const std::string& field_name,
439  GridFunction *gf);
440  void DeregisterFieldInBPIndex(const std::string & field_name);
441 
442  void RegisterAttributeFieldInBPIndex(const std::string& attr_name);
443  void DeregisterAttributeFieldInBPIndex(const std::string& attr_name);
444 
445  /** @brief Return a string with the conduit blueprint name for the given
446  Element::Type. */
447  std::string getElementName( Element::Type elementEnum );
448 
449  /**
450  * \brief A private helper function to set up the views associated with the
451  data of a scalar valued grid function in the blueprint style.
452  * \pre gf is not null
453  * \note This function is expected to be called by RegisterField()
454  * \note Handles cases where hierarchy is already set up,
455  * where the data was allocated by this data collection
456  * and where the gridfunction data is external to Sidre
457  */
458  void addScalarBasedGridFunction(const std::string& field_name,
459  GridFunction* gf,
460  const std::string &buffer_name,
461  axom::sidre::SidreLength offset);
462 
463  /**
464  * \brief A private helper function to set up the views associated with the
465  data of a vector valued grid function in the blueprint style.
466  * \pre gf is not null
467  * \note This function is expected to be called by RegisterField()
468  * \note Handles cases where hierarchy is already set up,
469  * where the data was allocated by this data collection
470  * and where the gridfunction data is external to Sidre
471  */
472  void addVectorBasedGridFunction(const std::string& field_name,
473  GridFunction* gf,
474  const std::string &buffer_name,
475  axom::sidre::SidreLength offset);
476 
477  /** @brief A private helper function to set up the Views associated with
478  attribute field named @a field_name */
479  void addIntegerAttributeField(const std::string& field_name, bool is_bdry);
480 
481  /// Sets up the four main mesh blueprint groups.
482  /**
483  * \param hasBP Indicates whether the blueprint has already been set up.
484  */
485  void createMeshBlueprintStubs(bool hasBP);
486 
487  /// Sets up the mesh blueprint 'state' group.
488  /**
489  * \param hasBP Indicates whether the blueprint has already been set up.
490  */
491  void createMeshBlueprintState(bool hasBP);
492 
493  /// Sets up the mesh blueprint 'coordsets' group.
494  /**
495  * \param hasBP Indicates whether the blueprint has already been set up.
496  */
497  void createMeshBlueprintCoordset(bool hasBP);
498 
499  /// Sets up the mesh blueprint 'topologies' group.
500  /**
501  * This method is called from SetMesh().
502  * \param hasBP Indicates whether the blueprint has already been set up.
503  * \param mesh_name The name of the topology.
504  * \note Valid values for @a mesh_name are "mesh" and "boundary" and the
505  former has to be created with this method before the latter.
506  */
507  void createMeshBlueprintTopologies(bool hasBP, const std::string& mesh_name);
508 
509 #ifdef MFEM_USE_MPI
510  /// Sets up the mesh blueprint 'adjacencies' group.
511  /**
512  * \param hasBP Indicates whether the blueprint has already been set up.
513  * \note Only valid when using parallel meshes
514  */
515  void createMeshBlueprintAdjacencies(bool hasBP);
516 #endif
517 
518  /// Verifies that the contents of the mesh blueprint data is valid.
519  void verifyMeshBlueprint();
520 };
521 
522 } // end namespace mfem
523 
524 #endif
525 
526 #endif
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.
Definition: gridfunc.hpp:27
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.
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.
Definition: element.hpp:37
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&#39;s cycle, time, and time-step variables with the values from the SidreDataColle...
NamedFieldsMap< Array< int > > AttributeFieldMap
void UpdateStateFromDS()
Updates the DataCollection&#39;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)
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