14 #ifndef _GENERALFUNCS_H_ 15 #define _GENERALFUNCS_H_ 40 inline bool compare(
const T &x,
const T &y,
int prec)
42 const T tol = std::pow(10., -std::abs(prec));
43 return std::fabs(x - y) >
44 (
std::min(std::fabs(x), std::fabs(y)) + tol)*tol;
50 inline bool compare1(
const T &x,
const T &y,
int prec)
52 const T tol = std::pow(10., -std::abs(prec));
53 return std::fabs(x - y) >
54 std::min(std::fabs(x), std::fabs(y))*tol + tol;
68 const int& a_maxGridSize,
69 const int& a_blockFactor,
70 const int& a_numlevels,
72 const bool& a_verbose);
79 const int& a_maxGridSize,
80 const int& a_blockFactor,
81 const int& a_numlevels,
83 const bool& a_verbose);
101 Real a_normMaxerrFine,
104 Real a_normMaxerrCoarse,
105 Real a_norm1errCoarse,
106 Real a_norm2errCoarse);
117 const Box& a_domainBox,
118 const int& a_maxGridSize,
119 const int& a_blockFactor,
120 const int& a_boxCount,
int project2(Vector< LevelData< FArrayBox > * > &a_vectProj, const Vector< LevelData< FArrayBox > * > &a_vectPhi, const Vector< DisjointBoxLayout > &a_vectGrids)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int getBoxesFromIndices(Vector< Box > &a_vectBoxes, const Box &a_domainBox, const int &a_maxGridSize, const int &a_blockFactor, const int &a_boxCount, const Vector< int > &a_boxIndices, const Vector< int > &a_domainIndices)
IndexTM< T, N > min(const IndexTM< T, N > &a_p1, const IndexTM< T, N > &a_p2)
Definition: IndexTMI.H:394
bool compare(const T &x, const T &y, int prec)
Definition: generalFuncs.H:40
int getDiff(Vector< LevelData< FArrayBox > * > &a_vectDiff, const Vector< LevelData< FArrayBox > * > &a_vectPhi1, const Vector< LevelData< FArrayBox > * > &a_vectPhi2)
Parse Parameters From Command Line and Input Files.
Definition: ParmParse.H:2849
int readBoxes(Vector< Vector< Box > > &a_vectVectBoxes, ParmParse &a_pp, const ProblemDomain &a_domain, const int &a_maxGridSize, const int &a_blockFactor, const int &a_numlevels, const Vector< int > &a_vectRefRatio, const bool &a_verbose)
Definition: generalFuncs.H:29
int printErrorNorms(const string &a_prefix, Real a_dxFine, int a_deginterp, Real a_normMaxerrFine, Real a_norm1errFine, Real a_norm2errFine, Real a_normMaxerrCoarse, Real a_norm1errCoarse, Real a_norm2errCoarse)
double Real
Definition: REAL.H:33
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
int getMagnitude(Vector< LevelData< FArrayBox > * > &a_vectMag, const Vector< LevelData< FArrayBox > * > &a_vectField)
Box boxFromVector(const Vector< int > &a_ints, int a_start=0)
bool compare1(const T &x, const T &y, int prec)
Definition: generalFuncs.H:50
int printDiffNorms(const string &a_prefix, Real a_dxFine, int a_deginterp, Real a_normMaxdiff, Real a_norm1diff, Real a_norm2diff)