CEPS  24.01
Cardiac ElectroPhysiology Simulator
PdeErrorCalculator Class Reference

Detailed Description

Utility to measure distance with respect to analytic solution or given vectors.

Definition at line 42 of file PdeErrorCalculator.hpp.

#include <PdeErrorCalculator.hpp>

Public Member Functions

 PdeErrorCalculator (AbstractPdeProblem *pb, CepsReal dt=1.)
 Constructor with discretization. More...
 
 ~PdeErrorCalculator ()
 Destructor. More...
 
void compute (DHVecPtr num, CepsReal time=0.)
 Compute the error at current time and add to total. More...
 
CepsReal getReferenceNormNow (CepsInt px) const
 Get norm of reference at current time. p=0 max, p=1 l1 normm, p=2 l2 norm. More...
 
CepsReal getReferenceNormCumulative (CepsInt px, CepsInt pt) const
 Get cumulated norm of reference so far. More...
 
CepsReal getAbsoluteErrorNow (CepsInt px) const
 Get norm of difference at current time. More...
 
CepsReal getAbsoluteErrorCumulative (CepsInt px, CepsInt pt) const
 Get cumulated norm of difference. More...
 
CepsReal getRelativeErrorNow (CepsInt px) const
 Get relative norm of difference at current time. More...
 
CepsReal getRelativeErrorCumulative (CepsInt px, CepsInt pt) const
 Get relative cumulated norm of difference. More...
 
void setAnalyticSolution (ceps::Function< CepsReal(CepsStandardArgs)> *func)
 Manually set the analytic solution. More...
 
void reset ()
 Reset all cumulated norms. More...
 

Protected Member Functions

void checkPxPt (CepsInt px, CepsInt pt) const
 Aborts if pw or pt is not 0,1,2. More...
 

Protected Attributes

AbstractPdeProblemm_problem
 Link to problem. More...
 
ScalarSAFuncm_solution
 Analytic function. More...
 
CepsReal m_dt
 Time step, 1 by default,. More...
 
CepsArray3< CepsRealm_refNow
 Norm of reference at current time. More...
 
CepsArray3< CepsRealm_errNow
 Norm of difference at current time. More...
 
CepsArray3< CepsRealm_mxTNormsRef
 max norm in time More...
 
CepsArray3< CepsRealm_mxTNormsErr
 max norm in time More...
 
CepsArray3< TimeIntegrator * > m_l1TNormsRef
 Integrator for L1 norm in time. More...
 
CepsArray3< TimeIntegrator * > m_l1TNormsErr
 Integrator for L1 norm in time. More...
 
CepsBool m_ignoreZeroD
 Do not add errors from 0D unknowns. More...
 

Constructor & Destructor Documentation

◆ PdeErrorCalculator()

PdeErrorCalculator::PdeErrorCalculator ( AbstractPdeProblem pb,
CepsReal  dt = 1. 
)
explicit

Constructor with discretization.

Definition at line 34 of file PdeErrorCalculator.cpp.

◆ ~PdeErrorCalculator()

PdeErrorCalculator::~PdeErrorCalculator ( )

Destructor.

Definition at line 55 of file PdeErrorCalculator.cpp.

Member Function Documentation

◆ checkPxPt()

void PdeErrorCalculator::checkPxPt ( CepsInt  px,
CepsInt  pt 
) const
protected

Aborts if pw or pt is not 0,1,2.

Definition at line 178 of file PdeErrorCalculator.cpp.

◆ compute()

void PdeErrorCalculator::compute ( DHVecPtr  num,
CepsReal  time = 0. 
)

Compute the error at current time and add to total.

Definition at line 64 of file PdeErrorCalculator.cpp.

◆ getAbsoluteErrorCumulative()

CepsReal PdeErrorCalculator::getAbsoluteErrorCumulative ( CepsInt  px,
CepsInt  pt 
) const

Get cumulated norm of difference.

Definition at line 130 of file PdeErrorCalculator.cpp.

◆ getAbsoluteErrorNow()

CepsReal PdeErrorCalculator::getAbsoluteErrorNow ( CepsInt  px) const

Get norm of difference at current time.

Definition at line 123 of file PdeErrorCalculator.cpp.

◆ getReferenceNormCumulative()

CepsReal PdeErrorCalculator::getReferenceNormCumulative ( CepsInt  px,
CepsInt  pt 
) const

Get cumulated norm of reference so far.

Definition at line 114 of file PdeErrorCalculator.cpp.

◆ getReferenceNormNow()

CepsReal PdeErrorCalculator::getReferenceNormNow ( CepsInt  px) const

Get norm of reference at current time. p=0 max, p=1 l1 normm, p=2 l2 norm.

Definition at line 107 of file PdeErrorCalculator.cpp.

◆ getRelativeErrorCumulative()

CepsReal PdeErrorCalculator::getRelativeErrorCumulative ( CepsInt  px,
CepsInt  pt 
) const

Get relative cumulated norm of difference.

Definition at line 147 of file PdeErrorCalculator.cpp.

◆ getRelativeErrorNow()

CepsReal PdeErrorCalculator::getRelativeErrorNow ( CepsInt  px) const

Get relative norm of difference at current time.

Definition at line 139 of file PdeErrorCalculator.cpp.

◆ reset()

void PdeErrorCalculator::reset ( )

Reset all cumulated norms.

Definition at line 165 of file PdeErrorCalculator.cpp.

◆ setAnalyticSolution()

void PdeErrorCalculator::setAnalyticSolution ( ceps::Function< CepsReal(CepsStandardArgs)> *  func)

Manually set the analytic solution.

Definition at line 156 of file PdeErrorCalculator.cpp.

Field Documentation

◆ m_dt

CepsReal PdeErrorCalculator::m_dt
protected

Time step, 1 by default,.

Definition at line 105 of file PdeErrorCalculator.hpp.

◆ m_errNow

CepsArray3<CepsReal> PdeErrorCalculator::m_errNow
protected

Norm of difference at current time.

Definition at line 111 of file PdeErrorCalculator.hpp.

◆ m_ignoreZeroD

CepsBool PdeErrorCalculator::m_ignoreZeroD
protected

Do not add errors from 0D unknowns.

Definition at line 126 of file PdeErrorCalculator.hpp.

◆ m_l1TNormsErr

CepsArray3<TimeIntegrator*> PdeErrorCalculator::m_l1TNormsErr
protected

Integrator for L1 norm in time.

Definition at line 123 of file PdeErrorCalculator.hpp.

◆ m_l1TNormsRef

CepsArray3<TimeIntegrator*> PdeErrorCalculator::m_l1TNormsRef
protected

Integrator for L1 norm in time.

Definition at line 120 of file PdeErrorCalculator.hpp.

◆ m_mxTNormsErr

CepsArray3<CepsReal> PdeErrorCalculator::m_mxTNormsErr
protected

max norm in time

Definition at line 117 of file PdeErrorCalculator.hpp.

◆ m_mxTNormsRef

CepsArray3<CepsReal> PdeErrorCalculator::m_mxTNormsRef
protected

max norm in time

Definition at line 114 of file PdeErrorCalculator.hpp.

◆ m_problem

AbstractPdeProblem* PdeErrorCalculator::m_problem
protected

Link to problem.

Definition at line 99 of file PdeErrorCalculator.hpp.

◆ m_refNow

CepsArray3<CepsReal> PdeErrorCalculator::m_refNow
protected

Norm of reference at current time.

Definition at line 108 of file PdeErrorCalculator.hpp.

◆ m_solution

ScalarSAFunc* PdeErrorCalculator::m_solution
protected

Analytic function.

Definition at line 102 of file PdeErrorCalculator.hpp.


The documentation for this class was generated from the following files: