38int main(
int argc,
char *argv[])
47 const char *coll_name0 = NULL;
48 const char *coll_name1 = NULL;
50 int pad_digits_cycle = 6;
51 int pad_digits_rank = 6;
55 args.
AddOption(&coll_name0,
"-r0",
"--root-file_0",
56 "Set the VisIt data collection root file prefix.",
true);
57 args.
AddOption(&coll_name1,
"-r1",
"--root-file_1",
58 "Set the VisIt data collection root file prefix.",
true);
59 args.
AddOption(&cycle,
"-c",
"--cycle",
"Set the cycle index to read.");
60 args.
AddOption(&pad_digits_cycle,
"-pdc",
"--pad-digits-cycle",
61 "Number of digits in cycle.");
62 args.
AddOption(&pad_digits_rank,
"-pdr",
"--pad-digits-rank",
63 "Number of digits in MPI rank.");
64 args.
AddOption(&tol,
"-tol",
"--tolerance",
65 "Tolerance for checking the results.");
85 mfem::out <<
"Error loading VisIt data collection: " << coll_name0 << endl;
100 mfem::out <<
"Error loading VisIt data collection: " << coll_name1 << endl;
108 for (fields_t::const_iterator it0 = fields0.begin();
109 it0 != fields0.end() ; ++it0)
114 mfem::out <<
"Error loading:"<<it0->first<< endl;
115 mfem::out <<
"From data collection: " << coll_name0 << endl;
122 mfem::out <<
"Error loading:"<<it0->first<< endl;
123 mfem::out <<
"From data collection: " << coll_name1 << endl;
128 mfem::out <<
"Size error for:"<<it0->first<< endl;
129 mfem::out <<
"In data collection: " << coll_name0
130 <<
" size is "<<gf0->
Size()<< endl;
131 mfem::out <<
"In data collection: " << coll_name1
132 <<
" size is "<<gf1->
Size()<< endl;
143 real_t rel_sym = 2*nrmd/(nrm0 + nrm1);
144 if (gf0->
Norml2() > rel_sym) { error =
true; }
147 mfem::out <<
"==========================================="<<std::endl;
148 mfem::out <<
"|"<<it0->first<<
"_0| = "<<nrm0<<std::endl;
149 mfem::out <<
"|"<<it0->first<<
"_1| = "<<nrm1<<std::endl;
150 mfem::out <<
"\n|"<<it0->first<<
"_0 - "<<it0->first<<
"_1| = "<<nrmd <<std::endl;
152 mfem::out <<
"\n2|"<<it0->first<<
"_0 - "<<it0->first<<
"_1|"<<std::endl;
153 mfem::out << std::setfill(
'-') << std::setw(15 + 2*it0->first.length())
154 <<
" = "<<rel_sym<<std::endl;
155 mfem::out <<
"(|"<<it0->first<<
"_0| + |"<<it0->first<<
"_1|)\n"<<std::endl;
159 if (error && tol > 0.0)
161 mfem::out <<
"Data collections: " << coll_name0
162 <<
" & " << coll_name1 <<
" are outside of the tolerance!\n";
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.
GridFunction * GetField(const std::string &field_name)
Get a pointer to a grid function in the collection.
const FieldMapType & GetFieldMap() const
Get a const reference to the internal field map.
GFieldMap::MapType FieldMapType
virtual void SetPadDigitsCycle(int digits)
Set the number of digits used for the cycle.
Class for grid function - Vector with associated FE space.
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 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.
real_t Norml2() const
Returns the l2 norm of the vector.
int Size() const
Returns the size of the vector.
Data collection with VisIt I/O routines.
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...