33 int main(
int argc,
char *argv[])
41 const char *coll_name = NULL;
43 bool visualization =
true;
46 args.
AddOption(&coll_name,
"-r",
"--root-file",
47 "Set the VisIt data collection root file prefix.",
true);
48 args.
AddOption(&cycle,
"-c",
"--cycle",
"Set the cycle index to read.");
49 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
51 "Enable or disable GLVis visualization.");
67 if (dc.
Error() != DataCollection::NO_ERROR)
69 mfem::out <<
"Error loading VisIt data collection: " << coll_name << endl;
77 for (fields_t::const_iterator it = fields.begin(); it != fields.end(); ++it)
79 if (it != fields.begin()) {
mfem::out <<
", "; }
84 if (!visualization) {
return 0; }
90 for (fields_t::const_iterator it = fields.begin();
91 it != fields.end() || fields.begin() == fields.end(); ++it)
94 bool succeeded = sol_sock.good();
97 MPI_Allreduce(&succeeded, &all_succeeded, 1,
98 MPI_C_BOOL, MPI_LAND, MPI_COMM_WORLD);
99 succeeded = all_succeeded;
103 mfem::out <<
"Connection to " << vishost <<
':' << visport
104 <<
" failed." << endl;
111 if (fields.begin() == fields.end())
114 sol_sock <<
"mesh\n" << *dc.
GetMesh() << flush;
117 sol_sock.precision(8);
118 sol_sock <<
"solution\n" << *dc.
GetMesh() << *it->second
119 <<
"window_title '" << it->first <<
"'\n" << flush;
int WorldSize() const
Return MPI_COMM_WORLD's size.
int Error() const
Get the current error state.
int main(int argc, char *argv[])
A simple convenience class that calls MPI_Init() at construction and MPI_Finalize() at destruction...
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
const FieldMapType & GetFieldMap() const
Get a const reference to the internal field map.
Data collection with VisIt I/O routines.
bool Root() const
Return true if WorldRank() == 0.
void PrintUsage(std::ostream &out) const
Print the usage message.
virtual void Load(int cycle_=0)
Load the collection based on its VisIt data (described in its root file)
int WorldRank() const
Return MPI_COMM_WORLD's rank.
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
void Disable()
Disable output.
GFieldMap::MapType FieldMapType
void PrintOptions(std::ostream &out) const
Print the options.
Mesh * GetMesh()
Get a pointer to the mesh in the collection.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
bool Good() const
Return true if the command line options were parsed successfully.