33 int main(
int argc,
char *argv[])
42 const char *coll_name = NULL;
44 bool visualization =
true;
47 args.
AddOption(&coll_name,
"-r",
"--root-file",
48 "Set the VisIt data collection root file prefix.",
true);
49 args.
AddOption(&cycle,
"-c",
"--cycle",
"Set the cycle index to read.");
50 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
52 "Enable or disable GLVis visualization.");
68 if (dc.
Error() != DataCollection::NO_ERROR)
70 mfem::out <<
"Error loading VisIt data collection: " << coll_name << endl;
78 for (fields_t::const_iterator it = fields.begin(); it != fields.end(); ++it)
80 if (it != fields.begin()) {
mfem::out <<
", "; }
85 if (!visualization) {
return 0; }
91 for (fields_t::const_iterator it = fields.begin();
92 it != fields.end() || fields.begin() == fields.end(); ++it)
95 bool succeeded = sol_sock.good();
98 MPI_Allreduce(&succeeded, &all_succeeded, 1,
99 MPI_C_BOOL, MPI_LAND, MPI_COMM_WORLD);
100 succeeded = all_succeeded;
104 mfem::out <<
"Connection to " << vishost <<
':' << visport
105 <<
" failed." << endl;
109 sol_sock <<
"parallel " << Mpi::WorldSize() <<
" "
110 << Mpi::WorldRank() <<
"\n";
112 if (fields.begin() == fields.end())
115 sol_sock <<
"mesh\n" << *dc.
GetMesh() << flush;
118 sol_sock.precision(8);
119 sol_sock <<
"solution\n" << *dc.
GetMesh() << *it->second
120 <<
"window_title '" << it->first <<
"'\n" << flush;
int Error() const
Get the current error state.
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.
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)
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.