www.mooseframework.org
Classes | Namespaces | Functions
DataIO.h File Reference

Go to the source code of this file.

Classes

class  libMesh::DenseMatrix< T >
 
class  libMesh::DenseVector< T >
 
class  libMesh::VectorValue< T >
 
class  libMesh::TensorValue< T >
 
class  libMesh::Parallel::Packing< std::basic_string< T > >
 

Namespaces

 libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 
 libMesh::Parallel
 

Functions

template<typename P >
void storeHelper (std::ostream &stream, P &data, void *context)
 Scalar helper routine. More...
 
template<typename P >
void storeHelper (std::ostream &stream, std::vector< P > &data, void *context)
 Vector helper routine. More...
 
template<typename P >
void storeHelper (std::ostream &stream, std::shared_ptr< P > &data, void *context)
 Shared pointer helper routine. More...
 
template<typename P >
void storeHelper (std::ostream &stream, std::unique_ptr< P > &data, void *context)
 Unique pointer helper routine. More...
 
template<typename P >
void storeHelper (std::ostream &stream, std::set< P > &data, void *context)
 Set helper routine. More...
 
template<typename P , typename Q >
void storeHelper (std::ostream &stream, std::map< P, Q > &data, void *context)
 Map helper routine. More...
 
template<typename P , typename Q >
void storeHelper (std::ostream &stream, std::unordered_map< P, Q > &data, void *context)
 Unordered_map helper routine. More...
 
template<typename P >
void storeHelper (std::ostream &stream, std::optional< P > &data, void *context)
 Optional helper routine. More...
 
template<typename P , typename Q >
void storeHelper (std::ostream &stream, HashMap< P, Q > &data, void *context)
 HashMap helper routine. More...
 
template<typename T >
void storeHelper (std::ostream &stream, UniqueStorage< T > &data, void *context)
 UniqueStorage helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, P &data, void *context)
 Scalar helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, std::vector< P > &data, void *context)
 Vector helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, std::shared_ptr< P > &data, void *context)
 Shared Pointer helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, std::unique_ptr< P > &data, void *context)
 Unique Pointer helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, std::set< P > &data, void *context)
 Set helper routine. More...
 
template<typename P , typename Q >
void loadHelper (std::istream &stream, std::map< P, Q > &data, void *context)
 Map helper routine. More...
 
template<typename P , typename Q >
void loadHelper (std::istream &stream, std::unordered_map< P, Q > &data, void *context)
 Unordered_map helper routine. More...
 
template<typename P >
void loadHelper (std::istream &stream, std::optional< P > &data, void *context)
 Optional helper routine. More...
 
template<typename P , typename Q >
void loadHelper (std::istream &stream, HashMap< P, Q > &data, void *context)
 Hashmap helper routine. More...
 
template<typename T >
void loadHelper (std::istream &stream, UniqueStorage< T > &data, void *context)
 UniqueStorage helper routine. More...
 
template<typename T >
void dataStore (std::ostream &stream, T &v, void *)
 
template<typename T >
void dataStore (std::ostream &, T *&, void *)
 
void dataStore (std::ostream &stream, Point &p, void *context)
 
template<typename T , typename U >
void dataStore (std::ostream &stream, std::pair< T, U > &p, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::vector< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::shared_ptr< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::unique_ptr< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::set< T > &s, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::list< T > &l, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::deque< T > &l, void *context)
 
template<typename T , typename U >
void dataStore (std::ostream &stream, std::map< T, U > &m, void *context)
 
template<typename T , typename U >
void dataStore (std::ostream &stream, std::unordered_map< T, U > &m, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, std::optional< T > &m, void *context)
 
template<typename T , typename U >
void dataStore (std::ostream &stream, HashMap< T, U > &m, void *context)
 
template<>
void dataStore (std::ostream &stream, Real &v, void *context)
 
template<>
void dataStore (std::ostream &stream, std::string &v, void *context)
 
template<>
void dataStore (std::ostream &stream, VariableName &v, void *context)
 
template<>
void dataStore (std::ostream &stream, bool &v, void *context)
 
template<>
void dataStore (std::ostream &stream, std::vector< bool > &v, void *context)
 
template<>
void dataStore (std::ostream &stream, const Elem *&e, void *context)
 
template<>
void dataStore (std::ostream &stream, const Node *&n, void *context)
 
template<>
void dataStore (std::ostream &stream, Elem *&e, void *context)
 
template<>
void dataStore (std::ostream &stream, Node *&n, void *context)
 
template<>
void dataStore (std::ostream &stream, std::stringstream &s, void *context)
 
template<>
void dataStore (std::ostream &stream, DualReal &dn, void *context)
 
template<>
void dataStore (std::ostream &stream, RealEigenVector &v, void *context)
 
template<>
void dataStore (std::ostream &stream, RealEigenMatrix &v, void *context)
 
template<>
void dataStore (std::ostream &stream, libMesh::Parameters &p, void *context)
 
template<>
void dataStore (std::ostream &stream, std::unique_ptr< libMesh::NumericVector< Number >> &v, void *context)
 Stores an owned numeric vector. More...
 
template<std::size_t N>
void dataStore (std::ostream &stream, std::array< DualReal, N > &dn, void *context)
 
template<std::size_t N>
void dataStore (std::ostream &stream, DualReal(&dn)[N], void *context)
 
template<typename T >
void dataStore (std::ostream &stream, NumericVector< T > &v, void *context)
 
template<>
void dataStore (std::ostream &stream, Vec &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, DenseVector< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, TensorValue< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, DenseMatrix< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, VectorValue< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, RankTwoTensorTempl< T > &rtt, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, RankThreeTensorTempl< T > &rtt, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, RankFourTensorTempl< T > &rft, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, SymmetricRankTwoTensorTempl< T > &srtt, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, SymmetricRankFourTensorTempl< T > &srft, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, ColumnMajorMatrixTempl< T > &cmm, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, T &v, void *)
 
template<typename T >
void dataLoad (std::istream &, T *&, void *)
 
template<typename T , typename U >
void dataLoad (std::istream &stream, std::pair< T, U > &p, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::vector< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::shared_ptr< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::unique_ptr< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::set< T > &s, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::list< T > &l, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::deque< T > &l, void *context)
 
template<typename T , typename U >
void dataLoad (std::istream &stream, std::map< T, U > &m, void *context)
 
template<typename T , typename U >
void dataLoad (std::istream &stream, std::unordered_map< T, U > &m, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, std::optional< T > &m, void *context)
 
template<typename T , typename U >
void dataLoad (std::istream &stream, HashMap< T, U > &m, void *context)
 
template<>
void dataLoad (std::istream &stream, Real &v, void *)
 
template<>
void dataLoad (std::istream &stream, std::string &v, void *)
 
template<>
void dataLoad (std::istream &stream, VariableName &v, void *)
 
template<>
void dataLoad (std::istream &stream, bool &v, void *)
 
template<>
void dataLoad (std::istream &stream, std::vector< bool > &v, void *)
 
template<>
void dataLoad (std::istream &stream, const Elem *&e, void *context)
 
template<>
void dataLoad (std::istream &stream, const Node *&e, void *context)
 
template<>
void dataLoad (std::istream &stream, Elem *&e, void *context)
 
template<>
void dataLoad (std::istream &stream, Node *&e, void *context)
 
template<>
void dataLoad (std::istream &stream, std::stringstream &s, void *context)
 
template<>
void dataLoad (std::istream &stream, DualReal &dn, void *context)
 
template<>
void dataLoad (std::istream &stream, RealEigenVector &v, void *context)
 
template<>
void dataLoad (std::istream &stream, RealEigenMatrix &v, void *context)
 
template<>
void dataLoad (std::istream &stream, libMesh::Parameters &p, void *context)
 
template<>
void dataLoad (std::istream &stream, std::unique_ptr< libMesh::NumericVector< Number >> &v, void *context)
 Loads an owned numeric vector. More...
 
template<std::size_t N>
void dataLoad (std::istream &stream, std::array< DualReal, N > &dn, void *context)
 
template<std::size_t N>
void dataLoad (std::istream &stream, DualReal(&dn)[N], void *context)
 
template<typename T >
void dataLoad (std::istream &stream, NumericVector< T > &v, void *context)
 
template<>
void dataLoad (std::istream &stream, Vec &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, DenseVector< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, TensorValue< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, DenseMatrix< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, VectorValue< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, RankTwoTensorTempl< T > &rtt, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, RankThreeTensorTempl< T > &rtt, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, RankFourTensorTempl< T > &rft, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, SymmetricRankTwoTensorTempl< T > &rtt, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, SymmetricRankFourTensorTempl< T > &rft, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, ColumnMajorMatrixTempl< T > &cmm, void *context)
 
void dataLoad (std::istream &stream, Point &p, void *context)
 

Function Documentation

◆ dataLoad() [1/43]

template<typename T >
void dataLoad ( std::istream &  stream,
T &  v,
void  
)
inline

Definition at line 524 of file DataIO.h.

Referenced by dataLoad(), and loadHelper().

525 {
526  stream.read((char *)&v, sizeof(v));
527  mooseAssert(!stream.bad(), "Failed to load");
528 }

◆ dataLoad() [2/43]

template<typename T >
void dataLoad ( std::istream &  ,
T *&  ,
void  
)

Definition at line 532 of file DataIO.h.

533 {
534  mooseError("Attempting to load a raw pointer type: \"",
535  demangle(typeid(T).name()),
536  " *\" as restartable data!\nWrite a custom dataLoad() template specialization!\n\n");
537 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
std::string demangle(const char *name)

◆ dataLoad() [3/43]

template<typename T , typename U >
void dataLoad ( std::istream &  stream,
std::pair< T, U > &  p,
void context 
)
inline

Definition at line 541 of file DataIO.h.

542 {
543  loadHelper(stream, p.first, context);
544  loadHelper(stream, p.second, context);
545 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [4/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::vector< T > &  v,
void context 
)
inline

Definition at line 549 of file DataIO.h.

550 {
551  // First read the size of the vector
552  unsigned int size = 0;
553  dataLoad(stream, size, nullptr);
554 
555  v.resize(size);
556 
557  for (unsigned int i = 0; i < size; i++)
558  loadHelper(stream, v[i], context);
559 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [5/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::shared_ptr< T > &  v,
void context 
)
inline

Definition at line 563 of file DataIO.h.

564 {
565  T * tmp = v.get();
566 
567  loadHelper(stream, tmp, context);
568 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [6/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::unique_ptr< T > &  v,
void context 
)
inline

Definition at line 572 of file DataIO.h.

573 {
574  T * tmp = v.get();
575 
576  loadHelper(stream, tmp, context);
577 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [7/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::set< T > &  s,
void context 
)
inline

Definition at line 581 of file DataIO.h.

582 {
583  // First read the size of the set
584  unsigned int size = 0;
585  dataLoad(stream, size, nullptr);
586 
587  for (unsigned int i = 0; i < size; i++)
588  {
589  T data;
590  loadHelper(stream, data, context);
591  s.insert(std::move(data));
592  }
593 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [8/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::list< T > &  l,
void context 
)
inline

Definition at line 597 of file DataIO.h.

598 {
599  // First read the size of the set
600  unsigned int size = 0;
601  dataLoad(stream, size, nullptr);
602 
603  for (unsigned int i = 0; i < size; i++)
604  {
605  T data;
606  loadHelper(stream, data, context);
607  l.push_back(std::move(data));
608  }
609 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [9/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::deque< T > &  l,
void context 
)
inline

Definition at line 613 of file DataIO.h.

614 {
615  // First read the size of the container
616  unsigned int size = 0;
617  dataLoad(stream, size, nullptr);
618 
619  for (unsigned int i = 0; i < size; i++)
620  {
621  T data;
622  loadHelper(stream, data, context);
623  l.push_back(std::move(data));
624  }
625 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [10/43]

template<typename T , typename U >
void dataLoad ( std::istream &  stream,
std::map< T, U > &  m,
void context 
)
inline

Definition at line 629 of file DataIO.h.

630 {
631  m.clear();
632 
633  // First read the size of the map
634  unsigned int size = 0;
635  dataLoad(stream, size, nullptr);
636 
637  for (unsigned int i = 0; i < size; i++)
638  {
639  T key;
640  loadHelper(stream, key, context);
641 
642  U & value = m[key];
643  loadHelper(stream, value, context);
644  }
645 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [11/43]

template<typename T , typename U >
void dataLoad ( std::istream &  stream,
std::unordered_map< T, U > &  m,
void context 
)
inline

Definition at line 649 of file DataIO.h.

650 {
651  m.clear();
652 
653  // First read the size of the map
654  unsigned int size = 0;
655  dataLoad(stream, size, nullptr);
656 
657  for (unsigned int i = 0; i < size; i++)
658  {
659  T key;
660  loadHelper(stream, key, context);
661 
662  U & value = m[key];
663  loadHelper(stream, value, context);
664  }
665 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [12/43]

template<typename T >
void dataLoad ( std::istream &  stream,
std::optional< T > &  m,
void context 
)
inline

Definition at line 669 of file DataIO.h.

670 {
671  bool has_value;
672  dataLoad(stream, has_value, nullptr);
673 
674  if (has_value)
675  {
676  m = T{};
677  loadHelper(stream, *m, context);
678  }
679  else
680  m.reset();
681 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [13/43]

template<typename T , typename U >
void dataLoad ( std::istream &  stream,
HashMap< T, U > &  m,
void context 
)
inline

Definition at line 685 of file DataIO.h.

686 {
687  // First read the size of the map
688  unsigned int size = 0;
689  dataLoad(stream, size, nullptr);
690 
691  for (unsigned int i = 0; i < size; i++)
692  {
693  T key;
694  loadHelper(stream, key, context);
695 
696  U & value = m[key];
697  loadHelper(stream, value, context);
698  }
699 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [14/43]

template<>
void dataLoad ( std::istream &  stream,
Real v,
void  
)

Definition at line 357 of file DataIO.C.

Referenced by dataLoad().

358 {
359  stream.read((char *)&v, sizeof(v));
360 }

◆ dataLoad() [15/43]

template<>
void dataLoad ( std::istream &  stream,
std::string &  v,
void  
)

Definition at line 364 of file DataIO.C.

365 {
366  // Read the size of the string
367  unsigned int size = 0;
368  stream.read((char *)&size, sizeof(size));
369 
370  // Resize the string data
371  v.resize(size);
372 
373  // Read the string
374  stream.read(&v[0], sizeof(char) * size);
375 }

◆ dataLoad() [16/43]

template<>
void dataLoad ( std::istream &  stream,
VariableName &  v,
void  
)

Definition at line 379 of file DataIO.C.

380 {
381  auto & name = static_cast<std::string &>(v);
382  dataLoad(stream, name, context);
383 }
std::string name(const ElemQuality q)
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357

◆ dataLoad() [17/43]

template<>
void dataLoad ( std::istream &  stream,
bool &  v,
void  
)

Definition at line 387 of file DataIO.C.

388 {
389  stream.read((char *)&v, sizeof(v));
390 }

◆ dataLoad() [18/43]

template<>
void dataLoad ( std::istream &  stream,
std::vector< bool > &  v,
void  
)

Definition at line 394 of file DataIO.C.

395 {
396  for (bool b : v)
397  dataLoad(stream, b, context);
398 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357

◆ dataLoad() [19/43]

template<>
void dataLoad ( std::istream &  stream,
const Elem *&  e,
void context 
)

Definition at line 423 of file DataIO.C.

424 {
425  if (!context)
426  mooseError("Can only load Elem objects using a MooseMesh context!");
427 
428  MooseMesh * mesh = static_cast<MooseMesh *>(context);
429 
430  // TODO: Write out the unique ID of this element
432 
433  loadHelper(stream, id, context);
434 
436  e = mesh->elemPtr(id);
437  else
438  e = NULL;
439 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MeshBase & mesh
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
static const dof_id_type invalid_id
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948
uint8_t dof_id_type

◆ dataLoad() [20/43]

template<>
void dataLoad ( std::istream &  stream,
const Node *&  e,
void context 
)

Definition at line 443 of file DataIO.C.

444 {
445  if (!context)
446  mooseError("Can only load Node objects using a MooseMesh context!");
447 
448  MooseMesh * mesh = static_cast<MooseMesh *>(context);
449 
450  // TODO: Write out the unique ID of this nodeent
452 
453  loadHelper(stream, id, context);
454 
456  n = mesh->nodePtr(id);
457  else
458  n = NULL;
459 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MeshBase & mesh
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
static const dof_id_type invalid_id
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948
uint8_t dof_id_type

◆ dataLoad() [21/43]

template<>
void dataLoad ( std::istream &  stream,
Elem *&  e,
void context 
)

Definition at line 463 of file DataIO.C.

464 {
465  if (!context)
466  mooseError("Can only load Elem objects using a MooseMesh context!");
467 
468  MooseMesh * mesh = static_cast<MooseMesh *>(context);
469 
470  // TODO: Write out the unique ID of this element
472 
473  loadHelper(stream, id, context);
474 
476  e = mesh->elemPtr(id);
477  else
478  e = NULL;
479 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MeshBase & mesh
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
static const dof_id_type invalid_id
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948
uint8_t dof_id_type

◆ dataLoad() [22/43]

template<>
void dataLoad ( std::istream &  stream,
Node *&  e,
void context 
)

Definition at line 483 of file DataIO.C.

484 {
485  if (!context)
486  mooseError("Can only load Node objects using a MooseMesh context!");
487 
488  MooseMesh * mesh = static_cast<MooseMesh *>(context);
489 
490  // TODO: Write out the unique ID of this nodeent
492 
493  loadHelper(stream, id, context);
494 
496  n = mesh->nodePtr(id);
497  else
498  n = NULL;
499 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MeshBase & mesh
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
static const dof_id_type invalid_id
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948
uint8_t dof_id_type

◆ dataLoad() [23/43]

template<>
void dataLoad ( std::istream &  stream,
std::stringstream &  s,
void context 
)

Definition at line 503 of file DataIO.C.

504 {
505  size_t s_size = 0;
506  stream.read((char *)&s_size, sizeof(s_size));
507 
508  std::unique_ptr<char[]> s_s = std::make_unique<char[]>(s_size);
509  stream.read(s_s.get(), s_size);
510 
511  // Clear the stringstream before loading new data into it.
512  s.str(std::string());
513  s.write(s_s.get(), s_size);
514 }

◆ dataLoad() [24/43]

template<>
void dataLoad ( std::istream &  stream,
DualReal dn,
void context 
)

Definition at line 402 of file DataIO.C.

403 {
404  dataLoad(stream, dn.value(), context);
405 
406  if (DualReal::do_derivatives)
407  {
408  auto & derivatives = dn.derivatives();
409  std::size_t size = 0;
410  stream.read((char *)&size, sizeof(size));
411  derivatives.resize(size);
412 
413  for (MooseIndex(derivatives) i = 0; i < derivatives.size(); ++i)
414  {
415  dataLoad(stream, derivatives.raw_index(i), context);
416  dataLoad(stream, derivatives.raw_at(i), context);
417  }
418  }
419 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357

◆ dataLoad() [25/43]

template<>
void dataLoad ( std::istream &  stream,
RealEigenVector &  v,
void context 
)

Definition at line 518 of file DataIO.C.

519 {
520  unsigned int n = 0;
521  stream.read((char *)&n, sizeof(n));
522  v.resize(n);
523  for (unsigned int i = 0; i < n; i++)
524  {
525  Real r = 0;
526  dataLoad(stream, r, context);
527  v(i) = r;
528  }
529 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ dataLoad() [26/43]

template<>
void dataLoad ( std::istream &  stream,
RealEigenMatrix &  v,
void context 
)

Definition at line 533 of file DataIO.C.

534 {
535  unsigned int m = 0;
536  stream.read((char *)&m, sizeof(m));
537  unsigned int n = 0;
538  stream.read((char *)&n, sizeof(n));
539  v.resize(m, n);
540  for (unsigned int i = 0; i < m; i++)
541  for (unsigned int j = 0; j < n; j++)
542  {
543  Real r = 0;
544  dataLoad(stream, r, context);
545  v(i, j) = r;
546  }
547 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ dataLoad() [27/43]

template<>
void dataLoad ( std::istream &  stream,
libMesh::Parameters p,
void context 
)

Definition at line 617 of file DataIO.C.

618 {
619  p.clear();
620 
621  // First read the size of the map
622  unsigned int size = 0;
623  stream.read((char *)&size, sizeof(size));
624 
625  for (unsigned int i = 0; i < size; i++)
626  {
627  std::string key, type;
628  loadHelper(stream, key, context);
629  loadHelper(stream, type, context);
630 
631 #define loadscalar(ptype) \
632  else if (type == demangle(typeid(ptype).name())) do \
633  { \
634  ptype & value = p.set<ptype>(key); \
635  loadHelper(stream, value, context); \
636  } \
637  while (0)
638 
639  if (false)
640  ;
641  loadscalar(Real);
642  loadscalar(short);
643  loadscalar(int);
644  loadscalar(long);
645  loadscalar(unsigned short);
646  loadscalar(unsigned int);
647  loadscalar(unsigned long);
648 
649 #undef loadscalar
650  }
651 }
virtual void clear()
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948

◆ dataLoad() [28/43]

template<>
void dataLoad ( std::istream &  stream,
std::unique_ptr< libMesh::NumericVector< Number >> &  v,
void context 
)

Loads an owned numeric vector.

This is used in lieu of the NumericVector<double> & implementation when the vector may not necessarily be initialized yet on the loading of the data.

If is not null, it must have the same global and local sizes that it was stored with. In this case, the data is simply filled into the vector.

If is null, it will be constructed with the type (currently just a PetscVector) stored and initialized with the global and local sizes stored. The data will then be filled after initialization.

Requirements: the vector cannot be ghosted, the provided context must be the Communicator, and if v is initialized, it must have the same global and local sizes that the vector was stored with.

Definition at line 655 of file DataIO.C.

656 {
657  mooseAssert(context, "Needs a context of the communicator");
658  const auto & comm = *static_cast<const libMesh::Parallel::Communicator *>(context);
659  if (v)
660  mooseAssert(&comm == &v->comm(), "Inconsistent communicator");
661 
662  // Load the communicator size for consistency checks
663  unsigned int comm_size;
664  dataLoad(stream, comm_size, nullptr);
665  mooseAssert(comm.size() == comm_size, "Inconsistent communicator size");
666 
667  // Load the solver package to build the vector
668  int solver_package_int;
669  dataLoad(stream, solver_package_int, nullptr);
670  libMesh::SolverPackage solver_package = static_cast<libMesh::SolverPackage>(solver_package_int);
671 
672  // Load the sizes
673  dof_id_type size, local_size;
674  dataLoad(stream, size, nullptr);
675  dataLoad(stream, local_size, nullptr);
676 
677  // Construct the vector given the type, only if we need to. v could be non-null here
678  // if we're advancing back and loading a backup
679  if (!v)
680  {
681  v = NumericVector<Number>::build(comm, solver_package);
682  v->init(size, local_size);
683  }
684  else
685  mooseAssert(v->type() != GHOSTED, "Cannot be ghosted");
686 
687  // Make sure that the sizes are consistent; this will happen if we're calling this
688  // on a vector that has already been loaded previously
689  mooseAssert(v->size() == size, "Inconsistent size");
690  mooseAssert(v->local_size() == local_size, "Inconsistent local size");
691 
692  // Now that we have an initialized vector, fill the entries
693  dataLoad(stream, *v, nullptr);
694 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
GHOSTED
static std::unique_ptr< NumericVector< Number > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
uint8_t dof_id_type

◆ dataLoad() [29/43]

template<std::size_t N>
void dataLoad ( std::istream &  stream,
std::array< DualReal, N > &  dn,
void context 
)
inline

Definition at line 756 of file DataIO.h.

757 {
758  for (std::size_t i = 0; i < N; ++i)
759  dataLoad(stream, dn[i], context);
760 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [30/43]

template<std::size_t N>
void dataLoad ( std::istream &  stream,
DualReal(&)  dn[N],
void context 
)
inline

Definition at line 764 of file DataIO.h.

765 {
766  for (std::size_t i = 0; i < N; ++i)
767  dataLoad(stream, dn[i], context);
768 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [31/43]

template<typename T >
void dataLoad ( std::istream &  stream,
NumericVector< T > &  v,
void context 
)

Definition at line 772 of file DataIO.h.

773 {
774  numeric_index_type size = v.local_size();
775  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
776  {
777  T r = 0;
778  dataLoad(stream, r, context);
779  v.set(i, r);
780  }
781  v.close();
782 }
dof_id_type numeric_index_type
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [32/43]

template<>
void dataLoad ( std::istream &  stream,
Vec &  v,
void context 
)

Definition at line 698 of file DataIO.C.

699 {
700  PetscInt local_size;
701  VecGetLocalSize(v, &local_size);
702  PetscScalar * array;
703  VecGetArray(v, &array);
704  for (PetscInt i = 0; i < local_size; i++)
705  dataLoad(stream, array[i], context);
706 
707  VecRestoreArray(v, &array);
708 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357

◆ dataLoad() [33/43]

template<typename T >
void dataLoad ( std::istream &  stream,
DenseVector< T > &  v,
void context 
)

Definition at line 789 of file DataIO.h.

790 {
791  unsigned int n = 0;
792  dataLoad(stream, n, nullptr);
793  v.resize(n);
794  for (unsigned int i = 0; i < n; i++)
795  {
796  T r = 0;
797  dataLoad(stream, r, context);
798  v(i) = r;
799  }
800 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [34/43]

template<typename T >
void dataLoad ( std::istream &  stream,
TensorValue< T > &  v,
void context 
)

Definition at line 551 of file DataIO.C.

552 {
553  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
554  // won't work.
555  for (const auto i : make_range(Moose::dim))
556  for (const auto j : make_range(Moose::dim))
557  {
558  T r = 0;
559  dataLoad(stream, r, context);
560  v(i, j) = r;
561  }
562 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [35/43]

template<typename T >
void dataLoad ( std::istream &  stream,
DenseMatrix< T > &  v,
void context 
)

Definition at line 569 of file DataIO.C.

570 {
571  unsigned int m = 0, n = 0;
572  stream.read((char *)&m, sizeof(m));
573  stream.read((char *)&n, sizeof(n));
574  v.resize(m, n);
575  for (unsigned int i = 0; i < m; i++)
576  for (unsigned int j = 0; j < n; j++)
577  {
578  T r = 0;
579  dataLoad(stream, r, context);
580  v(i, j) = r;
581  }
582 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357

◆ dataLoad() [36/43]

template<typename T >
void dataLoad ( std::istream &  stream,
VectorValue< T > &  v,
void context 
)

Definition at line 589 of file DataIO.C.

590 {
591  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
592  // won't work.
593  for (const auto i : make_range(Moose::dim))
594  {
595  T r = 0;
596  dataLoad(stream, r, context);
597  v(i) = r;
598  }
599 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [37/43]

template<typename T >
void dataLoad ( std::istream &  stream,
RankTwoTensorTempl< T > &  rtt,
void context 
)

Definition at line 813 of file DataIO.h.

814 {
815  dataLoad(stream, rtt._coords, context);
816 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [38/43]

template<typename T >
void dataLoad ( std::istream &  stream,
RankThreeTensorTempl< T > &  rtt,
void context 
)

Definition at line 820 of file DataIO.h.

821 {
822  dataLoad(stream, rtt._vals, context);
823 }
T _vals[N3]
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) ...
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [39/43]

template<typename T >
void dataLoad ( std::istream &  stream,
RankFourTensorTempl< T > &  rft,
void context 
)

Definition at line 827 of file DataIO.h.

828 {
829  dataLoad(stream, rft._vals, context);
830 }
T _vals[N4]
The values of the rank-four tensor stored by index=(((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) * LIBME...
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [40/43]

template<typename T >
void dataLoad ( std::istream &  stream,
SymmetricRankTwoTensorTempl< T > &  rtt,
void context 
)

Definition at line 834 of file DataIO.h.

835 {
836  dataLoad(stream, rtt._vals, context);
837 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [41/43]

template<typename T >
void dataLoad ( std::istream &  stream,
SymmetricRankFourTensorTempl< T > &  rft,
void context 
)

Definition at line 841 of file DataIO.h.

842 {
843  dataLoad(stream, rft._vals, context);
844 }
std::array< T, N2 > _vals
The values of the rank-four tensor.
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [42/43]

template<typename T >
void dataLoad ( std::istream &  stream,
ColumnMajorMatrixTempl< T > &  cmm,
void context 
)

Definition at line 848 of file DataIO.h.

849 {
850  dataLoad(stream, cmm._values, context);
851 }
std::vector< T > _values
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ dataLoad() [43/43]

void dataLoad ( std::istream &  stream,
Point &  p,
void context 
)

Definition at line 605 of file DataIO.C.

606 {
607  for (const auto i : make_range(Moose::dim))
608  {
609  Real r = 0;
610  dataLoad(stream, r, context);
611  p(i) = r;
612  }
613 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:357
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

◆ dataStore() [1/43]

template<typename T >
void dataStore ( std::ostream &  stream,
T &  v,
void  
)
inline

Definition at line 182 of file DataIO.h.

Referenced by dataStore(), and storeHelper().

183 {
184 #ifdef LIBMESH_HAVE_CXX11_TYPE_TRAITS
185  static_assert(std::is_polymorphic<T>::value == false,
186  "Cannot serialize a class that has virtual "
187  "members!\nWrite a custom dataStore() "
188  "template specialization!\n\n");
189  static_assert(std::is_trivially_copyable<T>::value,
190  "Cannot serialize a class that is not trivially copyable!\nWrite a custom "
191  "dataStore() template specialization!\n\n");
192 #endif
193 
194  // Moose::out<<"Generic dataStore"<<std::endl;
195  stream.write((char *)&v, sizeof(v));
196  mooseAssert(!stream.bad(), "Failed to store");
197 }

◆ dataStore() [2/43]

template<typename T >
void dataStore ( std::ostream &  ,
T *&  ,
void  
)
inline

Definition at line 201 of file DataIO.h.

202 {
203  mooseError("Attempting to store a raw pointer type: \"",
204  demangle(typeid(T).name()),
205  " *\" as restartable data!\nWrite a custom dataStore() template specialization!\n\n");
206 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
std::string demangle(const char *name)

◆ dataStore() [3/43]

void dataStore ( std::ostream &  stream,
Point &  p,
void context 
)

Definition at line 268 of file DataIO.C.

269 {
270  for (const auto i : make_range(Moose::dim))
271  {
272  Real r = p(i);
273  dataStore(stream, r, context);
274  }
275 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [4/43]

template<typename T , typename U >
void dataStore ( std::ostream &  stream,
std::pair< T, U > &  p,
void context 
)
inline

Definition at line 212 of file DataIO.h.

213 {
214  storeHelper(stream, p.first, context);
215  storeHelper(stream, p.second, context);
216 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856

◆ dataStore() [5/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::vector< T > &  v,
void context 
)
inline

Definition at line 220 of file DataIO.h.

221 {
222  // First store the size of the vector
223  unsigned int size = v.size();
224  dataStore(stream, size, nullptr);
225 
226  for (unsigned int i = 0; i < size; i++)
227  storeHelper(stream, v[i], context);
228 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [6/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::shared_ptr< T > &  v,
void context 
)
inline

Definition at line 232 of file DataIO.h.

233 {
234  T * tmp = v.get();
235 
236  storeHelper(stream, tmp, context);
237 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856

◆ dataStore() [7/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::unique_ptr< T > &  v,
void context 
)
inline

Definition at line 241 of file DataIO.h.

242 {
243  T * tmp = v.get();
244 
245  storeHelper(stream, tmp, context);
246 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856

◆ dataStore() [8/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::set< T > &  s,
void context 
)
inline

Definition at line 250 of file DataIO.h.

251 {
252  // First store the size of the set
253  unsigned int size = s.size();
254  dataStore(stream, size, nullptr);
255 
256  typename std::set<T>::iterator it = s.begin();
257  typename std::set<T>::iterator end = s.end();
258 
259  for (; it != end; ++it)
260  {
261  T & x = const_cast<T &>(*it);
262  storeHelper(stream, x, context);
263  }
264 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [9/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::list< T > &  l,
void context 
)
inline

Definition at line 268 of file DataIO.h.

269 {
270  // First store the size of the set
271  unsigned int size = l.size();
272  dataStore(stream, size, nullptr);
273 
274  typename std::list<T>::iterator it = l.begin();
275  typename std::list<T>::iterator end = l.end();
276 
277  for (; it != end; ++it)
278  {
279  T & x = const_cast<T &>(*it);
280  storeHelper(stream, x, context);
281  }
282 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [10/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::deque< T > &  l,
void context 
)
inline

Definition at line 286 of file DataIO.h.

287 {
288  // First store the size of the container
289  unsigned int size = l.size();
290  dataStore(stream, size, nullptr);
291 
292  typename std::deque<T>::iterator it = l.begin();
293  typename std::deque<T>::iterator end = l.end();
294 
295  for (; it != end; ++it)
296  {
297  T & x = const_cast<T &>(*it);
298  storeHelper(stream, x, context);
299  }
300 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [11/43]

template<typename T , typename U >
void dataStore ( std::ostream &  stream,
std::map< T, U > &  m,
void context 
)
inline

Definition at line 304 of file DataIO.h.

305 {
306  // First store the size of the map
307  unsigned int size = m.size();
308  dataStore(stream, size, nullptr);
309 
310  typename std::map<T, U>::iterator it = m.begin();
311  typename std::map<T, U>::iterator end = m.end();
312 
313  for (; it != end; ++it)
314  {
315  T & key = const_cast<T &>(it->first);
316 
317  storeHelper(stream, key, context);
318 
319  storeHelper(stream, it->second, context);
320  }
321 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [12/43]

template<typename T , typename U >
void dataStore ( std::ostream &  stream,
std::unordered_map< T, U > &  m,
void context 
)
inline

Definition at line 325 of file DataIO.h.

326 {
327  // First store the size of the map
328  unsigned int size = m.size();
329  dataStore(stream, size, nullptr);
330 
331  typename std::unordered_map<T, U>::iterator it = m.begin();
332  typename std::unordered_map<T, U>::iterator end = m.end();
333 
334  for (; it != end; ++it)
335  {
336  T & key = const_cast<T &>(it->first);
337 
338  storeHelper(stream, key, context);
339 
340  storeHelper(stream, it->second, context);
341  }
342 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [13/43]

template<typename T >
void dataStore ( std::ostream &  stream,
std::optional< T > &  m,
void context 
)
inline

Definition at line 346 of file DataIO.h.

347 {
348  bool has_value = m.has_value();
349  dataStore(stream, has_value, nullptr);
350 
351  if (has_value)
352  storeHelper(stream, *m, context);
353 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [14/43]

template<typename T , typename U >
void dataStore ( std::ostream &  stream,
HashMap< T, U > &  m,
void context 
)
inline

Definition at line 357 of file DataIO.h.

358 {
359  // First store the size of the map
360  unsigned int size = m.size();
361  dataStore(stream, size, nullptr);
362 
363  typename HashMap<T, U>::iterator it = m.begin();
364  typename HashMap<T, U>::iterator end = m.end();
365 
366  for (; it != end; ++it)
367  {
368  T & key = const_cast<T &>(it->first);
369 
370  storeHelper(stream, key, context);
371 
372  storeHelper(stream, it->second, context);
373  }
374 }
HashMap is an abstraction for dictionary data type, we make it thread-safe by locking inserts...
Definition: HashMap.h:18
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [15/43]

template<>
void dataStore ( std::ostream &  stream,
Real v,
void context 
)

Definition at line 28 of file DataIO.C.

Referenced by dataStore().

29 {
30  stream.write((char *)&v, sizeof(v));
31 }

◆ dataStore() [16/43]

template<>
void dataStore ( std::ostream &  stream,
std::string &  v,
void context 
)

Definition at line 35 of file DataIO.C.

36 {
37  // Write the size of the string
38  unsigned int size = v.size();
39  stream.write((char *)&size, sizeof(size));
40 
41  // Write the string (Do not store the null byte)
42  stream.write(v.c_str(), sizeof(char) * size);
43 }

◆ dataStore() [17/43]

template<>
void dataStore ( std::ostream &  stream,
VariableName &  v,
void context 
)

Definition at line 47 of file DataIO.C.

48 {
49  auto & name = static_cast<std::string &>(v);
50  dataStore(stream, name, context);
51 }
std::string name(const ElemQuality q)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [18/43]

template<>
void dataStore ( std::ostream &  stream,
bool &  v,
void context 
)

Definition at line 55 of file DataIO.C.

56 {
57  stream.write((char *)&v, sizeof(v));
58 }

◆ dataStore() [19/43]

template<>
void dataStore ( std::ostream &  stream,
std::vector< bool > &  v,
void context 
)

Definition at line 62 of file DataIO.C.

63 {
64  for (bool b : v)
65  dataStore(stream, b, context);
66 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [20/43]

template<>
void dataStore ( std::ostream &  stream,
const Elem *&  e,
void context 
)

Definition at line 110 of file DataIO.C.

111 {
112  // TODO: Write out the unique ID of this elem
114 
115  if (e)
116  {
117  id = e->id();
119  mooseError("Can't output Elems with invalid ids!");
120  }
121 
122  storeHelper(stream, id, context);
123 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
static const dof_id_type invalid_id
uint8_t dof_id_type

◆ dataStore() [21/43]

template<>
void dataStore ( std::ostream &  stream,
const Node *&  n,
void context 
)

Definition at line 127 of file DataIO.C.

128 {
129  // TODO: Write out the unique ID of this node
131 
132  if (n)
133  {
134  id = n->id();
136  mooseError("Can't output Nodes with invalid ids!");
137  }
138 
139  storeHelper(stream, id, context);
140 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
static const dof_id_type invalid_id
uint8_t dof_id_type

◆ dataStore() [22/43]

template<>
void dataStore ( std::ostream &  stream,
Elem *&  e,
void context 
)

Definition at line 144 of file DataIO.C.

145 {
146  // TODO: Write out the unique ID of this elem
148 
149  if (e)
150  {
151  id = e->id();
153  mooseError("Can't output Elems with invalid ids!");
154  }
155 
156  storeHelper(stream, id, context);
157 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
static const dof_id_type invalid_id
uint8_t dof_id_type

◆ dataStore() [23/43]

template<>
void dataStore ( std::ostream &  stream,
Node *&  n,
void context 
)

Definition at line 161 of file DataIO.C.

162 {
163  // TODO: Write out the unique ID of this node
165 
166  if (n)
167  {
168  id = n->id();
170  mooseError("Can't output Nodes with invalid ids!");
171  }
172 
173  storeHelper(stream, id, context);
174 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
static const dof_id_type invalid_id
uint8_t dof_id_type

◆ dataStore() [24/43]

template<>
void dataStore ( std::ostream &  stream,
std::stringstream &  s,
void context 
)

Definition at line 178 of file DataIO.C.

179 {
180  const std::string & s_str = s.str();
181 
182  size_t s_size = s_str.size();
183  stream.write((char *)&s_size, sizeof(s_size));
184 
185  stream.write(s_str.c_str(), sizeof(char) * (s_str.size()));
186 }

◆ dataStore() [25/43]

template<>
void dataStore ( std::ostream &  stream,
DualReal dn,
void context 
)

Definition at line 91 of file DataIO.C.

92 {
93  dataStore(stream, dn.value(), context);
94 
95  if (DualReal::do_derivatives)
96  {
97  auto & derivatives = dn.derivatives();
98  std::size_t size = derivatives.size();
99  dataStore(stream, size, context);
100  for (MooseIndex(size) i = 0; i < size; ++i)
101  {
102  dataStore(stream, derivatives.raw_index(i), context);
103  dataStore(stream, derivatives.raw_at(i), context);
104  }
105  }
106 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [26/43]

template<>
void dataStore ( std::ostream &  stream,
RealEigenVector &  v,
void context 
)

Definition at line 190 of file DataIO.C.

191 {
192  unsigned int m = v.size();
193  stream.write((char *)&m, sizeof(m));
194  for (unsigned int i = 0; i < v.size(); i++)
195  {
196  Real r = v(i);
197  dataStore(stream, r, context);
198  }
199 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [27/43]

template<>
void dataStore ( std::ostream &  stream,
RealEigenMatrix &  v,
void context 
)

Definition at line 203 of file DataIO.C.

204 {
205  unsigned int m = v.rows();
206  stream.write((char *)&m, sizeof(m));
207  unsigned int n = v.cols();
208  stream.write((char *)&n, sizeof(n));
209  for (unsigned int i = 0; i < m; i++)
210  for (unsigned int j = 0; j < n; j++)
211  {
212  Real r = v(i, j);
213  dataStore(stream, r, context);
214  }
215 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [28/43]

template<>
void dataStore ( std::ostream &  stream,
libMesh::Parameters p,
void context 
)

Definition at line 279 of file DataIO.C.

280 {
281  // First store the size of the map
282  unsigned int size = p.n_parameters();
283  stream.write((char *)&size, sizeof(size));
284 
285  auto it = p.begin();
286  auto end = p.end();
287 
288  for (; it != end; ++it)
289  {
290  auto & key = const_cast<std::string &>(it->first);
291  auto type = it->second->type();
292 
293  storeHelper(stream, key, context);
294  storeHelper(stream, type, context);
295 
296 #define storescalar(ptype) \
297  else if (it->second->type() == demangle(typeid(ptype).name())) storeHelper( \
298  stream, \
299  (dynamic_cast<libMesh::Parameters::Parameter<ptype> *>(MooseUtils::get(it->second)))->get(), \
300  context)
301 
302  if (false)
303  ;
304  storescalar(Real);
305  storescalar(short);
306  storescalar(int);
307  storescalar(long);
308  storescalar(unsigned short);
309  storescalar(unsigned int);
310  storescalar(unsigned long);
311 
312 #undef storescalar
313  }
314 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
std::size_t n_parameters() const

◆ dataStore() [29/43]

template<>
void dataStore ( std::ostream &  stream,
std::unique_ptr< libMesh::NumericVector< Number >> &  v,
void context 
)

Stores an owned numeric vector.

This should be used in lieu of the NumericVector<Number> & implementation when the vector may not necessarily be initialized yet on the loading of the data. It stores the partitioning (total and local number of entries).

Requirements: the unique_ptr must exist (cannot be null), the vector cannot be ghosted, and the provided context must be the Communicator.

Definition at line 318 of file DataIO.C.

321 {
322  mooseAssert(v, "Null vector");
323  mooseAssert(context, "Needs a context of the communicator");
324  const auto & comm = *static_cast<const libMesh::Parallel::Communicator *>(context);
325  mooseAssert(&comm == &v->comm(), "Inconsistent communicator");
326 
327  if (v->type() == GHOSTED)
328  mooseError("Cannot store ghosted numeric vectors");
329 
330  // Store the communicator size for sanity checking later
331  unsigned int comm_size = comm.size();
332  dataStore(stream, comm_size, nullptr);
333 
334  // Store the solver package so that we know what vector type to construct
335  libMesh::SolverPackage solver_package;
336  if (dynamic_cast<libMesh::PetscVector<Number> *>(v.get()))
337  solver_package = PETSC_SOLVERS;
338  else
339  mooseError("Can only store unique_ptrs of PetscVectors");
340  int solver_package_int = solver_package;
341  dataStore(stream, solver_package_int, nullptr);
342 
343  // Store the sizes
344  dof_id_type size = v->size();
345  dataStore(stream, size, nullptr);
346  dof_id_type local_size = v->local_size();
347  dataStore(stream, local_size, nullptr);
348 
349  // Store the vector itself
350  dataStore(stream, *v, nullptr);
351 }
PETSC_SOLVERS
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
GHOSTED
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28
uint8_t dof_id_type

◆ dataStore() [30/43]

template<std::size_t N>
void dataStore ( std::ostream &  stream,
std::array< DualReal, N > &  dn,
void context 
)
inline

Definition at line 424 of file DataIO.h.

425 {
426  for (std::size_t i = 0; i < N; ++i)
427  dataStore(stream, dn[i], context);
428 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [31/43]

template<std::size_t N>
void dataStore ( std::ostream &  stream,
DualReal(&)  dn[N],
void context 
)
inline

Definition at line 432 of file DataIO.h.

433 {
434  for (std::size_t i = 0; i < N; ++i)
435  dataStore(stream, dn[i], context);
436 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [32/43]

template<typename T >
void dataStore ( std::ostream &  stream,
NumericVector< T > &  v,
void context 
)

Definition at line 440 of file DataIO.h.

441 {
442  v.close();
443 
444  numeric_index_type size = v.local_size();
445 
446  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
447  {
448  T r = v(i);
449  dataStore(stream, r, context);
450  }
451 }
dof_id_type numeric_index_type
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [33/43]

template<>
void dataStore ( std::ostream &  stream,
Vec &  v,
void context 
)

Definition at line 712 of file DataIO.C.

713 {
714  PetscInt local_size;
715  VecGetLocalSize(v, &local_size);
716  PetscScalar * array;
717  VecGetArray(v, &array);
718  for (PetscInt i = 0; i < local_size; i++)
719  dataStore(stream, array[i], context);
720 
721  VecRestoreArray(v, &array);
722 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [34/43]

template<typename T >
void dataStore ( std::ostream &  stream,
DenseVector< T > &  v,
void context 
)

Definition at line 458 of file DataIO.h.

459 {
460  unsigned int m = v.size();
461  dataStore(stream, m, nullptr);
462  for (unsigned int i = 0; i < v.size(); i++)
463  {
464  T r = v(i);
465  dataStore(stream, r, context);
466  }
467 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [35/43]

template<typename T >
void dataStore ( std::ostream &  stream,
TensorValue< T > &  v,
void context 
)

Definition at line 219 of file DataIO.C.

220 {
221  for (const auto i : make_range(Moose::dim))
222  for (const auto j : make_range(Moose::dim))
223  {
224  T r = v(i, j);
225  dataStore(stream, r, context);
226  }
227 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
IntRange< T > make_range(T beg, T end)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [36/43]

template<typename T >
void dataStore ( std::ostream &  stream,
DenseMatrix< T > &  v,
void context 
)

Definition at line 234 of file DataIO.C.

235 {
236  unsigned int m = v.m();
237  unsigned int n = v.n();
238  stream.write((char *)&m, sizeof(m));
239  stream.write((char *)&n, sizeof(n));
240  for (unsigned int i = 0; i < m; i++)
241  for (unsigned int j = 0; j < n; j++)
242  {
243  T r = v(i, j);
244  dataStore(stream, r, context);
245  }
246 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [37/43]

template<typename T >
void dataStore ( std::ostream &  stream,
VectorValue< T > &  v,
void context 
)

Definition at line 253 of file DataIO.C.

254 {
255  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
256  // won't work.
257  for (const auto i : make_range(Moose::dim))
258  {
259  T r = v(i);
260  dataStore(stream, r, context);
261  }
262 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
IntRange< T > make_range(T beg, T end)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:28

◆ dataStore() [38/43]

template<typename T >
void dataStore ( std::ostream &  stream,
RankTwoTensorTempl< T > &  rtt,
void context 
)

Definition at line 480 of file DataIO.h.

481 {
482  dataStore(stream, rtt._coords, context);
483 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [39/43]

template<typename T >
void dataStore ( std::ostream &  stream,
RankThreeTensorTempl< T > &  rtt,
void context 
)

Definition at line 487 of file DataIO.h.

488 {
489  dataStore(stream, rtt._vals, context);
490 }
T _vals[N3]
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) ...
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [40/43]

template<typename T >
void dataStore ( std::ostream &  stream,
RankFourTensorTempl< T > &  rft,
void context 
)

Definition at line 494 of file DataIO.h.

495 {
496  dataStore(stream, rft._vals, context);
497 }
T _vals[N4]
The values of the rank-four tensor stored by index=(((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) * LIBME...
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [41/43]

template<typename T >
void dataStore ( std::ostream &  stream,
SymmetricRankTwoTensorTempl< T > &  srtt,
void context 
)

Definition at line 501 of file DataIO.h.

502 {
503  dataStore(stream, srtt._vals, context);
504 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [42/43]

template<typename T >
void dataStore ( std::ostream &  stream,
SymmetricRankFourTensorTempl< T > &  srft,
void context 
)

Definition at line 508 of file DataIO.h.

509 {
510  dataStore(stream, srft._vals, context);
511 }
std::array< T, N2 > _vals
The values of the rank-four tensor.
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ dataStore() [43/43]

template<typename T >
void dataStore ( std::ostream &  stream,
ColumnMajorMatrixTempl< T > &  cmm,
void context 
)

Definition at line 515 of file DataIO.h.

516 {
517  dataStore(stream, cmm._values, context);
518 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182
std::vector< T > _values

◆ loadHelper() [1/10]

template<typename P >
void loadHelper ( std::istream &  stream,
P &  data,
void context 
)
inline

Scalar helper routine.

Definition at line 948 of file DataIO.h.

Referenced by dataLoad(), MaterialPropertyBase< T, false >::load(), loadHelper(), ReporterState< std::vector< T > >::loadInternal(), and RestartableData< std::list< T > >::loadInternal().

949 {
950  dataLoad(stream, data, context);
951 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [2/10]

template<typename P >
void loadHelper ( std::istream &  stream,
std::vector< P > &  data,
void context 
)
inline

Vector helper routine.

Definition at line 956 of file DataIO.h.

957 {
958  dataLoad(stream, data, context);
959 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [3/10]

template<typename P >
void loadHelper ( std::istream &  stream,
std::shared_ptr< P > &  data,
void context 
)
inline

Shared Pointer helper routine.

Definition at line 964 of file DataIO.h.

965 {
966  dataLoad(stream, data, context);
967 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [4/10]

template<typename P >
void loadHelper ( std::istream &  stream,
std::unique_ptr< P > &  data,
void context 
)
inline

Unique Pointer helper routine.

Definition at line 972 of file DataIO.h.

973 {
974  dataLoad(stream, data, context);
975 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [5/10]

template<typename P >
void loadHelper ( std::istream &  stream,
std::set< P > &  data,
void context 
)
inline

Set helper routine.

Definition at line 980 of file DataIO.h.

981 {
982  dataLoad(stream, data, context);
983 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [6/10]

template<typename P , typename Q >
void loadHelper ( std::istream &  stream,
std::map< P, Q > &  data,
void context 
)
inline

Map helper routine.

Definition at line 988 of file DataIO.h.

989 {
990  dataLoad(stream, data, context);
991 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [7/10]

template<typename P , typename Q >
void loadHelper ( std::istream &  stream,
std::unordered_map< P, Q > &  data,
void context 
)
inline

Unordered_map helper routine.

Definition at line 996 of file DataIO.h.

997 {
998  dataLoad(stream, data, context);
999 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [8/10]

template<typename P >
void loadHelper ( std::istream &  stream,
std::optional< P > &  data,
void context 
)
inline

Optional helper routine.

Definition at line 1004 of file DataIO.h.

1005 {
1006  dataLoad(stream, data, context);
1007 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [9/10]

template<typename P , typename Q >
void loadHelper ( std::istream &  stream,
HashMap< P, Q > &  data,
void context 
)
inline

Hashmap helper routine.

Definition at line 1012 of file DataIO.h.

1013 {
1014  dataLoad(stream, data, context);
1015 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524

◆ loadHelper() [10/10]

template<typename T >
void loadHelper ( std::istream &  stream,
UniqueStorage< T > &  data,
void context 
)
inline

UniqueStorage helper routine.

UniqueStorage Helper Function.

The unique_ptr<T> loader is called to load the data. That is, you will likely need a specialization of unique_ptr<T> that will appropriately construct and then fill the piece of data.

Definition at line 1026 of file DataIO.h.

1027 {
1028  std::size_t size;
1029  dataLoad(stream, size, nullptr);
1030  data.resize(size);
1031 
1032  for (const auto i : index_range(data))
1033  loadHelper(stream, data.pointerValue(i), context);
1034 }
const std::unique_ptr< T > & pointerValue(const std::size_t i) const
Returns a read-only reference to the underlying unique pointer at index i.
void resize(const std::size_t size)
Resizes the underlying vector.
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:524
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:948
auto index_range(const T &sizable)

◆ storeHelper() [1/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
P &  data,
void context 
)
inline

Scalar helper routine.

Definition at line 856 of file DataIO.h.

Referenced by dataStore(), MaterialPropertyBase< T, false >::store(), storeHelper(), ReporterState< std::vector< T > >::storeInternal(), and RestartableData< std::list< T > >::storeInternal().

857 {
858  dataStore(stream, data, context);
859 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [2/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
std::vector< P > &  data,
void context 
)
inline

Vector helper routine.

Definition at line 864 of file DataIO.h.

865 {
866  dataStore(stream, data, context);
867 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [3/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
std::shared_ptr< P > &  data,
void context 
)
inline

Shared pointer helper routine.

Definition at line 872 of file DataIO.h.

873 {
874  dataStore(stream, data, context);
875 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [4/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
std::unique_ptr< P > &  data,
void context 
)
inline

Unique pointer helper routine.

Definition at line 880 of file DataIO.h.

881 {
882  dataStore(stream, data, context);
883 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [5/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
std::set< P > &  data,
void context 
)
inline

Set helper routine.

Definition at line 888 of file DataIO.h.

889 {
890  dataStore(stream, data, context);
891 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [6/10]

template<typename P , typename Q >
void storeHelper ( std::ostream &  stream,
std::map< P, Q > &  data,
void context 
)
inline

Map helper routine.

Definition at line 896 of file DataIO.h.

897 {
898  dataStore(stream, data, context);
899 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [7/10]

template<typename P , typename Q >
void storeHelper ( std::ostream &  stream,
std::unordered_map< P, Q > &  data,
void context 
)
inline

Unordered_map helper routine.

Definition at line 904 of file DataIO.h.

905 {
906  dataStore(stream, data, context);
907 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [8/10]

template<typename P >
void storeHelper ( std::ostream &  stream,
std::optional< P > &  data,
void context 
)
inline

Optional helper routine.

Definition at line 912 of file DataIO.h.

913 {
914  dataStore(stream, data, context);
915 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [9/10]

template<typename P , typename Q >
void storeHelper ( std::ostream &  stream,
HashMap< P, Q > &  data,
void context 
)
inline

HashMap helper routine.

Definition at line 920 of file DataIO.h.

921 {
922  dataStore(stream, data, context);
923 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182

◆ storeHelper() [10/10]

template<typename T >
void storeHelper ( std::ostream &  stream,
UniqueStorage< T > &  data,
void context 
)
inline

UniqueStorage helper routine.

The data within the UniqueStorage object cannot be null. The helper for unique_ptr<T> is called to store the data.

Definition at line 933 of file DataIO.h.

934 {
935  std::size_t size = data.size();
936  dataStore(stream, size, nullptr);
937 
938  for (const auto i : index_range(data))
939  {
940  mooseAssert(data.hasValue(i), "Data doesn't have a value");
941  storeHelper(stream, data.pointerValue(i), context);
942  }
943 }
const std::unique_ptr< T > & pointerValue(const std::size_t i) const
Returns a read-only reference to the underlying unique pointer at index i.
std::size_t size() const
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:856
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:182
bool hasValue(const std::size_t i) const
auto index_range(const T &sizable)