https://mooseframework.inl.gov
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 >
 
struct  Moose::MFEM::SolutionState
 
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.
 
 Moose::MFEM
 Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
 
 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::unordered_set< T > &s, 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<typename T , int Rows, int Cols>
void dataStore (std::ostream &stream, Eigen::Matrix< T, Rows, Cols > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, GenericTwoVector< T > &v, 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, UserObjectName &v, void *context)
 
template<>
void dataStore (std::ostream &stream, bool &v, void *context)
 
template<>
void dataStore (std::ostream &stream, libMesh::FEType &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, ADReal &dn, void *context)
 
template<>
void dataStore (std::ostream &stream, torch::Tensor &t, void *context)
 
template<>
void dataStore (std::ostream &stream, libMesh::Parameters &p, void *context)
 
template<>
void dataStore (std::ostream &stream, Moose::MFEM::SolutionState &state, void *context)
 
template<>
void dataStore (std::ostream &stream, std::unique_ptr< libMesh::NumericVector< libMesh::Number >> &v, void *context)
 Stores an owned numeric vector. More...
 
template<std::size_t N>
void dataStore (std::ostream &stream, std::array< ADReal, N > &dn, void *context)
 
template<std::size_t N>
void dataStore (std::ostream &stream, ADReal(&dn)[N], void *context)
 
template<typename T >
void dataStore (std::ostream &stream, libMesh::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, libMesh::TensorValue< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, libMesh::DenseMatrix< T > &v, void *context)
 
template<typename T >
void dataStore (std::ostream &stream, libMesh::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::unordered_set< T > &s, 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<typename T , int Rows, int Cols>
void dataLoad (std::istream &stream, Eigen::Matrix< T, Rows, Cols > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, GenericTwoVector< T > &v, 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, UserObjectName &v, void *)
 
template<>
void dataLoad (std::istream &stream, bool &v, void *)
 
template<>
void dataLoad (std::istream &stream, libMesh::FEType &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, ADReal &dn, void *context)
 
template<>
void dataLoad (std::istream &stream, torch::Tensor &t, void *context)
 
template<>
void dataLoad (std::istream &stream, libMesh::Parameters &p, void *context)
 
template<>
void dataLoad (std::istream &stream, Moose::MFEM::SolutionState &state, void *context)
 
template<>
void dataLoad (std::istream &stream, std::unique_ptr< libMesh::NumericVector< libMesh::Number >> &v, void *context)
 Loads an owned numeric vector. More...
 
template<std::size_t N>
void dataLoad (std::istream &stream, std::array< ADReal, N > &dn, void *context)
 
template<std::size_t N>
void dataLoad (std::istream &stream, ADReal(&dn)[N], void *context)
 
template<typename T >
void dataLoad (std::istream &stream, libMesh::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, libMesh::TensorValue< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, libMesh::DenseMatrix< T > &v, void *context)
 
template<typename T >
void dataLoad (std::istream &stream, libMesh::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/48]

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

Definition at line 581 of file DataIO.h.

Referenced by dataLoad(), and loadHelper().

582 {
583  stream.read((char *)&v, sizeof(v));
584  mooseAssert(!stream.bad(), "Failed to load");
585 }

◆ dataLoad() [2/48]

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

Definition at line 589 of file DataIO.h.

590 {
591  mooseError("Attempting to load a raw pointer type: \"",
592  libMesh::demangle(typeid(T).name()),
593  " *\" as restartable data!\nWrite a custom dataLoad() template specialization!\n\n");
594 }
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:311
std::string demangle(const char *name)

◆ dataLoad() [3/48]

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

Definition at line 598 of file DataIO.h.

599 {
600  loadHelper(stream, p.first, context);
601  loadHelper(stream, p.second, context);
602 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [4/48]

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

Definition at line 606 of file DataIO.h.

607 {
608  // First read the size of the vector
609  unsigned int size = 0;
610  dataLoad(stream, size, nullptr);
611 
612  v.resize(size);
613 
614  for (unsigned int i = 0; i < size; i++)
615  loadHelper(stream, v[i], context);
616 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [5/48]

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

Definition at line 620 of file DataIO.h.

621 {
622  T * tmp = v.get();
623 
624  loadHelper(stream, tmp, context);
625 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [6/48]

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

Definition at line 629 of file DataIO.h.

630 {
631  T * tmp = v.get();
632 
633  loadHelper(stream, tmp, context);
634 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [7/48]

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

Definition at line 638 of file DataIO.h.

639 {
640  // First read the size of the set
641  unsigned int size = 0;
642  dataLoad(stream, size, nullptr);
643 
644  for (unsigned int i = 0; i < size; i++)
645  {
646  T data;
647  loadHelper(stream, data, context);
648  s.insert(std::move(data));
649  }
650 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [8/48]

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

Definition at line 654 of file DataIO.h.

655 {
656  // First read the size of the set
657  unsigned int size = 0;
658  dataLoad(stream, size, nullptr);
659 
660  for (unsigned int i = 0; i < size; i++)
661  {
662  T data;
663  loadHelper(stream, data, context);
664  l.push_back(std::move(data));
665  }
666 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [9/48]

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

Definition at line 670 of file DataIO.h.

671 {
672  // First read the size of the container
673  unsigned int size = 0;
674  dataLoad(stream, size, nullptr);
675 
676  for (unsigned int i = 0; i < size; i++)
677  {
678  T data;
679  loadHelper(stream, data, context);
680  l.push_back(std::move(data));
681  }
682 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [10/48]

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

Definition at line 686 of file DataIO.h.

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

◆ dataLoad() [11/48]

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

Definition at line 706 of file DataIO.h.

707 {
708  m.clear();
709 
710  // First read the size of the map
711  unsigned int size = 0;
712  dataLoad(stream, size, nullptr);
713 
714  for (unsigned int i = 0; i < size; i++)
715  {
716  T key;
717  loadHelper(stream, key, context);
718 
719  U & value = m[key];
720  loadHelper(stream, value, context);
721  }
722 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [12/48]

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

Definition at line 726 of file DataIO.h.

727 {
728  s.clear();
729 
730  // First read the size of the set
731  std::size_t size = 0;
732  dataLoad(stream, size, nullptr);
733  s.reserve(size);
734 
735  for (std::size_t i = 0; i < size; i++)
736  {
737  T element;
738  dataLoad(stream, element, context);
739  s.insert(element);
740  }
741 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [13/48]

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

Definition at line 745 of file DataIO.h.

746 {
747  bool has_value;
748  dataLoad(stream, has_value, nullptr);
749 
750  if (has_value)
751  {
752  m = T{};
753  loadHelper(stream, *m, context);
754  }
755  else
756  m.reset();
757 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [14/48]

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

Definition at line 761 of file DataIO.h.

762 {
763  // First read the size of the map
764  unsigned int size = 0;
765  dataLoad(stream, size, nullptr);
766 
767  for (unsigned int i = 0; i < size; i++)
768  {
769  T key;
770  loadHelper(stream, key, context);
771 
772  U & value = m[key];
773  loadHelper(stream, value, context);
774  }
775 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [15/48]

template<typename T , int Rows, int Cols>
void dataLoad ( std::istream &  stream,
Eigen::Matrix< T, Rows, Cols > &  v,
void context 
)

Definition at line 779 of file DataIO.h.

780 {
781  unsigned int m = 0;
782  dataLoad(stream, m, context);
783  unsigned int n = 0;
784  dataLoad(stream, n, context);
785  v.resize(m, n);
786  for (const auto i : make_range(m))
787  for (const auto j : make_range(n))
788  {
789  T r{};
790  dataLoad(stream, r, context);
791  v(i, j) = r;
792  }
793 }
IntRange< T > make_range(T beg, T end)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [16/48]

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

Definition at line 797 of file DataIO.h.

798 {
799  dataLoad(stream, static_cast<Eigen::Matrix<T, 2, 1> &>(v), context);
800 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [17/48]

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

Definition at line 396 of file DataIO.C.

Referenced by dataLoad().

397 {
398  stream.read((char *)&v, sizeof(v));
399 }

◆ dataLoad() [18/48]

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

Definition at line 403 of file DataIO.C.

404 {
405  // Read the size of the string
406  unsigned int size = 0;
407  stream.read((char *)&size, sizeof(size));
408 
409  // Resize the string data
410  v.resize(size);
411 
412  // Read the string
413  stream.read(&v[0], sizeof(char) * size);
414 }

◆ dataLoad() [19/48]

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

Definition at line 418 of file DataIO.C.

419 {
420  auto & name = static_cast<std::string &>(v);
421  dataLoad(stream, name, context);
422 }
std::string name(const ElemQuality q)
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396

◆ dataLoad() [20/48]

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

Definition at line 426 of file DataIO.C.

427 {
428  auto & name = static_cast<std::string &>(v);
429  dataLoad(stream, name, context);
430 }
std::string name(const ElemQuality q)
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396

◆ dataLoad() [21/48]

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

Definition at line 434 of file DataIO.C.

435 {
436  stream.read((char *)&v, sizeof(v));
437 }

◆ dataLoad() [22/48]

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

Definition at line 441 of file DataIO.C.

442 {
443  int order = 0;
444  dataLoad(stream, order, context);
445  v.order = order;
446 
447  dataLoad(stream, v.family, context);
448 
449 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
450  int radial_order = 0;
451  dataLoad(stream, radial_order, context);
452  v.radial_order = radial_order;
453 
454  dataLoad(stream, v.radial_family, context);
455  dataLoad(stream, v.inf_map, context);
456 #endif
457 
458  dataLoad(stream, v.p_refinement, context);
459 }
OrderWrapper radial_order
OrderWrapper order
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396
InfMapType inf_map
FEFamily radial_family

◆ dataLoad() [23/48]

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

Definition at line 463 of file DataIO.C.

464 {
465  for (bool b : v)
466  dataLoad(stream, b, context);
467 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396

◆ dataLoad() [24/48]

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

◆ dataLoad() [25/48]

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

◆ dataLoad() [26/48]

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

◆ dataLoad() [27/48]

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

◆ dataLoad() [28/48]

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

Definition at line 572 of file DataIO.C.

573 {
574  size_t s_size = 0;
575  stream.read((char *)&s_size, sizeof(s_size));
576 
577  std::unique_ptr<char[]> s_s = std::make_unique<char[]>(s_size);
578  stream.read(s_s.get(), s_size);
579 
580  // Clear the stringstream before loading new data into it.
581  s.str(std::string());
582  s.write(s_s.get(), s_size);
583 }

◆ dataLoad() [29/48]

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

Definition at line 471 of file DataIO.C.

472 {
473  dataLoad(stream, dn.value(), context);
474 
475  if (ADReal::do_derivatives)
476  {
477  auto & derivatives = dn.derivatives();
478  std::size_t size = 0;
479  stream.read((char *)&size, sizeof(size));
480  derivatives.resize(size);
481 
482  for (MooseIndex(derivatives) i = 0; i < derivatives.size(); ++i)
483  {
484  dataLoad(stream, derivatives.raw_index(i), context);
485  dataLoad(stream, derivatives.raw_at(i), context);
486  }
487  }
488 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396

◆ dataLoad() [30/48]

template<>
void dataLoad ( std::istream &  stream,
torch::Tensor t,
void context 
)

Definition at line 588 of file DataIO.C.

589 {
590  unsigned int rank = 0;
591  dataLoad(stream, rank, nullptr);
592 
593  std::vector<int64_t> sizes(rank);
594  for (unsigned int dim = 0; dim < rank; ++dim)
595  {
596  unsigned int size = 0;
597  dataLoad(stream, size, nullptr);
598  sizes[dim] = size;
599  }
600 
601  t = torch::empty(sizes, at::kDouble);
602  auto flattened = t.reshape({t.numel()});
603  auto t_accessor = flattened.accessor<Real, 1>();
604  for (int64_t i = 0; i < flattened.numel(); ++i)
605  {
606  Real r = 0;
607  dataLoad(stream, r, context);
608  t_accessor[i] = r;
609  }
610 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ dataLoad() [31/48]

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

Definition at line 681 of file DataIO.C.

682 {
683  p.clear();
684 
685  // First read the size of the map
686  unsigned int size = 0;
687  stream.read((char *)&size, sizeof(size));
688 
689  for (unsigned int i = 0; i < size; i++)
690  {
691  std::string key, type;
692  loadHelper(stream, key, context);
693  loadHelper(stream, type, context);
694 
695 #define loadscalar(ptype) \
696  else if (type == demangle(typeid(ptype).name())) do \
697  { \
698  ptype & value = p.set<ptype>(key); \
699  loadHelper(stream, value, context); \
700  } \
701  while (0)
702 
703  if (false)
704  ;
705  loadscalar(Real);
706  loadscalar(short);
707  loadscalar(int);
708  loadscalar(long);
709  loadscalar(unsigned short);
710  loadscalar(unsigned int);
711  loadscalar(unsigned long);
712 
713 #undef loadscalar
714  }
715 }
virtual void clear()
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057

◆ dataLoad() [32/48]

template<>
void dataLoad ( std::istream &  stream,
Moose::MFEM::SolutionState state,
void context 
)

Definition at line 77 of file SolutionStateData.C.

78 {
79  auto * const data = static_cast<MFEMProblemData *>(context);
80 
81  int num_gridfunctions = 0;
82  dataLoad(stream, num_gridfunctions, context);
83  for (int i = 0; i < num_gridfunctions; ++i)
84  {
85  std::string name;
86  dataLoad(stream, name, context);
87  auto & gf = data->gridfunctions.GetRef(name);
88  loadGridFunction(stream, gf, context);
89  }
90 
91  int num_complex_gridfunctions = 0;
92  dataLoad(stream, num_complex_gridfunctions, context);
93  for (int i = 0; i < num_complex_gridfunctions; ++i)
94  {
95  std::string name;
96  dataLoad(stream, name, context);
97  auto & gf = data->cmplx_gridfunctions.GetRef(name);
98  loadGridFunction(stream, gf.real(), context);
99  loadGridFunction(stream, gf.imag(), context);
100  }
101 }
std::string name(const ElemQuality q)
Base problem data struct.
void dataLoad(std::istream &stream, Moose::MFEM::SolutionState &, void *context)

◆ dataLoad() [33/48]

template<>
void dataLoad ( std::istream &  stream,
std::unique_ptr< libMesh::NumericVector< libMesh::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.

◆ dataLoad() [34/48]

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

Definition at line 865 of file DataIO.h.

866 {
867  for (std::size_t i = 0; i < N; ++i)
868  dataLoad(stream, dn[i], context);
869 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [35/48]

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

Definition at line 873 of file DataIO.h.

874 {
875  for (std::size_t i = 0; i < N; ++i)
876  dataLoad(stream, dn[i], context);
877 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [36/48]

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

Definition at line 881 of file DataIO.h.

882 {
883  numeric_index_type size = v.local_size();
884  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
885  {
886  T r = 0;
887  dataLoad(stream, r, context);
888  v.set(i, r);
889  }
890  v.close();
891 }
dof_id_type numeric_index_type
virtual void close()=0
virtual numeric_index_type first_local_index() const=0
virtual numeric_index_type local_size() const=0
virtual void set(const numeric_index_type i, const T value)=0
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [37/48]

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

Definition at line 768 of file DataIO.C.

769 {
770  PetscInt local_size;
771  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetLocalSize(v, &local_size));
772  PetscScalar * array;
773  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetArray(v, &array));
774  for (PetscInt i = 0; i < local_size; i++)
775  dataLoad(stream, array[i], context);
776 
777  LibmeshPetscCallA(PETSC_COMM_WORLD, VecRestoreArray(v, &array));
778 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396

◆ dataLoad() [38/48]

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

Definition at line 898 of file DataIO.h.

899 {
900  unsigned int n = 0;
901  dataLoad(stream, n, nullptr);
902  v.resize(n);
903  for (unsigned int i = 0; i < n; i++)
904  {
905  T r = 0;
906  dataLoad(stream, r, context);
907  v(i) = r;
908  }
909 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [39/48]

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

Definition at line 615 of file DataIO.C.

616 {
617  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
618  // won't work.
619  for (const auto i : make_range(Moose::dim))
620  for (const auto j : make_range(Moose::dim))
621  {
622  T r = 0;
623  dataLoad(stream, r, context);
624  v(i, j) = r;
625  }
626 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [40/48]

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

Definition at line 633 of file DataIO.C.

634 {
635  unsigned int m = 0, n = 0;
636  stream.read((char *)&m, sizeof(m));
637  stream.read((char *)&n, sizeof(n));
638  v.resize(m, n);
639  for (unsigned int i = 0; i < m; i++)
640  for (unsigned int j = 0; j < n; j++)
641  {
642  T r = 0;
643  dataLoad(stream, r, context);
644  v(i, j) = r;
645  }
646 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396
void resize(const unsigned int new_m, const unsigned int new_n)

◆ dataLoad() [41/48]

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

Definition at line 653 of file DataIO.C.

654 {
655  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
656  // won't work.
657  for (const auto i : make_range(Moose::dim))
658  {
659  T r = 0;
660  dataLoad(stream, r, context);
661  v(i) = r;
662  }
663 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:396
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [42/48]

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

Definition at line 922 of file DataIO.h.

923 {
924  dataLoad(stream, rtt._coords, context);
925 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [43/48]

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

Definition at line 929 of file DataIO.h.

930 {
931  dataLoad(stream, rtt._vals, context);
932 }
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:581

◆ dataLoad() [44/48]

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

Definition at line 936 of file DataIO.h.

937 {
938  dataLoad(stream, rft._vals, context);
939 }
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:581

◆ dataLoad() [45/48]

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

Definition at line 943 of file DataIO.h.

944 {
945  dataLoad(stream, rtt._vals, context);
946 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [46/48]

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

Definition at line 950 of file DataIO.h.

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

◆ dataLoad() [47/48]

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

Definition at line 957 of file DataIO.h.

958 {
959  dataLoad(stream, cmm._values, context);
960 }
std::vector< T > _values
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ dataLoad() [48/48]

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

◆ dataStore() [1/48]

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

Definition at line 196 of file DataIO.h.

Referenced by dataStore(), and storeHelper().

197 {
198 #ifdef LIBMESH_HAVE_CXX11_TYPE_TRAITS
199  static_assert(std::is_polymorphic<T>::value == false,
200  "Cannot serialize a class that has virtual "
201  "members!\nWrite a custom dataStore() "
202  "template specialization!\n\n");
203  static_assert(std::is_trivially_copyable<T>::value,
204  "Cannot serialize a class that is not trivially copyable!\nWrite a custom "
205  "dataStore() template specialization!\n\n");
206 #endif
207 
208  stream.write((char *)&v, sizeof(v));
209  mooseAssert(!stream.bad(), "Failed to store");
210 }

◆ dataStore() [2/48]

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

Definition at line 214 of file DataIO.h.

215 {
216  mooseError("Attempting to store a raw pointer type: \"",
217  libMesh::demangle(typeid(T).name()),
218  " *\" as restartable data!\nWrite a custom dataStore() template specialization!\n\n");
219 }
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:311
std::string demangle(const char *name)

◆ dataStore() [3/48]

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

◆ dataStore() [4/48]

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

Definition at line 225 of file DataIO.h.

226 {
227  storeHelper(stream, p.first, context);
228  storeHelper(stream, p.second, context);
229 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965

◆ dataStore() [5/48]

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

Definition at line 233 of file DataIO.h.

234 {
235  // First store the size of the vector
236  unsigned int size = v.size();
237  dataStore(stream, size, nullptr);
238 
239  for (unsigned int i = 0; i < size; i++)
240  storeHelper(stream, v[i], context);
241 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [6/48]

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

Definition at line 245 of file DataIO.h.

246 {
247  T * tmp = v.get();
248 
249  storeHelper(stream, tmp, context);
250 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965

◆ dataStore() [7/48]

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

Definition at line 254 of file DataIO.h.

255 {
256  T * tmp = v.get();
257 
258  storeHelper(stream, tmp, context);
259 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965

◆ dataStore() [8/48]

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

Definition at line 263 of file DataIO.h.

264 {
265  // First store the size of the set
266  unsigned int size = s.size();
267  dataStore(stream, size, nullptr);
268 
269  typename std::set<T>::iterator it = s.begin();
270  typename std::set<T>::iterator end = s.end();
271 
272  for (; it != end; ++it)
273  {
274  T & x = const_cast<T &>(*it);
275  storeHelper(stream, x, context);
276  }
277 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [9/48]

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

Definition at line 281 of file DataIO.h.

282 {
283  // First store the size of the set
284  unsigned int size = l.size();
285  dataStore(stream, size, nullptr);
286 
287  typename std::list<T>::iterator it = l.begin();
288  typename std::list<T>::iterator end = l.end();
289 
290  for (; it != end; ++it)
291  {
292  T & x = const_cast<T &>(*it);
293  storeHelper(stream, x, context);
294  }
295 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [10/48]

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

Definition at line 299 of file DataIO.h.

300 {
301  // First store the size of the container
302  unsigned int size = l.size();
303  dataStore(stream, size, nullptr);
304 
305  typename std::deque<T>::iterator it = l.begin();
306  typename std::deque<T>::iterator end = l.end();
307 
308  for (; it != end; ++it)
309  {
310  T & x = const_cast<T &>(*it);
311  storeHelper(stream, x, context);
312  }
313 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [11/48]

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

Definition at line 317 of file DataIO.h.

318 {
319  // First store the size of the map
320  unsigned int size = m.size();
321  dataStore(stream, size, nullptr);
322 
323  typename std::map<T, U>::iterator it = m.begin();
324  typename std::map<T, U>::iterator end = m.end();
325 
326  for (; it != end; ++it)
327  {
328  T & key = const_cast<T &>(it->first);
329 
330  storeHelper(stream, key, context);
331 
332  storeHelper(stream, it->second, context);
333  }
334 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [12/48]

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

Definition at line 338 of file DataIO.h.

339 {
340  // First store the size of the map
341  unsigned int size = m.size();
342  dataStore(stream, size, nullptr);
343 
344  typename std::unordered_map<T, U>::iterator it = m.begin();
345  typename std::unordered_map<T, U>::iterator end = m.end();
346 
347  for (; it != end; ++it)
348  {
349  T & key = const_cast<T &>(it->first);
350 
351  storeHelper(stream, key, context);
352 
353  storeHelper(stream, it->second, context);
354  }
355 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [13/48]

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

Definition at line 359 of file DataIO.h.

360 {
361  // First store the size of the set
362  std::size_t size = s.size();
363  dataStore(stream, size, nullptr);
364 
365  for (auto & element : s)
366  dataStore(stream, element, context);
367 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [14/48]

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

Definition at line 371 of file DataIO.h.

372 {
373  bool has_value = m.has_value();
374  dataStore(stream, has_value, nullptr);
375 
376  if (has_value)
377  storeHelper(stream, *m, context);
378 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [15/48]

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

Definition at line 382 of file DataIO.h.

383 {
384  // First store the size of the map
385  unsigned int size = m.size();
386  dataStore(stream, size, nullptr);
387 
388  typename HashMap<T, U>::iterator it = m.begin();
389  typename HashMap<T, U>::iterator end = m.end();
390 
391  for (; it != end; ++it)
392  {
393  T & key = const_cast<T &>(it->first);
394 
395  storeHelper(stream, key, context);
396 
397  storeHelper(stream, it->second, context);
398  }
399 }
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:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [16/48]

template<typename T , int Rows, int Cols>
void dataStore ( std::ostream &  stream,
Eigen::Matrix< T, Rows, Cols > &  v,
void context 
)

Definition at line 403 of file DataIO.h.

404 {
405  auto m = cast_int<unsigned int>(v.rows());
406  dataStore(stream, m, context);
407  auto n = cast_int<unsigned int>(v.cols());
408  dataStore(stream, n, context);
409  for (const auto i : make_range(m))
410  for (const auto j : make_range(n))
411  {
412  auto & r = v(i, j);
413  dataStore(stream, r, context);
414  }
415 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196
IntRange< T > make_range(T beg, T end)

◆ dataStore() [17/48]

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

Definition at line 419 of file DataIO.h.

420 {
421  dataStore(stream, static_cast<Eigen::Matrix<T, 2, 1> &>(v), context);
422 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [18/48]

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

Definition at line 29 of file DataIO.C.

Referenced by dataStore().

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

◆ dataStore() [19/48]

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

Definition at line 36 of file DataIO.C.

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

◆ dataStore() [20/48]

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

Definition at line 48 of file DataIO.C.

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

◆ dataStore() [21/48]

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

Definition at line 56 of file DataIO.C.

57 {
58  auto & name = static_cast<std::string &>(v);
59  dataStore(stream, name, context);
60 }
std::string name(const ElemQuality q)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [22/48]

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

Definition at line 64 of file DataIO.C.

65 {
66  stream.write((char *)&v, sizeof(v));
67 }

◆ dataStore() [23/48]

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

Definition at line 71 of file DataIO.C.

72 {
73  auto order = v.order.get_order();
74  dataStore(stream, order, context);
75 
76  auto family = v.family;
77  dataStore(stream, family, context);
78 
79 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
80  auto radial_order = v.radial_order.get_order();
81  dataStore(stream, radial_order, context);
82 
83  auto radial_family = v.radial_family;
84  dataStore(stream, radial_family, context);
85 
86  auto inf_map = v.inf_map;
87  dataStore(stream, inf_map, context);
88 #endif
89 
90  auto p_refinement = v.p_refinement;
91  dataStore(stream, p_refinement, context);
92 }
OrderWrapper radial_order
OrderWrapper order
InfMapType inf_map
FEFamily radial_family
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [24/48]

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

Definition at line 96 of file DataIO.C.

97 {
98  for (bool b : v)
99  dataStore(stream, b, context);
100 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [25/48]

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

◆ dataStore() [26/48]

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

◆ dataStore() [27/48]

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

◆ dataStore() [28/48]

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

◆ dataStore() [29/48]

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

Definition at line 212 of file DataIO.C.

213 {
214  const std::string & s_str = s.str();
215 
216  size_t s_size = s_str.size();
217  stream.write((char *)&s_size, sizeof(s_size));
218 
219  stream.write(s_str.c_str(), sizeof(char) * (s_str.size()));
220 }

◆ dataStore() [30/48]

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

Definition at line 125 of file DataIO.C.

126 {
127  dataStore(stream, dn.value(), context);
128 
129  if (ADReal::do_derivatives)
130  {
131  auto & derivatives = dn.derivatives();
132  std::size_t size = derivatives.size();
133  dataStore(stream, size, context);
134  for (MooseIndex(size) i = 0; i < size; ++i)
135  {
136  dataStore(stream, derivatives.raw_index(i), context);
137  dataStore(stream, derivatives.raw_at(i), context);
138  }
139  }
140 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [31/48]

template<>
void dataStore ( std::ostream &  stream,
torch::Tensor t,
void context 
)

Definition at line 225 of file DataIO.C.

226 {
227  const auto tensor = LibtorchUtils::toCPUContiguous(t);
228  mooseAssert(tensor.scalar_type() == at::kDouble,
229  "Restart storage currently supports only double tensors.");
230 
231  auto rank = cast_int<unsigned int>(tensor.dim());
232  dataStore(stream, rank, nullptr);
233  for (unsigned int dim = 0; dim < rank; ++dim)
234  {
235  auto size = cast_int<unsigned int>(tensor.sizes()[dim]);
236  dataStore(stream, size, nullptr);
237  }
238 
239  const auto flattened = tensor.reshape({tensor.numel()});
240  const auto t_accessor = flattened.accessor<Real, 1>();
241  for (int64_t i = 0; i < flattened.numel(); ++i)
242  {
243  Real r = t_accessor[i];
244  dataStore(stream, r, context);
245  }
246 }
torch::Tensor toCPUContiguous(const torch::Tensor &tensor)
Return a detached contiguous CPU copy of a tensor.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [32/48]

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

Definition at line 311 of file DataIO.C.

312 {
313  // First store the size of the map
314  unsigned int size = p.n_parameters();
315  stream.write((char *)&size, sizeof(size));
316 
317  auto it = p.begin();
318  auto end = p.end();
319 
320  for (; it != end; ++it)
321  {
322  auto & key = const_cast<std::string &>(it->first);
323  auto type = it->second->type();
324 
325  storeHelper(stream, key, context);
326  storeHelper(stream, type, context);
327 
328 #define storescalar(ptype) \
329  else if (it->second->type() == demangle(typeid(ptype).name())) storeHelper( \
330  stream, \
331  (dynamic_cast<libMesh::Parameters::Parameter<ptype> *>(MooseUtils::get(it->second)))->get(), \
332  context)
333 
334  if (false)
335  ;
336  storescalar(Real);
337  storescalar(short);
338  storescalar(int);
339  storescalar(long);
340  storescalar(unsigned short);
341  storescalar(unsigned int);
342  storescalar(unsigned long);
343 
344 #undef storescalar
345  }
346 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:965
std::size_t n_parameters() const

◆ dataStore() [33/48]

template<>
void dataStore ( std::ostream &  stream,
Moose::MFEM::SolutionState state,
void context 
)

Definition at line 51 of file SolutionStateData.C.

52 {
53  auto * const data = static_cast<MFEMProblemData *>(context);
54 
55  auto num_gridfunctions = data->gridfunctions.size();
56  dataStore(stream, num_gridfunctions, context);
57  for (const auto & [name, gridfunction] : data->gridfunctions)
58  {
59  auto stored_name = name;
60  dataStore(stream, stored_name, context);
61  storeGridFunction(stream, *gridfunction, context);
62  }
63 
64  auto num_complex_gridfunctions = data->cmplx_gridfunctions.size();
65  dataStore(stream, num_complex_gridfunctions, context);
66  for (const auto & [name, gridfunction] : data->cmplx_gridfunctions)
67  {
68  auto stored_name = name;
69  dataStore(stream, stored_name, context);
70  storeGridFunction(stream, gridfunction->real(), context);
71  storeGridFunction(stream, gridfunction->imag(), context);
72  }
73 }
std::string name(const ElemQuality q)
Base problem data struct.
void dataStore(std::ostream &stream, Moose::MFEM::SolutionState &, void *context)
int size()
Returns the number of elements in the map.
Moose::MFEM::GridFunctions gridfunctions

◆ dataStore() [34/48]

template<>
void dataStore ( std::ostream &  stream,
std::unique_ptr< libMesh::NumericVector< libMesh::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.

◆ dataStore() [35/48]

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

Definition at line 481 of file DataIO.h.

482 {
483  for (std::size_t i = 0; i < N; ++i)
484  dataStore(stream, dn[i], context);
485 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [36/48]

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

Definition at line 489 of file DataIO.h.

490 {
491  for (std::size_t i = 0; i < N; ++i)
492  dataStore(stream, dn[i], context);
493 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [37/48]

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

Definition at line 497 of file DataIO.h.

498 {
499  v.close();
500 
501  numeric_index_type size = v.local_size();
502 
503  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
504  {
505  T r = v(i);
506  dataStore(stream, r, context);
507  }
508 }
dof_id_type numeric_index_type
virtual void close()=0
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196
virtual numeric_index_type first_local_index() const=0
virtual numeric_index_type local_size() const=0

◆ dataStore() [38/48]

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

Definition at line 782 of file DataIO.C.

783 {
784  PetscInt local_size;
785  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetLocalSize(v, &local_size));
786  PetscScalar * array;
787  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetArray(v, &array));
788  for (PetscInt i = 0; i < local_size; i++)
789  dataStore(stream, array[i], context);
790 
791  LibmeshPetscCallA(PETSC_COMM_WORLD, VecRestoreArray(v, &array));
792 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [39/48]

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

Definition at line 515 of file DataIO.h.

516 {
517  unsigned int m = v.size();
518  dataStore(stream, m, nullptr);
519  for (unsigned int i = 0; i < v.size(); i++)
520  {
521  T r = v(i);
522  dataStore(stream, r, context);
523  }
524 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [40/48]

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

Definition at line 251 of file DataIO.C.

252 {
253  for (const auto i : make_range(Moose::dim))
254  for (const auto j : make_range(Moose::dim))
255  {
256  T r = v(i, j);
257  dataStore(stream, r, context);
258  }
259 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
IntRange< T > make_range(T beg, T end)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [41/48]

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

Definition at line 266 of file DataIO.C.

267 {
268  unsigned int m = v.m();
269  unsigned int n = v.n();
270  stream.write((char *)&m, sizeof(m));
271  stream.write((char *)&n, sizeof(n));
272  for (unsigned int i = 0; i < m; i++)
273  for (unsigned int j = 0; j < n; j++)
274  {
275  T r = v(i, j);
276  dataStore(stream, r, context);
277  }
278 }
unsigned int m() const
unsigned int n() const
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [42/48]

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

Definition at line 285 of file DataIO.C.

286 {
287  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
288  // won't work.
289  for (const auto i : make_range(Moose::dim))
290  {
291  T r = v(i);
292  dataStore(stream, r, context);
293  }
294 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:165
IntRange< T > make_range(T beg, T end)
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [43/48]

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

Definition at line 537 of file DataIO.h.

538 {
539  dataStore(stream, rtt._coords, context);
540 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [44/48]

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

Definition at line 544 of file DataIO.h.

545 {
546  dataStore(stream, rtt._vals, context);
547 }
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:196

◆ dataStore() [45/48]

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

Definition at line 551 of file DataIO.h.

552 {
553  dataStore(stream, rft._vals, context);
554 }
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:196

◆ dataStore() [46/48]

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

Definition at line 558 of file DataIO.h.

559 {
560  dataStore(stream, srtt._vals, context);
561 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ dataStore() [47/48]

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

Definition at line 565 of file DataIO.h.

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

◆ dataStore() [48/48]

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

Definition at line 572 of file DataIO.h.

573 {
574  dataStore(stream, cmm._values, context);
575 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196
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 1057 of file DataIO.h.

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

1058 {
1059  dataLoad(stream, data, context);
1060 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ loadHelper() [2/10]

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

Vector helper routine.

Definition at line 1065 of file DataIO.h.

1066 {
1067  dataLoad(stream, data, context);
1068 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1073 of file DataIO.h.

1074 {
1075  dataLoad(stream, data, context);
1076 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1081 of file DataIO.h.

1082 {
1083  dataLoad(stream, data, context);
1084 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ loadHelper() [5/10]

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

Set helper routine.

Definition at line 1089 of file DataIO.h.

1090 {
1091  dataLoad(stream, data, context);
1092 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1097 of file DataIO.h.

1098 {
1099  dataLoad(stream, data, context);
1100 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1105 of file DataIO.h.

1106 {
1107  dataLoad(stream, data, context);
1108 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ loadHelper() [8/10]

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

Optional helper routine.

Definition at line 1113 of file DataIO.h.

1114 {
1115  dataLoad(stream, data, context);
1116 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1121 of file DataIO.h.

1122 {
1123  dataLoad(stream, data, context);
1124 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:581

◆ 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 1135 of file DataIO.h.

1136 {
1137  std::size_t size;
1138  dataLoad(stream, size, nullptr);
1139  data.resize(size);
1140 
1141  for (const auto i : index_range(data))
1142  loadHelper(stream, data.pointerValue(i), context);
1143 }
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:581
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1057
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 965 of file DataIO.h.

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

966 {
967  dataStore(stream, data, context);
968 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ storeHelper() [2/10]

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

Vector helper routine.

Definition at line 973 of file DataIO.h.

974 {
975  dataStore(stream, data, context);
976 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 981 of file DataIO.h.

982 {
983  dataStore(stream, data, context);
984 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 989 of file DataIO.h.

990 {
991  dataStore(stream, data, context);
992 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ storeHelper() [5/10]

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

Set helper routine.

Definition at line 997 of file DataIO.h.

998 {
999  dataStore(stream, data, context);
1000 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 1005 of file DataIO.h.

1006 {
1007  dataStore(stream, data, context);
1008 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 1013 of file DataIO.h.

1014 {
1015  dataStore(stream, data, context);
1016 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ storeHelper() [8/10]

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

Optional helper routine.

Definition at line 1021 of file DataIO.h.

1022 {
1023  dataStore(stream, data, context);
1024 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 1029 of file DataIO.h.

1030 {
1031  dataStore(stream, data, context);
1032 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196

◆ 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 1042 of file DataIO.h.

1043 {
1044  std::size_t size = data.size();
1045  dataStore(stream, size, nullptr);
1046 
1047  for (const auto i : index_range(data))
1048  {
1049  mooseAssert(data.hasValue(i), "Data doesn't have a value");
1050  storeHelper(stream, data.pointerValue(i), context);
1051  }
1052 }
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:965
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:196
bool hasValue(const std::size_t i) const
auto index_range(const T &sizable)