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 >
 
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::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, libMesh::Parameters &p, 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, libMesh::Parameters &p, 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/46]

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

Definition at line 562 of file DataIO.h.

Referenced by dataLoad(), and loadHelper().

563 {
564  stream.read((char *)&v, sizeof(v));
565  mooseAssert(!stream.bad(), "Failed to load");
566 }

◆ dataLoad() [2/46]

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

Definition at line 570 of file DataIO.h.

571 {
572  mooseError("Attempting to load a raw pointer type: \"",
573  libMesh::demangle(typeid(T).name()),
574  " *\" as restartable data!\nWrite a custom dataLoad() template specialization!\n\n");
575 }
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/46]

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

Definition at line 579 of file DataIO.h.

580 {
581  loadHelper(stream, p.first, context);
582  loadHelper(stream, p.second, context);
583 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [4/46]

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

Definition at line 587 of file DataIO.h.

588 {
589  // First read the size of the vector
590  unsigned int size = 0;
591  dataLoad(stream, size, nullptr);
592 
593  v.resize(size);
594 
595  for (unsigned int i = 0; i < size; i++)
596  loadHelper(stream, v[i], context);
597 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [5/46]

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

Definition at line 601 of file DataIO.h.

602 {
603  T * tmp = v.get();
604 
605  loadHelper(stream, tmp, context);
606 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [6/46]

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

Definition at line 610 of file DataIO.h.

611 {
612  T * tmp = v.get();
613 
614  loadHelper(stream, tmp, context);
615 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [7/46]

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

Definition at line 619 of file DataIO.h.

620 {
621  // First read the size of the set
622  unsigned int size = 0;
623  dataLoad(stream, size, nullptr);
624 
625  for (unsigned int i = 0; i < size; i++)
626  {
627  T data;
628  loadHelper(stream, data, context);
629  s.insert(std::move(data));
630  }
631 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [8/46]

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

Definition at line 635 of file DataIO.h.

636 {
637  // First read the size of the set
638  unsigned int size = 0;
639  dataLoad(stream, size, nullptr);
640 
641  for (unsigned int i = 0; i < size; i++)
642  {
643  T data;
644  loadHelper(stream, data, context);
645  l.push_back(std::move(data));
646  }
647 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [9/46]

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

Definition at line 651 of file DataIO.h.

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

◆ dataLoad() [10/46]

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

Definition at line 667 of file DataIO.h.

668 {
669  m.clear();
670 
671  // First read the size of the map
672  unsigned int size = 0;
673  dataLoad(stream, size, nullptr);
674 
675  for (unsigned int i = 0; i < size; i++)
676  {
677  T key;
678  loadHelper(stream, key, context);
679 
680  U & value = m[key];
681  loadHelper(stream, value, context);
682  }
683 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [11/46]

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

Definition at line 687 of file DataIO.h.

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

◆ dataLoad() [12/46]

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

Definition at line 707 of file DataIO.h.

708 {
709  s.clear();
710 
711  // First read the size of the set
712  std::size_t size = 0;
713  dataLoad(stream, size, nullptr);
714  s.reserve(size);
715 
716  for (std::size_t i = 0; i < size; i++)
717  {
718  T element;
719  dataLoad(stream, element, context);
720  s.insert(element);
721  }
722 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [13/46]

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

Definition at line 726 of file DataIO.h.

727 {
728  bool has_value;
729  dataLoad(stream, has_value, nullptr);
730 
731  if (has_value)
732  {
733  m = T{};
734  loadHelper(stream, *m, context);
735  }
736  else
737  m.reset();
738 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [14/46]

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

Definition at line 742 of file DataIO.h.

743 {
744  // First read the size of the map
745  unsigned int size = 0;
746  dataLoad(stream, size, nullptr);
747 
748  for (unsigned int i = 0; i < size; i++)
749  {
750  T key;
751  loadHelper(stream, key, context);
752 
753  U & value = m[key];
754  loadHelper(stream, value, context);
755  }
756 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030

◆ dataLoad() [15/46]

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

Definition at line 760 of file DataIO.h.

761 {
762  unsigned int m = 0;
763  dataLoad(stream, m, context);
764  unsigned int n = 0;
765  dataLoad(stream, n, context);
766  v.resize(m, n);
767  for (const auto i : make_range(m))
768  for (const auto j : make_range(n))
769  {
770  T r{};
771  dataLoad(stream, r, context);
772  v(i, j) = r;
773  }
774 }
IntRange< T > make_range(T beg, T end)
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [16/46]

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

Definition at line 778 of file DataIO.h.

779 {
780  dataLoad(stream, static_cast<Eigen::Matrix<T, 2, 1> &>(v), context);
781 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [17/46]

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

Definition at line 369 of file DataIO.C.

Referenced by dataLoad().

370 {
371  stream.read((char *)&v, sizeof(v));
372 }

◆ dataLoad() [18/46]

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

Definition at line 376 of file DataIO.C.

377 {
378  // Read the size of the string
379  unsigned int size = 0;
380  stream.read((char *)&size, sizeof(size));
381 
382  // Resize the string data
383  v.resize(size);
384 
385  // Read the string
386  stream.read(&v[0], sizeof(char) * size);
387 }

◆ dataLoad() [19/46]

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

Definition at line 391 of file DataIO.C.

392 {
393  auto & name = static_cast<std::string &>(v);
394  dataLoad(stream, name, context);
395 }
std::string name(const ElemQuality q)
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369

◆ dataLoad() [20/46]

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

Definition at line 399 of file DataIO.C.

400 {
401  auto & name = static_cast<std::string &>(v);
402  dataLoad(stream, name, context);
403 }
std::string name(const ElemQuality q)
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369

◆ dataLoad() [21/46]

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

Definition at line 407 of file DataIO.C.

408 {
409  stream.read((char *)&v, sizeof(v));
410 }

◆ dataLoad() [22/46]

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

Definition at line 414 of file DataIO.C.

415 {
416  int order = 0;
417  dataLoad(stream, order, context);
418  v.order = order;
419 
420  dataLoad(stream, v.family, context);
421 
422 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
423  int radial_order = 0;
424  dataLoad(stream, radial_order, context);
425  v.radial_order = radial_order;
426 
427  dataLoad(stream, v.radial_family, context);
428  dataLoad(stream, v.inf_map, context);
429 #endif
430 
431  dataLoad(stream, v.p_refinement, context);
432 }
OrderWrapper radial_order
OrderWrapper order
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369
InfMapType inf_map
FEFamily radial_family

◆ dataLoad() [23/46]

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

Definition at line 436 of file DataIO.C.

437 {
438  for (bool b : v)
439  dataLoad(stream, b, context);
440 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369

◆ dataLoad() [24/46]

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

◆ dataLoad() [25/46]

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

◆ dataLoad() [26/46]

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

◆ dataLoad() [27/46]

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

◆ dataLoad() [28/46]

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

Definition at line 545 of file DataIO.C.

546 {
547  size_t s_size = 0;
548  stream.read((char *)&s_size, sizeof(s_size));
549 
550  std::unique_ptr<char[]> s_s = std::make_unique<char[]>(s_size);
551  stream.read(s_s.get(), s_size);
552 
553  // Clear the stringstream before loading new data into it.
554  s.str(std::string());
555  s.write(s_s.get(), s_size);
556 }

◆ dataLoad() [29/46]

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

Definition at line 444 of file DataIO.C.

445 {
446  dataLoad(stream, dn.value(), context);
447 
448  if (ADReal::do_derivatives)
449  {
450  auto & derivatives = dn.derivatives();
451  std::size_t size = 0;
452  stream.read((char *)&size, sizeof(size));
453  derivatives.resize(size);
454 
455  for (MooseIndex(derivatives) i = 0; i < derivatives.size(); ++i)
456  {
457  dataLoad(stream, derivatives.raw_index(i), context);
458  dataLoad(stream, derivatives.raw_at(i), context);
459  }
460  }
461 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369

◆ dataLoad() [30/46]

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

Definition at line 626 of file DataIO.C.

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

◆ dataLoad() [31/46]

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() [32/46]

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

Definition at line 838 of file DataIO.h.

839 {
840  for (std::size_t i = 0; i < N; ++i)
841  dataLoad(stream, dn[i], context);
842 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [33/46]

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

Definition at line 846 of file DataIO.h.

847 {
848  for (std::size_t i = 0; i < N; ++i)
849  dataLoad(stream, dn[i], context);
850 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [34/46]

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

Definition at line 854 of file DataIO.h.

855 {
856  numeric_index_type size = v.local_size();
857  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
858  {
859  T r = 0;
860  dataLoad(stream, r, context);
861  v.set(i, r);
862  }
863  v.close();
864 }
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:562

◆ dataLoad() [35/46]

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

Definition at line 713 of file DataIO.C.

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

◆ dataLoad() [36/46]

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

Definition at line 871 of file DataIO.h.

872 {
873  unsigned int n = 0;
874  dataLoad(stream, n, nullptr);
875  v.resize(n);
876  for (unsigned int i = 0; i < n; i++)
877  {
878  T r = 0;
879  dataLoad(stream, r, context);
880  v(i) = r;
881  }
882 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [37/46]

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

Definition at line 560 of file DataIO.C.

561 {
562  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
563  // won't work.
564  for (const auto i : make_range(Moose::dim))
565  for (const auto j : make_range(Moose::dim))
566  {
567  T r = 0;
568  dataLoad(stream, r, context);
569  v(i, j) = r;
570  }
571 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [38/46]

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

Definition at line 578 of file DataIO.C.

579 {
580  unsigned int m = 0, n = 0;
581  stream.read((char *)&m, sizeof(m));
582  stream.read((char *)&n, sizeof(n));
583  v.resize(m, n);
584  for (unsigned int i = 0; i < m; i++)
585  for (unsigned int j = 0; j < n; j++)
586  {
587  T r = 0;
588  dataLoad(stream, r, context);
589  v(i, j) = r;
590  }
591 }
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369
void resize(const unsigned int new_m, const unsigned int new_n)

◆ dataLoad() [39/46]

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

Definition at line 598 of file DataIO.C.

599 {
600  // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
601  // won't work.
602  for (const auto i : make_range(Moose::dim))
603  {
604  T r = 0;
605  dataLoad(stream, r, context);
606  v(i) = r;
607  }
608 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
void dataLoad(std::istream &stream, Real &v, void *)
Definition: DataIO.C:369
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [40/46]

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

Definition at line 895 of file DataIO.h.

896 {
897  dataLoad(stream, rtt._coords, context);
898 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [41/46]

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

Definition at line 902 of file DataIO.h.

903 {
904  dataLoad(stream, rtt._vals, context);
905 }
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:562

◆ dataLoad() [42/46]

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

Definition at line 909 of file DataIO.h.

910 {
911  dataLoad(stream, rft._vals, context);
912 }
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:562

◆ dataLoad() [43/46]

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

Definition at line 916 of file DataIO.h.

917 {
918  dataLoad(stream, rtt._vals, context);
919 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [44/46]

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

Definition at line 923 of file DataIO.h.

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

◆ dataLoad() [45/46]

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

Definition at line 930 of file DataIO.h.

931 {
932  dataLoad(stream, cmm._values, context);
933 }
std::vector< T > _values
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ dataLoad() [46/46]

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

◆ dataStore() [1/46]

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

Definition at line 185 of file DataIO.h.

Referenced by dataStore(), and storeHelper().

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

◆ dataStore() [2/46]

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

Definition at line 203 of file DataIO.h.

204 {
205  mooseError("Attempting to store a raw pointer type: \"",
206  libMesh::demangle(typeid(T).name()),
207  " *\" as restartable data!\nWrite a custom dataStore() template specialization!\n\n");
208 }
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/46]

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

◆ dataStore() [4/46]

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

Definition at line 214 of file DataIO.h.

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

◆ dataStore() [5/46]

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

Definition at line 222 of file DataIO.h.

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

◆ dataStore() [6/46]

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

Definition at line 234 of file DataIO.h.

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

◆ dataStore() [7/46]

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

Definition at line 243 of file DataIO.h.

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

◆ dataStore() [8/46]

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

Definition at line 252 of file DataIO.h.

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

◆ dataStore() [9/46]

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

Definition at line 270 of file DataIO.h.

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

◆ dataStore() [10/46]

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

Definition at line 288 of file DataIO.h.

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

◆ dataStore() [11/46]

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

Definition at line 306 of file DataIO.h.

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

◆ dataStore() [12/46]

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

Definition at line 327 of file DataIO.h.

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

◆ dataStore() [13/46]

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

Definition at line 348 of file DataIO.h.

349 {
350  // First store the size of the set
351  std::size_t size = s.size();
352  dataStore(stream, size, nullptr);
353 
354  for (auto & element : s)
355  dataStore(stream, element, context);
356 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [14/46]

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

Definition at line 360 of file DataIO.h.

361 {
362  bool has_value = m.has_value();
363  dataStore(stream, has_value, nullptr);
364 
365  if (has_value)
366  storeHelper(stream, *m, context);
367 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:938
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [15/46]

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

Definition at line 371 of file DataIO.h.

372 {
373  // First store the size of the map
374  unsigned int size = m.size();
375  dataStore(stream, size, nullptr);
376 
377  typename HashMap<T, U>::iterator it = m.begin();
378  typename HashMap<T, U>::iterator end = m.end();
379 
380  for (; it != end; ++it)
381  {
382  T & key = const_cast<T &>(it->first);
383 
384  storeHelper(stream, key, context);
385 
386  storeHelper(stream, it->second, context);
387  }
388 }
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:938
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [16/46]

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

Definition at line 392 of file DataIO.h.

393 {
394  auto m = cast_int<unsigned int>(v.rows());
395  dataStore(stream, m, context);
396  auto n = cast_int<unsigned int>(v.cols());
397  dataStore(stream, n, context);
398  for (const auto i : make_range(m))
399  for (const auto j : make_range(n))
400  {
401  auto & r = v(i, j);
402  dataStore(stream, r, context);
403  }
404 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185
IntRange< T > make_range(T beg, T end)

◆ dataStore() [17/46]

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

Definition at line 408 of file DataIO.h.

409 {
410  dataStore(stream, static_cast<Eigen::Matrix<T, 2, 1> &>(v), context);
411 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [18/46]

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/46]

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/46]

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/46]

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/46]

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/46]

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/46]

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/46]

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

◆ dataStore() [26/46]

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

◆ dataStore() [27/46]

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

◆ dataStore() [28/46]

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

◆ dataStore() [29/46]

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/46]

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/46]

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

Definition at line 284 of file DataIO.C.

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

◆ dataStore() [32/46]

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() [33/46]

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

Definition at line 462 of file DataIO.h.

463 {
464  for (std::size_t i = 0; i < N; ++i)
465  dataStore(stream, dn[i], context);
466 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [34/46]

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

Definition at line 470 of file DataIO.h.

471 {
472  for (std::size_t i = 0; i < N; ++i)
473  dataStore(stream, dn[i], context);
474 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [35/46]

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

Definition at line 478 of file DataIO.h.

479 {
480  v.close();
481 
482  numeric_index_type size = v.local_size();
483 
484  for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
485  {
486  T r = v(i);
487  dataStore(stream, r, context);
488  }
489 }
dof_id_type numeric_index_type
virtual void close()=0
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185
virtual numeric_index_type first_local_index() const=0
virtual numeric_index_type local_size() const=0

◆ dataStore() [36/46]

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

Definition at line 727 of file DataIO.C.

728 {
729  PetscInt local_size;
730  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetLocalSize(v, &local_size));
731  PetscScalar * array;
732  LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetArray(v, &array));
733  for (PetscInt i = 0; i < local_size; i++)
734  dataStore(stream, array[i], context);
735 
736  LibmeshPetscCallA(PETSC_COMM_WORLD, VecRestoreArray(v, &array));
737 }
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [37/46]

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

Definition at line 496 of file DataIO.h.

497 {
498  unsigned int m = v.size();
499  dataStore(stream, m, nullptr);
500  for (unsigned int i = 0; i < v.size(); i++)
501  {
502  T r = v(i);
503  dataStore(stream, r, context);
504  }
505 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [38/46]

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

Definition at line 224 of file DataIO.C.

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

◆ dataStore() [39/46]

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

Definition at line 239 of file DataIO.C.

240 {
241  unsigned int m = v.m();
242  unsigned int n = v.n();
243  stream.write((char *)&m, sizeof(m));
244  stream.write((char *)&n, sizeof(n));
245  for (unsigned int i = 0; i < m; i++)
246  for (unsigned int j = 0; j < n; j++)
247  {
248  T r = v(i, j);
249  dataStore(stream, r, context);
250  }
251 }
unsigned int m() const
unsigned int n() const
void dataStore(std::ostream &stream, Real &v, void *)
Definition: DataIO.C:29

◆ dataStore() [40/46]

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

Definition at line 258 of file DataIO.C.

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

◆ dataStore() [41/46]

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

Definition at line 518 of file DataIO.h.

519 {
520  dataStore(stream, rtt._coords, context);
521 }
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [42/46]

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

Definition at line 525 of file DataIO.h.

526 {
527  dataStore(stream, rtt._vals, context);
528 }
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:185

◆ dataStore() [43/46]

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

Definition at line 532 of file DataIO.h.

533 {
534  dataStore(stream, rft._vals, context);
535 }
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:185

◆ dataStore() [44/46]

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

Definition at line 539 of file DataIO.h.

540 {
541  dataStore(stream, srtt._vals, context);
542 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ dataStore() [45/46]

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

Definition at line 546 of file DataIO.h.

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

◆ dataStore() [46/46]

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

Definition at line 553 of file DataIO.h.

554 {
555  dataStore(stream, cmm._values, context);
556 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185
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 1030 of file DataIO.h.

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

1031 {
1032  dataLoad(stream, data, context);
1033 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ loadHelper() [2/10]

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

Vector helper routine.

Definition at line 1038 of file DataIO.h.

1039 {
1040  dataLoad(stream, data, context);
1041 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1047 {
1048  dataLoad(stream, data, context);
1049 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1055 {
1056  dataLoad(stream, data, context);
1057 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ loadHelper() [5/10]

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

Set helper routine.

Definition at line 1062 of file DataIO.h.

1063 {
1064  dataLoad(stream, data, context);
1065 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1071 {
1072  dataLoad(stream, data, context);
1073 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1079 {
1080  dataLoad(stream, data, context);
1081 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

◆ loadHelper() [8/10]

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

Optional helper routine.

Definition at line 1086 of file DataIO.h.

1087 {
1088  dataLoad(stream, data, context);
1089 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1095 {
1096  dataLoad(stream, data, context);
1097 }
void dataLoad(std::istream &stream, T &v, void *)
Definition: DataIO.h:562

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

1109 {
1110  std::size_t size;
1111  dataLoad(stream, size, nullptr);
1112  data.resize(size);
1113 
1114  for (const auto i : index_range(data))
1115  loadHelper(stream, data.pointerValue(i), context);
1116 }
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:562
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:1030
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 938 of file DataIO.h.

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

939 {
940  dataStore(stream, data, context);
941 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ storeHelper() [2/10]

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

Vector helper routine.

Definition at line 946 of file DataIO.h.

947 {
948  dataStore(stream, data, context);
949 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

955 {
956  dataStore(stream, data, context);
957 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

963 {
964  dataStore(stream, data, context);
965 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ storeHelper() [5/10]

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

Set helper routine.

Definition at line 970 of file DataIO.h.

971 {
972  dataStore(stream, data, context);
973 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

979 {
980  dataStore(stream, data, context);
981 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

987 {
988  dataStore(stream, data, context);
989 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

◆ storeHelper() [8/10]

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

Optional helper routine.

Definition at line 994 of file DataIO.h.

995 {
996  dataStore(stream, data, context);
997 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

1003 {
1004  dataStore(stream, data, context);
1005 }
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185

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

1016 {
1017  std::size_t size = data.size();
1018  dataStore(stream, size, nullptr);
1019 
1020  for (const auto i : index_range(data))
1021  {
1022  mooseAssert(data.hasValue(i), "Data doesn't have a value");
1023  storeHelper(stream, data.pointerValue(i), context);
1024  }
1025 }
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:938
void dataStore(std::ostream &stream, T &v, void *)
Definition: DataIO.h:185
bool hasValue(const std::size_t i) const
auto index_range(const T &sizable)