Skip to content

Commit

Permalink
Default extra_order in error estimation to 1
Browse files Browse the repository at this point in the history
Our default quadrature rules integrate polynomial degree 2p+1 exactly,
which is good enough for even a mass matrix assembly, but which *isn't*
good enough to take an L2 norm of the order-p+1 error term in a degree-p
approximate solution.
  • Loading branch information
roystgnr committed Oct 25, 2023
1 parent edc1058 commit e8cec18
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions include/error_estimation/exact_error_estimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,16 @@ class ExactErrorEstimator : public ErrorEstimator
*/
void attach_reference_solution (EquationSystems * es_fine);


/**
* Increases or decreases the order of the quadrature rule used for numerical
* integration.
* integration. The default \p extraorder is 1, because properly
* integrating L2 error requires integrating the squares of terms
* with order p+1, and 2p+2 is 1 higher than what we default to
* using for reasonable mass matrix integration.
*/
void extra_quadrature_order (const int extraorder)
{ _extra_order = extraorder; }


// Bring the base class functionality into the name lookup
// procedure. This allows for alternative calling formats
// defined in the base class. Thanks Wolfgang.
Expand Down
5 changes: 4 additions & 1 deletion include/error_estimation/exact_solution.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ class ExactSolution

/**
* Increases or decreases the order of the quadrature rule used for numerical
* integration.
* integration. The default \p extraorder is 1, because properly
* integrating L2 error requires integrating the squares of terms
* with order p+1, and 2p+2 is 1 higher than what we default to
* using for reasonable mass matrix integration.
*/
void extra_quadrature_order (const int extraorder)
{ _extra_order = extraorder; }
Expand Down
2 changes: 1 addition & 1 deletion src/error_estimation/exact_error_estimator.C
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ExactErrorEstimator::ExactErrorEstimator() :
_exact_deriv(nullptr),
_exact_hessian(nullptr),
_equation_systems_fine(nullptr),
_extra_order(0)
_extra_order(1)
{
error_norm = H1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/error_estimation/exact_solution.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace libMesh
ExactSolution::ExactSolution(const EquationSystems & es) :
_equation_systems(es),
_equation_systems_fine(nullptr),
_extra_order(0)
_extra_order(1)
{
// Initialize the _errors data structure which holds all
// the eventual values of the error.
Expand Down

0 comments on commit e8cec18

Please sign in to comment.