33int 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.");
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;
113 <<
" failed." << endl;
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.
const FieldMapType & GetFieldMap() const
Get a const reference to the internal field map.
Mesh * GetMesh()
Get a pointer to the mesh in the collection.
GFieldMap::MapType FieldMapType
virtual void SetPadDigitsCycle(int digits)
Set the number of digits used for the cycle.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
static bool Root()
Return true if the rank in MPI_COMM_WORLD is zero.
static int WorldRank()
Return the MPI rank in MPI_COMM_WORLD.
static int WorldSize()
Return the size of MPI_COMM_WORLD.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void PrintUsage(std::ostream &out) const
Print the usage message.
void PrintOptions(std::ostream &out) const
Print the options.
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...
bool Good() const
Return true if the command line options were parsed successfully.
void Disable()
Disable output.
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)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...