Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 32 of file meshavg.C.
40 <<
" outputsolution mesh firstsolution [secondsolution ...]" << std::endl;
48 EquationSystems::READ_HEADER |
49 EquationSystems::READ_DATA |
50 EquationSystems::READ_BASIC_ONLY);
51 libMesh::out <<
"Loaded first solution " << argv[3] << std::endl;
55 std::vector<std::string> sysnames;
56 std::vector<std::unique_ptr<NumericVector<libMesh::Number>>> summed_solutions;
58 for (
unsigned int s = 0; s != es1.n_systems(); ++s)
60 sysnames.push_back(es1.get_system(s).name());
61 summed_solutions.emplace_back(es1.get_system(s).solution->clone());
64 for (
int i=4; i < argc; ++i)
70 EquationSystems::READ_HEADER |
71 EquationSystems::READ_DATA |
72 EquationSystems::READ_BASIC_ONLY);
73 libMesh::out <<
"Loaded next solution " << argv[i] << std::endl;
77 if (!es2.has_system(sysnames[s]))
78 libmesh_error_msg(
"EquationSystems object does not have " << sysnames[s]);
80 (*summed_solutions[s]) += *es2.get_system(s).solution;
84 int n_solutions = argc - 3;
88 (*summed_solutions[s]) /= n_solutions;
89 es1.get_system(s).solution->swap(*summed_solutions[s]);
90 es1.get_system(s).solution->close();
References dim, libMesh::index_range(), libMesh::TriangleWrapper::init(), libMesh::out, libMesh::EquationSystems::READ_BASIC_ONLY, libMesh::EquationSystems::READ_DATA, libMesh::EquationSystems::READ_HEADER, and libMesh::NameBasedIO::write_equation_systems().
◆ dim
virtual void write_equation_systems(const std::string &filename, const EquationSystems &es, const std::set< std::string > *system_names=nullptr) override
This method implements writing a mesh with data to a specified file where the data is taken from the ...