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