40 m_mxTNormsRef({0,0,0}),
41 m_mxTNormsErr({0,0,0}),
42 m_l1TNormsRef({
nullptr,
nullptr,
nullptr}),
43 m_l1TNormsErr({
nullptr,
nullptr,
nullptr}),
47 "Passed ptr to problem is null"
70 sd->evaluateFunctionOnDofs(
m_solution,ana,time);
82 ana->addScaled(*num,-1.0);
89 (*ana)[dof->getGlobalIndex()] = 0.;
90 ana->releaseLocalData();
159 "Passed ptr on analytic solution or reference solution is null"
161 m_solution = ceps::runtimeCast<ScalarSAFunc*>(func);
181 "When requesting error in (l-px,l-pt) norm, px and pt must be either" << std::endl <<
182 " 0 for l-infinity norm" << std::endl <<
183 " 1 for l-1 norm" << std::endl <<
184 " 2 for l-2 norm, but not 2 for pt"
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
int32_t CepsInt
Need 32 bit integer.
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
DHVecPtr newDofHaloVector() const
Get a new vector from the factory, with halo data.
Base class for creating PDEs to solve.
AbstractDiscretization * getSpatialDiscretization() const
Link to the spatial discretization (FE, FV, etc)
CepsVector< Unknown * > getZeroDUnknowns() const
A vector of all zeroD unknowns of the pb.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
CepsReal getAbsoluteErrorNow(CepsInt px) const
Get norm of difference at current time.
void setAnalyticSolution(ceps::Function< CepsReal(CepsStandardArgs)> *func)
Manually set the analytic solution.
CepsArray3< CepsReal > m_refNow
Norm of reference at current time.
AbstractPdeProblem * m_problem
Link to problem.
CepsArray3< CepsReal > m_errNow
Norm of difference at current time.
CepsReal m_dt
Time step, 1 by default,.
CepsReal getRelativeErrorNow(CepsInt px) const
Get relative norm of difference at current time.
CepsReal getReferenceNormNow(CepsInt px) const
Get norm of reference at current time. p=0 max, p=1 l1 normm, p=2 l2 norm.
PdeErrorCalculator(AbstractPdeProblem *pb, CepsReal dt=1.)
Constructor with discretization.
CepsArray3< CepsReal > m_mxTNormsRef
max norm in time
CepsBool m_ignoreZeroD
Do not add errors from 0D unknowns.
CepsArray3< TimeIntegrator * > m_l1TNormsRef
Integrator for L1 norm in time.
CepsArray3< TimeIntegrator * > m_l1TNormsErr
Integrator for L1 norm in time.
void reset()
Reset all cumulated norms.
CepsReal getAbsoluteErrorCumulative(CepsInt px, CepsInt pt) const
Get cumulated norm of difference.
~PdeErrorCalculator()
Destructor.
CepsReal getRelativeErrorCumulative(CepsInt px, CepsInt pt) const
Get relative cumulated norm of difference.
void compute(DHVecPtr num, CepsReal time=0.)
Compute the error at current time and add to total.
ScalarSAFunc * m_solution
Analytic function.
CepsArray3< CepsReal > m_mxTNormsErr
max norm in time
void checkPxPt(CepsInt px, CepsInt pt) const
Aborts if pw or pt is not 0,1,2.
CepsReal getReferenceNormCumulative(CepsInt px, CepsInt pt) const
Get cumulated norm of reference so far.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
constexpr CepsHash get(_Type const &i)
get a hash from a single value
CepsUInt getRank()
Returns current processor rank.
const _Type & max(const CepsVector< _Type, _Alloc > &vec)
Returns the maximum of the vector, const version.
CepsBool isNullPtr(_Type *ptr)
Tells if passed pointer is null.
void destroyObject(_Type &)
Destroy[delete] any type.
Structure used to pass arguments to SAFunc (see pde directory) The flags of the SAFunc allows extract...
function caller : abstract base, only contains an variadic operator()