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; }
86 char vishost[] =
"localhost";
90 for (fields_t::const_iterator it = fields.begin();
91 it != fields.end() || fields.begin() == fields.end(); ++it)
96 mfem::out <<
"Connection to " << vishost <<
':' << visport
97 <<
" failed." << endl;
104 if (fields.begin() == fields.end())
107 sol_sock <<
"mesh\n" << *dc.
GetMesh() << flush;
110 sol_sock.precision(8);
111 sol_sock <<
"solution\n" << *dc.
GetMesh() << *it->second
112 <<
"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...
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
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)
void Disable()
Disable output.
GFieldMap::MapType FieldMapType
void PrintOptions(std::ostream &out) const
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...