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

Go to the source code of this file.

Functions

 registerMooseObject ("StochasticToolsApp", ParallelSolutionStorage)
 
void to_json (nlohmann::json &json, const std::map< VariableName, std::unordered_map< unsigned int, std::vector< DenseVector< Real > > > > &solution_storage)
 

Function Documentation

◆ registerMooseObject()

registerMooseObject ( "StochasticToolsApp"  ,
ParallelSolutionStorage   
)

◆ to_json()

void to_json ( nlohmann::json &  json,
const std::map< VariableName, std::unordered_map< unsigned int, std::vector< DenseVector< Real > > > > &  solution_storage 
)

Definition at line 125 of file ParallelSolutionStorage.C.

129{
130 for (const auto & vname_pair : solution_storage)
131 {
132 auto & variable_storage = json[vname_pair.first];
133 for (const auto & sample_pair : vname_pair.second)
134 {
135 auto & sample_storage = variable_storage[std::to_string(sample_pair.first)];
136 sample_storage = std::vector<std::vector<Real>>();
137 for (const auto & sample : sample_pair.second)
138 {
139 sample_storage.push_back(sample.get_values());
140 }
141 }
142 }
143}