https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
DataIO.h File Reference

Go to the source code of this file.

Classes

struct  Moose::MFEM::SolutionState
 
class  libMesh::Parallel::Packing< std::basic_string< T > >
 

Namespaces

namespace  libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 
namespace  Moose
 MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to address this in their environment if C++17 compatibility isn't found.
 
namespace  Moose::MFEM
 Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
 
namespace  moose
 
namespace  moose::internal
 
namespace  libMesh::Parallel
 

Functions

template<typename T >
void dataStore (std::ostream &stream, T &v, void *)
 
template<typename T >
void moose::internal::dataStoreSizeof (std::ostream &stream, T &v)
 
template<>
dataStoreSizeofSpecialization(bool) dataStoreSizeofSpecialization(char) dataStoreSizeofSpecialization(signed char) dataStoreSizeofSpecialization(short int) dataStoreSizeofSpecialization(int) dataStoreSizeofSpecialization(long int) dataStoreSizeofSpecialization(long long int) dataStoreSizeofSpecialization(unsigned char) dataStoreSizeofSpecialization(short unsigned int) dataStoreSizeofSpecialization(unsigned int) dataStoreSizeofSpecialization(long unsigned int) dataStoreSizeofSpecialization(long long unsigned int) dataStoreSizeofSpecialization(float) dataStoreSizeofSpecialization(double) dataStoreSizeofSpecialization(long double) dataStoreEnum(libMesh void dataStore (std::ostream &stream, libMesh::Point &p, void *context)
 
template<>
void dataStore (std::ostream &stream, const libMesh::Point &p, 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, libMesh::FEType &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<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<>
void dataStore (std::ostream &stream, std::unique_ptr< libMesh::NumericVector< libMesh::Number > > &v, void *context)
 Stores an owned numeric vector.
 
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::DenseVector< 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, std::vector< 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 , std::size_t N>
void dataStore (std::ostream &stream, std::array< T, N > &arr, 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 &, T *&, void *)
 
void dataStore (std::ostream &stream, libMesh::BoundingBox &p, void *context)
 
template<typename T , typename U >
void dataStore (std::ostream &stream, std::pair< T, U > &p, void *context)
 
void dataStore (std::ostream &ostream, std::vector< bool > &v, void *ctx)
 
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 >
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, 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.
 
template<typename T , std::size_t N>
void dataStore (std::ostream &stream, T(&arr)[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, 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 dataStore (std::ostream &stream, UniqueStorage< T > &data, void *context)
 UniqueStorage helper routine.
 
template<typename T >
void dataLoad (std::istream &, T &, void *)
 
template<typename T >
void moose::internal::dataLoadSizeof (std::istream &stream, T &v)
 
template<>
dataLoadSizeofSpecialization(bool) dataLoadSizeofSpecialization(char) dataLoadSizeofSpecialization(signed char) dataLoadSizeofSpecialization(short int) dataLoadSizeofSpecialization(int) dataLoadSizeofSpecialization(long int) dataLoadSizeofSpecialization(long long int) dataLoadSizeofSpecialization(unsigned char) dataLoadSizeofSpecialization(short unsigned int) dataLoadSizeofSpecialization(unsigned int) dataLoadSizeofSpecialization(long unsigned int) dataLoadSizeofSpecialization(long long unsigned int) dataLoadSizeofSpecialization(float) dataLoadSizeofSpecialization(double) dataLoadSizeofSpecialization(long double) dataLoadEnum(libMesh 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, libMesh::FEType &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, libMesh::Point &p, 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<>
void dataLoad (std::istream &stream, std::unique_ptr< libMesh::NumericVector< libMesh::Number > > &v, void *context)
 Loads an owned numeric vector.
 
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::DenseVector< 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, std::vector< 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 , std::size_t N>
void dataLoad (std::istream &stream, std::array< T, N > &arr, 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 &, T *&, void *)
 
template<typename T , typename U >
void dataLoad (std::istream &stream, std::pair< T, U > &p, void *context)
 
void dataLoad (std::istream &stream, std::vector< bool > &v, 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 >
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, 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.
 
template<typename T , std::size_t N>
void dataLoad (std::istream &stream, T(&arr)[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, 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)
 
template<typename T >
void dataLoad (std::istream &stream, UniqueStorage< T > &data, void *context)
 UniqueStorage Helper Function.
 
void dataLoad (std::istream &stream, libMesh::BoundingBox &p, void *context)
 

Function Documentation

◆ dataLoad() [1/63]

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

Definition at line 627 of file DataIO.h.

628{
629 static_assert(sizeof(T) == 0, "Must write dataLoad specialization");
630}

Referenced by dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), and dataLoad().

◆ dataLoad() [2/63]

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

Definition at line 793 of file DataIO.h.

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

◆ dataLoad() [3/63]

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

Definition at line 457 of file DataIO.C.

458{
459 dataLoad(stream, dn.value(), context);
460
461 if (ADReal::do_derivatives)
462 {
463 auto & derivatives = dn.derivatives();
464 std::size_t size = 0;
465 stream.read((char *)&size, sizeof(size));
466 derivatives.resize(size);
467
468 for (MooseIndex(derivatives) i = 0; i < derivatives.size(); ++i)
469 {
470 dataLoad(stream, derivatives.raw_index(i), context);
471 dataLoad(stream, derivatives.raw_at(i), context);
472 }
473 }
474}
void dataLoad(std::istream &stream, std::string &v, void *)
Definition DataIO.C:404

◆ dataLoad() [4/63]

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

Definition at line 457 of file DataIO.C.

458{
459 dataLoad(stream, dn.value(), context);
460
461 if (ADReal::do_derivatives)
462 {
463 auto & derivatives = dn.derivatives();
464 std::size_t size = 0;
465 stream.read((char *)&size, sizeof(size));
466 derivatives.resize(size);
467
468 for (MooseIndex(derivatives) i = 0; i < derivatives.size(); ++i)
469 {
470 dataLoad(stream, derivatives.raw_index(i), context);
471 dataLoad(stream, derivatives.raw_at(i), context);
472 }
473 }
474}

◆ dataLoad() [5/63]

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

◆ dataLoad() [6/63]

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

Definition at line 1168 of file DataIO.h.

1169{
1170 dataLoad(stream, cmm._values, context);
1171}
void dataLoad(std::istream &, T &, void *)
Definition DataIO.h:627

◆ dataLoad() [7/63]

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

Definition at line 478 of file DataIO.C.

479{
480 if (!context)
481 mooseError("Can only load Elem objects using a MooseMesh context!");
482
483 MooseMesh * mesh = static_cast<MooseMesh *>(context);
484
485 // TODO: Write out the unique ID of this element
487
488 dataLoad(stream, id, context);
489
491 e = mesh->elemPtr(id);
492 else
493 e = NULL;
494}
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
static constexpr dof_id_type invalid_id
MeshBase & mesh
uint8_t dof_id_type

◆ dataLoad() [8/63]

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

Definition at line 478 of file DataIO.C.

479{
480 if (!context)
481 mooseError("Can only load Elem objects using a MooseMesh context!");
482
483 MooseMesh * mesh = static_cast<MooseMesh *>(context);
484
485 // TODO: Write out the unique ID of this element
487
488 dataLoad(stream, id, context);
489
491 e = mesh->elemPtr(id);
492 else
493 e = NULL;
494}

◆ dataLoad() [9/63]

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

Definition at line 498 of file DataIO.C.

499{
500 if (!context)
501 mooseError("Can only load Node objects using a MooseMesh context!");
502
503 MooseMesh * mesh = static_cast<MooseMesh *>(context);
504
505 // TODO: Write out the unique ID of this nodeent
507
508 dataLoad(stream, id, context);
509
511 n = mesh->nodePtr(id);
512 else
513 n = NULL;
514}

◆ dataLoad() [10/63]

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

Definition at line 498 of file DataIO.C.

499{
500 if (!context)
501 mooseError("Can only load Node objects using a MooseMesh context!");
502
503 MooseMesh * mesh = static_cast<MooseMesh *>(context);
504
505 // TODO: Write out the unique ID of this nodeent
507
508 dataLoad(stream, id, context);
509
511 n = mesh->nodePtr(id);
512 else
513 n = NULL;
514}

◆ dataLoad() [11/63]

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

Definition at line 1118 of file DataIO.h.

1119{
1120 unsigned int n = 0;
1121 dataLoad(stream, n, nullptr);
1122 v.resize(n);
1123 for (unsigned int i = 0; i < n; i++)
1124 {
1125 T r = 0;
1126 dataLoad(stream, r, context);
1127 v(i) = r;
1128 }
1129}
void resize(const unsigned int n)

◆ dataLoad() [12/63]

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

Definition at line 1003 of file DataIO.h.

1004{
1005 unsigned int m = 0;
1006 dataLoad(stream, m, context);
1007 unsigned int n = 0;
1008 dataLoad(stream, n, context);
1009 v.resize(m, n);
1010 for (const auto i : make_range(m))
1011 for (const auto j : make_range(n))
1012 {
1013 T r{};
1014 dataLoad(stream, r, context);
1015 v(i, j) = r;
1016 }
1017}
for(PetscInt i=0;i< nvars;++i)
IntRange< T > make_range(T beg, T end)

◆ dataLoad() [13/63]

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

Definition at line 518 of file DataIO.C.

519{
520 if (!context)
521 mooseError("Can only load Elem objects using a MooseMesh context!");
522
523 MooseMesh * mesh = static_cast<MooseMesh *>(context);
524
525 // TODO: Write out the unique ID of this element
527
528 dataLoad(stream, id, context);
529
531 e = mesh->elemPtr(id);
532 else
533 e = NULL;
534}

◆ dataLoad() [14/63]

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

Definition at line 518 of file DataIO.C.

519{
520 if (!context)
521 mooseError("Can only load Elem objects using a MooseMesh context!");
522
523 MooseMesh * mesh = static_cast<MooseMesh *>(context);
524
525 // TODO: Write out the unique ID of this element
527
528 dataLoad(stream, id, context);
529
531 e = mesh->elemPtr(id);
532 else
533 e = NULL;
534}

◆ dataLoad() [15/63]

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

Definition at line 1021 of file DataIO.h.

1022{
1023 dataLoad(stream, libMesh::cast_ref<Eigen::Matrix<T, 2, 1> &>(v), context);
1024}
Tnew cast_ref(Told &oldvar)

◆ dataLoad() [16/63]

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

Definition at line 985 of file DataIO.h.

986{
987 // First read the size of the map
988 unsigned int size = 0;
989 dataLoad(stream, size, nullptr);
990
991 for (unsigned int i = 0; i < size; i++)
992 {
993 T key;
994 dataLoad(stream, key, context);
995
996 U & value = m[key];
997 dataLoad(stream, value, context);
998 }
999}
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ dataLoad() [17/63]

void dataLoad ( std::istream &  stream,
libMesh::BoundingBox p,
void *  context 
)

Definition at line 663 of file DataIO.C.

664{
665 dataLoad(stream, cast_ref<std::pair<Point, Point> &>(bbox), context);
666}

◆ dataLoad() [18/63]

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

Definition at line 619 of file DataIO.C.

620{
621 unsigned int m = 0, n = 0;
622 stream.read((char *)&m, sizeof(m));
623 stream.read((char *)&n, sizeof(n));
624 v.resize(m, n);
625 for (unsigned int i = 0; i < m; i++)
626 for (unsigned int j = 0; j < n; j++)
627 {
628 T r = 0;
629 dataLoad(stream, r, context);
630 v(i, j) = r;
631 }
632}
void resize(const unsigned int new_m, const unsigned int new_n)

◆ dataLoad() [19/63]

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

Definition at line 1118 of file DataIO.h.

1119{
1120 unsigned int n = 0;
1121 dataLoad(stream, n, nullptr);
1122 v.resize(n);
1123 for (unsigned int i = 0; i < n; i++)
1124 {
1125 T r = 0;
1126 dataLoad(stream, r, context);
1127 v(i) = r;
1128 }
1129}

◆ dataLoad() [20/63]

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

◆ dataLoad() [21/63]

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

◆ dataLoad() [22/63]

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

Definition at line 1101 of file DataIO.h.

1102{
1103 numeric_index_type size = v.local_size();
1104 for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
1105 {
1106 T r = 0;
1107 dataLoad(stream, r, context);
1108 v.set(i, r);
1109 }
1110 v.close();
1111}
virtual void set(const numeric_index_type i, const T value)=0
virtual void close()=0
virtual numeric_index_type local_size() const=0
virtual numeric_index_type first_local_index() const=0
dof_id_type numeric_index_type

◆ dataLoad() [23/63]

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

Definition at line 670 of file DataIO.C.

671{
672 p.clear();
673
674 // First read the size of the map
675 unsigned int size = 0;
676 stream.read((char *)&size, sizeof(size));
677
678 for (unsigned int i = 0; i < size; i++)
679 {
680 std::string key, type;
681 dataLoad(stream, key, context);
682 dataLoad(stream, type, context);
683
684#define loadscalar(ptype) \
685 else if (type == demangle(typeid(ptype).name())) do \
686 { \
687 ptype & value = p.set<ptype>(key); \
688 dataLoad(stream, value, context); \
689 } \
690 while (0)
691
692 if (false)
693 ;
694 loadscalar(Real);
695 loadscalar(short);
696 loadscalar(int);
697 loadscalar(long);
698 loadscalar(unsigned short);
699 loadscalar(unsigned int);
700 loadscalar(unsigned long);
701
702#undef loadscalar
703 }
704}
virtual void clear()

◆ dataLoad() [24/63]

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

Definition at line 670 of file DataIO.C.

671{
672 p.clear();
673
674 // First read the size of the map
675 unsigned int size = 0;
676 stream.read((char *)&size, sizeof(size));
677
678 for (unsigned int i = 0; i < size; i++)
679 {
680 std::string key, type;
681 dataLoad(stream, key, context);
682 dataLoad(stream, type, context);
683
684#define loadscalar(ptype) \
685 else if (type == demangle(typeid(ptype).name())) do \
686 { \
687 ptype & value = p.set<ptype>(key); \
688 dataLoad(stream, value, context); \
689 } \
690 while (0)
691
692 if (false)
693 ;
694 loadscalar(Real);
695 loadscalar(short);
696 loadscalar(int);
697 loadscalar(long);
698 loadscalar(unsigned short);
699 loadscalar(unsigned int);
700 loadscalar(unsigned long);
701
702#undef loadscalar
703 }
704}

◆ dataLoad() [25/63]

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

◆ dataLoad() [26/63]

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

Definition at line 601 of file DataIO.C.

602{
603 // Obviously if someone loads data with different LIBMESH_DIM than was used for saving them, it
604 // won't work.
605 for (const auto i : make_range(Moose::dim))
606 for (const auto j : make_range(Moose::dim))
607 {
608 T r = 0;
609 dataLoad(stream, r, context);
610 v(i, j) = r;
611 }
612}
unsigned int dim
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...

◆ dataLoad() [27/63]

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

◆ dataLoad() [28/63]

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

Definition at line 73 of file SolutionStateData.C.

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

Referenced by dataLoad().

◆ dataLoad() [29/63]

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

Definition at line 538 of file DataIO.C.

539{
540 if (!context)
541 mooseError("Can only load Node objects using a MooseMesh context!");
542
543 MooseMesh * mesh = static_cast<MooseMesh *>(context);
544
545 // TODO: Write out the unique ID of this nodeent
547
548 dataLoad(stream, id, context);
549
551 n = mesh->nodePtr(id);
552 else
553 n = NULL;
554}

◆ dataLoad() [30/63]

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

Definition at line 538 of file DataIO.C.

539{
540 if (!context)
541 mooseError("Can only load Node objects using a MooseMesh context!");
542
543 MooseMesh * mesh = static_cast<MooseMesh *>(context);
544
545 // TODO: Write out the unique ID of this nodeent
547
548 dataLoad(stream, id, context);
549
551 n = mesh->nodePtr(id);
552 else
553 n = NULL;
554}

◆ dataLoad() [31/63]

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

Definition at line 1147 of file DataIO.h.

1148{
1149 dataLoad(stream, rft._vals, context);
1150}
T _vals[N4]
The values of the rank-four tensor stored by index=(((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) * LIBME...

◆ dataLoad() [32/63]

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

Definition at line 1140 of file DataIO.h.

1141{
1142 dataLoad(stream, rtt._vals, context);
1143}
T _vals[N3]
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k)

◆ dataLoad() [33/63]

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

Definition at line 1133 of file DataIO.h.

1134{
1135 dataLoad(stream, rtt._coords, context);
1136}
T _coords[LIBMESH_DIM *LIBMESH_DIM]

◆ dataLoad() [34/63]

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

◆ dataLoad() [35/63]

template<typename T , std::size_t N>
void dataLoad ( std::istream &  stream,
std::array< T, N > &  arr,
void *  context 
)

Definition at line 1085 of file DataIO.h.

1086{
1087 for (std::size_t i = 0; i < N; ++i)
1088 dataLoad(stream, arr[i], context);
1089}

◆ dataLoad() [36/63]

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

Definition at line 894 of file DataIO.h.

895{
896 // First read the size of the container
897 unsigned int size = 0;
898 dataLoad(stream, size, nullptr);
899
900 for (unsigned int i = 0; i < size; i++)
901 {
902 T data;
903 dataLoad(stream, data, context);
904 l.push_back(std::move(data));
905 }
906}

◆ dataLoad() [37/63]

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

Definition at line 878 of file DataIO.h.

879{
880 // First read the size of the set
881 unsigned int size = 0;
882 dataLoad(stream, size, nullptr);
883
884 for (unsigned int i = 0; i < size; i++)
885 {
886 T data;
887 dataLoad(stream, data, context);
888 l.push_back(std::move(data));
889 }
890}

◆ dataLoad() [38/63]

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

Definition at line 910 of file DataIO.h.

911{
912 m.clear();
913
914 // First read the size of the map
915 unsigned int size = 0;
916 dataLoad(stream, size, nullptr);
917
918 for (unsigned int i = 0; i < size; i++)
919 {
920 T key;
921 dataLoad(stream, key, context);
922
923 U & value = m[key];
924 dataLoad(stream, value, context);
925 }
926}

◆ dataLoad() [39/63]

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

Definition at line 969 of file DataIO.h.

970{
971 bool has_value;
972 dataLoad(stream, has_value, nullptr);
973
974 if (has_value)
975 {
976 m = T{};
977 dataLoad(stream, *m, context);
978 }
979 else
980 m.reset();
981}

◆ dataLoad() [40/63]

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

Definition at line 803 of file DataIO.h.

804{
805 dataLoad(stream, p.first, context);
806 dataLoad(stream, p.second, context);
807}

◆ dataLoad() [41/63]

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

Definition at line 862 of file DataIO.h.

863{
864 // First read the size of the set
865 unsigned int size = 0;
866 dataLoad(stream, size, nullptr);
867
868 for (unsigned int i = 0; i < size; i++)
869 {
870 T data;
871 dataLoad(stream, data, context);
872 s.insert(std::move(data));
873 }
874}

◆ dataLoad() [42/63]

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

Definition at line 844 of file DataIO.h.

845{
846 T * tmp = v.get();
847
848 dataLoad(stream, tmp, context);
849}

◆ dataLoad() [43/63]

template<>
dataLoadSizeofSpecialization(bool) dataLoadSizeofSpecialization(char) dataLoadSizeofSpecialization(signed char) dataLoadSizeofSpecialization(short int) dataLoadSizeofSpecialization(int) dataLoadSizeofSpecialization(long int) dataLoadSizeofSpecialization(long long int) dataLoadSizeofSpecialization(unsigned char) dataLoadSizeofSpecialization(short unsigned int) dataLoadSizeofSpecialization(unsigned int) dataLoadSizeofSpecialization(long unsigned int) dataLoadSizeofSpecialization(long long unsigned int) dataLoadSizeofSpecialization(float) dataLoadSizeofSpecialization(double) dataLoadSizeofSpecialization(long double) dataLoadEnum(libMesh void dataLoad ( std::istream &  stream,
std::string &  v,
void *   
)

Definition at line 404 of file DataIO.C.

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

◆ dataLoad() [44/63]

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

Definition at line 404 of file DataIO.C.

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

Referenced by dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), and dataLoad< mt_state >().

◆ dataLoad() [45/63]

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

Definition at line 558 of file DataIO.C.

559{
560 size_t s_size = 0;
561 stream.read((char *)&s_size, sizeof(s_size));
562
563 std::unique_ptr<char[]> s_s = std::make_unique<char[]>(s_size);
564 stream.read(s_s.get(), s_size);
565
566 // Clear the stringstream before loading new data into it.
567 s.str(std::string());
568 s.write(s_s.get(), s_size);
569}

◆ dataLoad() [46/63]

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

Definition at line 558 of file DataIO.C.

559{
560 size_t s_size = 0;
561 stream.read((char *)&s_size, sizeof(s_size));
562
563 std::unique_ptr<char[]> s_s = std::make_unique<char[]>(s_size);
564 stream.read(s_s.get(), s_size);
565
566 // Clear the stringstream before loading new data into it.
567 s.str(std::string());
568 s.write(s_s.get(), s_size);
569}

◆ dataLoad() [47/63]

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() [48/63]

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() [49/63]

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

Definition at line 853 of file DataIO.h.

854{
855 T * tmp = v.get();
856
857 dataLoad(stream, tmp, context);
858}

◆ dataLoad() [50/63]

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

Definition at line 930 of file DataIO.h.

931{
932 m.clear();
933
934 // First read the size of the map
935 unsigned int size = 0;
936 dataLoad(stream, size, nullptr);
937
938 for (unsigned int i = 0; i < size; i++)
939 {
940 T key;
941 dataLoad(stream, key, context);
942
943 U & value = m[key];
944 dataLoad(stream, value, context);
945 }
946}

◆ dataLoad() [51/63]

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

Definition at line 950 of file DataIO.h.

951{
952 s.clear();
953
954 // First read the size of the set
955 std::size_t size = 0;
956 dataLoad(stream, size, nullptr);
957 s.reserve(size);
958
959 for (std::size_t i = 0; i < size; i++)
960 {
961 T element;
962 dataLoad(stream, element, context);
963 s.insert(element);
964 }
965}

◆ dataLoad() [52/63]

void dataLoad ( std::istream &  stream,
std::vector< bool > &  v,
void *  context 
)
inline

Definition at line 812 of file DataIO.h.

813{
814 // First read the size of the vector
815 unsigned int size = 0;
816 dataLoad(stream, size, nullptr);
817
818 v.resize(size);
819
820 bool tmp{};
821 for (unsigned int i = 0; i < size; i++)
822 {
823 dataLoad(stream, tmp, context);
824 v[i] = tmp;
825 }
826}

◆ dataLoad() [53/63]

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

Definition at line 830 of file DataIO.h.

831{
832 // First read the size of the vector
833 unsigned int size = 0;
834 dataLoad(stream, size, nullptr);
835
836 v.resize(size);
837
838 for (unsigned int i = 0; i < size; i++)
839 dataLoad(stream, v[i], context);
840}

◆ dataLoad() [54/63]

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

Definition at line 1161 of file DataIO.h.

1162{
1163 dataLoad(stream, rft._vals, context);
1164}
std::array< T, N2 > _vals
The values of the rank-four tensor.

◆ dataLoad() [55/63]

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

Definition at line 1154 of file DataIO.h.

1155{
1156 dataLoad(stream, rtt._vals, context);
1157}

◆ dataLoad() [56/63]

template<typename T , std::size_t N>
void dataLoad ( std::istream &  stream,
T(&)  arr[N],
void *  context 
)

Definition at line 1093 of file DataIO.h.

1094{
1095 for (std::size_t i = 0; i < N; ++i)
1096 dataLoad(stream, arr[i], context);
1097}

◆ dataLoad() [57/63]

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

Definition at line 574 of file DataIO.C.

575{
576 unsigned int rank = 0;
577 dataLoad(stream, rank, nullptr);
578
579 std::vector<int64_t> sizes(rank);
580 for (unsigned int dim = 0; dim < rank; ++dim)
581 {
582 unsigned int size = 0;
583 dataLoad(stream, size, nullptr);
584 sizes[dim] = size;
585 }
586
587 t = torch::empty(sizes, at::kDouble);
588 auto flattened = t.reshape({t.numel()});
589 auto t_accessor = flattened.accessor<Real, 1>();
590 for (int64_t i = 0; i < flattened.numel(); ++i)
591 {
592 Real r = 0;
593 dataLoad(stream, r, context);
594 t_accessor[i] = r;
595 }
596}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ dataLoad() [58/63]

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

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

1183{
1184 std::size_t size;
1185 dataLoad(stream, size, nullptr);
1186 data.resize(size);
1187
1188 for (const auto i : index_range(data))
1189 dataLoad(stream, data.pointerValue(i), context);
1190}
void resize(const std::size_t size)
Resizes the underlying vector.
auto index_range(const T &sizable)

◆ dataLoad() [59/63]

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

Definition at line 427 of file DataIO.C.

428{
429 auto & name = cast_ref<std::string &>(v);
430 dataLoad(stream, name, context);
431}

◆ dataLoad() [60/63]

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

Definition at line 427 of file DataIO.C.

428{
429 auto & name = cast_ref<std::string &>(v);
430 dataLoad(stream, name, context);
431}

◆ dataLoad() [61/63]

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

Definition at line 419 of file DataIO.C.

420{
421 auto & name = cast_ref<std::string &>(v);
422 dataLoad(stream, name, context);
423}

◆ dataLoad() [62/63]

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

Definition at line 419 of file DataIO.C.

420{
421 auto & name = cast_ref<std::string &>(v);
422 dataLoad(stream, name, context);
423}

◆ dataLoad() [63/63]

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

Definition at line 757 of file DataIO.C.

758{
759 PetscInt local_size;
760 LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetLocalSize(v, &local_size));
761 PetscScalar * array;
762 LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetArray(v, &array));
763 for (PetscInt i = 0; i < local_size; i++)
764 dataLoad(stream, array[i], context);
765
766 LibmeshPetscCallA(PETSC_COMM_WORLD, VecRestoreArray(v, &array));
767}

◆ dataStore() [1/64]

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

Definition at line 240 of file DataIO.h.

241{
242 mooseError("Attempting to store a raw pointer type: \"",
243 libMesh::demangle(typeid(T).name()),
244 " *\" as restartable data!\nWrite a custom dataStore() template specialization!\n\n");
245}

◆ dataStore() [2/64]

void dataStore ( std::ostream &  ostream,
std::vector< bool > &  v,
void *  ctx 
)
inline

Definition at line 261 of file DataIO.h.

262{
263 unsigned int size = v.size();
264 dataStore(ostream, size, nullptr);
265
266 for (const bool val : v)
267 dataStore(ostream, val, ctx);
268}
void dataStore(std::ostream &stream, T &v, void *)
Definition DataIO.h:81
void * ctx

◆ dataStore() [3/64]

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

Definition at line 113 of file DataIO.C.

114{
115 dataStore(stream, dn.value(), context);
116
117 if (ADReal::do_derivatives)
118 {
119 auto & derivatives = dn.derivatives();
120 std::size_t size = derivatives.size();
121 dataStore(stream, size, context);
122 for (MooseIndex(size) i = 0; i < size; ++i)
123 {
124 dataStore(stream, derivatives.raw_index(i), context);
125 dataStore(stream, derivatives.raw_at(i), context);
126 }
127 }
128}
void dataStore(std::ostream &stream, std::string &v, void *)
Definition DataIO.C:39

◆ dataStore() [4/64]

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

Definition at line 113 of file DataIO.C.

114{
115 dataStore(stream, dn.value(), context);
116
117 if (ADReal::do_derivatives)
118 {
119 auto & derivatives = dn.derivatives();
120 std::size_t size = derivatives.size();
121 dataStore(stream, size, context);
122 for (MooseIndex(size) i = 0; i < size; ++i)
123 {
124 dataStore(stream, derivatives.raw_index(i), context);
125 dataStore(stream, derivatives.raw_at(i), context);
126 }
127 }
128}

◆ dataStore() [5/64]

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

◆ dataStore() [6/64]

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

Definition at line 598 of file DataIO.h.

599{
600 dataStore(stream, cmm._values, context);
601}

◆ dataStore() [7/64]

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

Definition at line 132 of file DataIO.C.

133{
134 // TODO: Write out the unique ID of this elem
136
137 if (e)
138 {
139 id = e->id();
141 mooseError("Can't output Elems with invalid ids!");
142 }
143
144 dataStore(stream, id, context);
145}

◆ dataStore() [8/64]

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

Definition at line 132 of file DataIO.C.

133{
134 // TODO: Write out the unique ID of this elem
136
137 if (e)
138 {
139 id = e->id();
141 mooseError("Can't output Elems with invalid ids!");
142 }
143
144 dataStore(stream, id, context);
145}

◆ dataStore() [9/64]

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

◆ dataStore() [10/64]

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

Definition at line 149 of file DataIO.C.

150{
151 // TODO: Write out the unique ID of this node
153
154 if (n)
155 {
156 id = n->id();
158 mooseError("Can't output Nodes with invalid ids!");
159 }
160
161 dataStore(stream, id, context);
162}

◆ dataStore() [11/64]

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

Definition at line 149 of file DataIO.C.

150{
151 // TODO: Write out the unique ID of this node
153
154 if (n)
155 {
156 id = n->id();
158 mooseError("Can't output Nodes with invalid ids!");
159 }
160
161 dataStore(stream, id, context);
162}

◆ dataStore() [12/64]

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

Definition at line 550 of file DataIO.h.

551{
552 unsigned int m = v.size();
553 dataStore(stream, m, nullptr);
554 for (unsigned int i = 0; i < v.size(); i++)
555 {
556 T r = v(i);
557 dataStore(stream, r, context);
558 }
559}
virtual unsigned int size() const override final

◆ dataStore() [13/64]

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

Definition at line 442 of file DataIO.h.

443{
444 auto m = cast_int<unsigned int>(v.rows());
445 dataStore(stream, m, context);
446 auto n = cast_int<unsigned int>(v.cols());
447 dataStore(stream, n, context);
448 for (const auto i : make_range(m))
449 for (const auto j : make_range(n))
450 {
451 auto & r = v(i, j);
452 dataStore(stream, r, context);
453 }
454}

◆ dataStore() [14/64]

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

Definition at line 166 of file DataIO.C.

167{
168 // TODO: Write out the unique ID of this elem
170
171 if (e)
172 {
173 id = e->id();
175 mooseError("Can't output Elems with invalid ids!");
176 }
177
178 dataStore(stream, id, context);
179}

◆ dataStore() [15/64]

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

Definition at line 166 of file DataIO.C.

167{
168 // TODO: Write out the unique ID of this elem
170
171 if (e)
172 {
173 id = e->id();
175 mooseError("Can't output Elems with invalid ids!");
176 }
177
178 dataStore(stream, id, context);
179}

◆ dataStore() [16/64]

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

Definition at line 458 of file DataIO.h.

459{
460 dataStore(stream, libMesh::cast_ref<Eigen::Matrix<T, 2, 1> &>(v), context);
461}

◆ dataStore() [17/64]

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

Definition at line 421 of file DataIO.h.

422{
423 // First store the size of the map
424 unsigned int size = m.size();
425 dataStore(stream, size, nullptr);
426
427 typename HashMap<T, U>::iterator it = m.begin();
428 typename HashMap<T, U>::iterator end = m.end();
429
430 for (; it != end; ++it)
431 {
432 T & key = const_cast<T &>(it->first);
433
434 dataStore(stream, key, context);
435
436 dataStore(stream, it->second, context);
437 }
438}
HashMap is an abstraction for dictionary data type, we make it thread-safe by locking inserts.
Definition HashMap.h:19

◆ dataStore() [18/64]

void dataStore ( std::ostream &  stream,
libMesh::BoundingBox p,
void *  context 
)

Definition at line 296 of file DataIO.C.

297{
298 dataStore(stream, cast_ref<std::pair<Point, Point> &>(bbox), context);
299}

◆ dataStore() [19/64]

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

Definition at line 254 of file DataIO.C.

255{
256 unsigned int m = v.m();
257 unsigned int n = v.n();
258 stream.write((char *)&m, sizeof(m));
259 stream.write((char *)&n, sizeof(n));
260 for (unsigned int i = 0; i < m; i++)
261 for (unsigned int j = 0; j < n; j++)
262 {
263 T r = v(i, j);
264 dataStore(stream, r, context);
265 }
266}
unsigned int n() const
unsigned int m() const

◆ dataStore() [20/64]

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

Definition at line 550 of file DataIO.h.

551{
552 unsigned int m = v.size();
553 dataStore(stream, m, nullptr);
554 for (unsigned int i = 0; i < v.size(); i++)
555 {
556 T r = v(i);
557 dataStore(stream, r, context);
558 }
559}

◆ dataStore() [21/64]

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

◆ dataStore() [22/64]

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

◆ dataStore() [23/64]

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

Definition at line 532 of file DataIO.h.

533{
534 v.close();
535
537
538 for (numeric_index_type i = v.first_local_index(); i < v.first_local_index() + size; i++)
539 {
540 T r = v(i);
541 dataStore(stream, r, context);
542 }
543}

◆ dataStore() [24/64]

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

Definition at line 310 of file DataIO.C.

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

◆ dataStore() [25/64]

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

Definition at line 310 of file DataIO.C.

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

◆ dataStore() [26/64]

template<>
dataStoreSizeofSpecialization(bool) dataStoreSizeofSpecialization(char) dataStoreSizeofSpecialization(signed char) dataStoreSizeofSpecialization(short int) dataStoreSizeofSpecialization(int) dataStoreSizeofSpecialization(long int) dataStoreSizeofSpecialization(long long int) dataStoreSizeofSpecialization(unsigned char) dataStoreSizeofSpecialization(short unsigned int) dataStoreSizeofSpecialization(unsigned int) dataStoreSizeofSpecialization(long unsigned int) dataStoreSizeofSpecialization(long long unsigned int) dataStoreSizeofSpecialization(float) dataStoreSizeofSpecialization(double) dataStoreSizeofSpecialization(long double) dataStoreEnum(libMesh void dataStore ( std::ostream &  stream,
libMesh::Point p,
void *  context 
)

◆ dataStore() [27/64]

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

Definition at line 239 of file DataIO.C.

240{
241 for (const auto i : make_range(Moose::dim))
242 for (const auto j : make_range(Moose::dim))
243 {
244 T r = v(i, j);
245 dataStore(stream, r, context);
246 }
247}

◆ dataStore() [28/64]

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

◆ dataStore() [29/64]

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

Definition at line 47 of file SolutionStateData.C.

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

Referenced by dataStore().

◆ dataStore() [30/64]

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

Definition at line 183 of file DataIO.C.

184{
185 // TODO: Write out the unique ID of this node
187
188 if (n)
189 {
190 id = n->id();
192 mooseError("Can't output Nodes with invalid ids!");
193 }
194
195 dataStore(stream, id, context);
196}

◆ dataStore() [31/64]

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

Definition at line 183 of file DataIO.C.

184{
185 // TODO: Write out the unique ID of this node
187
188 if (n)
189 {
190 id = n->id();
192 mooseError("Can't output Nodes with invalid ids!");
193 }
194
195 dataStore(stream, id, context);
196}

◆ dataStore() [32/64]

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

Definition at line 577 of file DataIO.h.

578{
579 dataStore(stream, rft._vals, context);
580}

◆ dataStore() [33/64]

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

Definition at line 570 of file DataIO.h.

571{
572 dataStore(stream, rtt._vals, context);
573}

◆ dataStore() [34/64]

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

Definition at line 563 of file DataIO.h.

564{
565 dataStore(stream, rtt._coords, context);
566}

◆ dataStore() [35/64]

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

◆ dataStore() [36/64]

template<typename T , std::size_t N>
void dataStore ( std::ostream &  stream,
std::array< T, N > &  arr,
void *  context 
)

Definition at line 524 of file DataIO.h.

525{
526 for (std::size_t i = 0; i < N; ++i)
527 dataStore(stream, arr[i], context);
528}

◆ dataStore() [37/64]

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

Definition at line 338 of file DataIO.h.

339{
340 // First store the size of the container
341 unsigned int size = l.size();
342 dataStore(stream, size, nullptr);
343
344 typename std::deque<T>::iterator it = l.begin();
345 typename std::deque<T>::iterator end = l.end();
346
347 for (; it != end; ++it)
348 {
349 T & x = const_cast<T &>(*it);
350 dataStore(stream, x, context);
351 }
352}

◆ dataStore() [38/64]

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

Definition at line 320 of file DataIO.h.

321{
322 // First store the size of the set
323 unsigned int size = l.size();
324 dataStore(stream, size, nullptr);
325
326 typename std::list<T>::iterator it = l.begin();
327 typename std::list<T>::iterator end = l.end();
328
329 for (; it != end; ++it)
330 {
331 T & x = const_cast<T &>(*it);
332 dataStore(stream, x, context);
333 }
334}

◆ dataStore() [39/64]

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

Definition at line 356 of file DataIO.h.

357{
358 // First store the size of the map
359 unsigned int size = m.size();
360 dataStore(stream, size, nullptr);
361
362 typename std::map<T, U>::iterator it = m.begin();
363 typename std::map<T, U>::iterator end = m.end();
364
365 for (; it != end; ++it)
366 {
367 T & key = const_cast<T &>(it->first);
368
369 dataStore(stream, key, context);
370
371 dataStore(stream, it->second, context);
372 }
373}

◆ dataStore() [40/64]

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

Definition at line 410 of file DataIO.h.

411{
412 bool has_value = m.has_value();
413 dataStore(stream, has_value, nullptr);
414
415 if (has_value)
416 dataStore(stream, *m, context);
417}

◆ dataStore() [41/64]

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

Definition at line 252 of file DataIO.h.

253{
254 dataStore(stream, p.first, context);
255 dataStore(stream, p.second, context);
256}

◆ dataStore() [42/64]

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

Definition at line 302 of file DataIO.h.

303{
304 // First store the size of the set
305 unsigned int size = s.size();
306 dataStore(stream, size, nullptr);
307
308 typename std::set<T>::iterator it = s.begin();
309 typename std::set<T>::iterator end = s.end();
310
311 for (; it != end; ++it)
312 {
313 T & x = const_cast<T &>(*it);
314 dataStore(stream, x, context);
315 }
316}

◆ dataStore() [43/64]

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

Definition at line 284 of file DataIO.h.

285{
286 T * tmp = v.get();
287
288 dataStore(stream, tmp, context);
289}

◆ dataStore() [44/64]

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

Definition at line 39 of file DataIO.C.

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

◆ dataStore() [45/64]

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

Definition at line 39 of file DataIO.C.

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

Referenced by dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), and dataStore< mt_state >().

◆ dataStore() [46/64]

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

Definition at line 200 of file DataIO.C.

201{
202 const std::string & s_str = s.str();
203
204 size_t s_size = s_str.size();
205 stream.write((char *)&s_size, sizeof(s_size));
206
207 stream.write(s_str.c_str(), sizeof(char) * (s_str.size()));
208}

◆ dataStore() [47/64]

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

Definition at line 200 of file DataIO.C.

201{
202 const std::string & s_str = s.str();
203
204 size_t s_size = s_str.size();
205 stream.write((char *)&s_size, sizeof(s_size));
206
207 stream.write(s_str.c_str(), sizeof(char) * (s_str.size()));
208}

◆ dataStore() [48/64]

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() [49/64]

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() [50/64]

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

Definition at line 293 of file DataIO.h.

294{
295 T * tmp = v.get();
296
297 dataStore(stream, tmp, context);
298}

◆ dataStore() [51/64]

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

Definition at line 377 of file DataIO.h.

378{
379 // First store the size of the map
380 unsigned int size = m.size();
381 dataStore(stream, size, nullptr);
382
383 typename std::unordered_map<T, U>::iterator it = m.begin();
384 typename std::unordered_map<T, U>::iterator end = m.end();
385
386 for (; it != end; ++it)
387 {
388 T & key = const_cast<T &>(it->first);
389
390 dataStore(stream, key, context);
391
392 dataStore(stream, it->second, context);
393 }
394}

◆ dataStore() [52/64]

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

Definition at line 398 of file DataIO.h.

399{
400 // First store the size of the set
401 std::size_t size = s.size();
402 dataStore(stream, size, nullptr);
403
404 for (auto & element : s)
405 dataStore(stream, element, context);
406}

◆ dataStore() [53/64]

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

Definition at line 272 of file DataIO.h.

273{
274 // First store the size of the vector
275 unsigned int size = v.size();
276 dataStore(stream, size, nullptr);
277
278 for (unsigned int i = 0; i < size; i++)
279 dataStore(stream, v[i], context);
280}

◆ dataStore() [54/64]

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

Definition at line 591 of file DataIO.h.

592{
593 dataStore(stream, srft._vals, context);
594}

◆ dataStore() [55/64]

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

Definition at line 584 of file DataIO.h.

585{
586 dataStore(stream, srtt._vals, context);
587}

◆ dataStore() [56/64]

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

Definition at line 81 of file DataIO.h.

82{
83 static_assert(sizeof(T) == 0, "You must write a dataStore specialization for your type");
84}

Referenced by dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), and dataStore().

◆ dataStore() [57/64]

template<typename T , std::size_t N>
void dataStore ( std::ostream &  stream,
T(&)  arr[N],
void *  context 
)

Definition at line 516 of file DataIO.h.

517{
518 for (std::size_t i = 0; i < N; ++i)
519 dataStore(stream, arr[i], context);
520}

◆ dataStore() [58/64]

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

Definition at line 213 of file DataIO.C.

214{
215 const auto tensor = LibtorchUtils::toCPUContiguous(t);
216 mooseAssert(tensor.scalar_type() == at::kDouble,
217 "Restart storage currently supports only double tensors.");
218
219 auto rank = cast_int<unsigned int>(tensor.dim());
220 dataStore(stream, rank, nullptr);
221 for (unsigned int dim = 0; dim < rank; ++dim)
222 {
223 auto size = cast_int<unsigned int>(tensor.sizes()[dim]);
224 dataStore(stream, size, nullptr);
225 }
226
227 const auto flattened = tensor.reshape({tensor.numel()});
228 const auto t_accessor = flattened.accessor<Real, 1>();
229 for (int64_t i = 0; i < flattened.numel(); ++i)
230 {
231 Real r = t_accessor[i];
232 dataStore(stream, r, context);
233 }
234}
torch::Tensor toCPUContiguous(const torch::Tensor &tensor)
Return a detached contiguous CPU copy of a tensor.

◆ dataStore() [59/64]

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

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

612{
613 std::size_t size = data.size();
614 dataStore(stream, size, nullptr);
615
616 for (const auto i : index_range(data))
617 {
618 mooseAssert(data.hasValue(i), "Data doesn't have a value");
619 dataStore(stream, data.pointerValue(i), context);
620 }
621}
std::size_t size() const
bool hasValue(const std::size_t i) const
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.

◆ dataStore() [60/64]

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

Definition at line 59 of file DataIO.C.

60{
61 auto & name = cast_ref<std::string &>(v);
62 dataStore(stream, name, context);
63}

◆ dataStore() [61/64]

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

Definition at line 59 of file DataIO.C.

60{
61 auto & name = cast_ref<std::string &>(v);
62 dataStore(stream, name, context);
63}

◆ dataStore() [62/64]

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

Definition at line 51 of file DataIO.C.

52{
53 auto & name = cast_ref<std::string &>(v);
54 dataStore(stream, name, context);
55}

◆ dataStore() [63/64]

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

Definition at line 51 of file DataIO.C.

52{
53 auto & name = cast_ref<std::string &>(v);
54 dataStore(stream, name, context);
55}

◆ dataStore() [64/64]

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

Definition at line 771 of file DataIO.C.

772{
773 PetscInt local_size;
774 LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetLocalSize(v, &local_size));
775 PetscScalar * array;
776 LibmeshPetscCallA(PETSC_COMM_WORLD, VecGetArray(v, &array));
777 for (PetscInt i = 0; i < local_size; i++)
778 dataStore(stream, array[i], context);
779
780 LibmeshPetscCallA(PETSC_COMM_WORLD, VecRestoreArray(v, &array));
781}