https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions
SolutionStateData.C File Reference

Go to the source code of this file.

Functions

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

Function Documentation

◆ dataLoad()

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)
std::string name(const ElemQuality q)
IntRange< T > make_range(T beg, T end)
Base problem data struct.

Referenced by dataLoad().

◆ dataStore()

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().