33 int main(
int argc,
char *argv[])
42 const char *coll_name = NULL;
44 int pad_digits_cycle = 6;
45 int pad_digits_rank = 6;
46 bool visualization =
true;
49 args.
AddOption(&coll_name,
"-r",
"--root-file",
50 "Set the VisIt data collection root file prefix.",
true);
51 args.
AddOption(&cycle,
"-c",
"--cycle",
"Set the cycle index to read.");
52 args.
AddOption(&pad_digits_cycle,
"-pdc",
"--pad-digits-cycle",
53 "Number of digits in cycle.");
54 args.
AddOption(&pad_digits_rank,
"-pdr",
"--pad-digits-rank",
55 "Number of digits in MPI rank.");
56 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
58 "Enable or disable GLVis visualization.");
76 if (dc.
Error() != DataCollection::NO_ERROR)
78 mfem::out <<
"Error loading VisIt data collection: " << coll_name << endl;
86 for (fields_t::const_iterator it = fields.begin(); it != fields.end(); ++it)
88 if (it != fields.begin()) {
mfem::out <<
", "; }
93 if (!visualization) {
return 0; }
99 for (fields_t::const_iterator it = fields.begin();
100 it != fields.end() || fields.begin() == fields.end(); ++it)
103 bool succeeded = sol_sock.good();
106 MPI_Allreduce(&succeeded, &all_succeeded, 1,
107 MPI_C_BOOL, MPI_LAND, MPI_COMM_WORLD);
108 succeeded = all_succeeded;
112 mfem::out <<
"Connection to " << vishost <<
':' << visport
113 <<
" failed." << endl;
117 sol_sock <<
"parallel " << Mpi::WorldSize() <<
" "
118 << Mpi::WorldRank() <<
"\n";
120 if (fields.begin() == fields.end())
123 sol_sock <<
"mesh\n" << *dc.
GetMesh() << flush;
126 sol_sock.precision(8);
127 sol_sock <<
"solution\n" << *dc.
GetMesh() << *it->second
128 <<
"window_title '" << it->first <<
"'\n" << flush;
virtual void SetPadDigitsRank(int digits)
Set the number of digits used for the MPI rank in filenames.
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.
virtual void Load(int cycle_=0) override
Load the collection based on its VisIt data (described in its root file)
void PrintUsage(std::ostream &out) const
Print the usage message.
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
virtual void SetPadDigitsCycle(int digits)
Set the number of digits used for the cycle.
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.