DOLFIN
DOLFIN C++ interface
|
(Goal-oriented) Error Control class. More...
#include <ErrorControl.h>
Public Member Functions | |
ErrorControl (std::shared_ptr< Form > a_star, std::shared_ptr< Form > L_star, std::shared_ptr< Form > residual, std::shared_ptr< Form > a_R_T, std::shared_ptr< Form > L_R_T, std::shared_ptr< Form > a_R_dT, std::shared_ptr< Form > L_R_dT, std::shared_ptr< Form > eta_T, bool is_linear) | |
~ErrorControl () | |
Destructor. | |
double | estimate_error (const Function &u, const std::vector< std::shared_ptr< const DirichletBC > > bcs) |
void | compute_indicators (MeshFunction< double > &indicators, const Function &u) |
void | residual_representation (Function &R_T, SpecialFacetFunction &R_dT, const Function &u) |
void | compute_cell_residual (Function &R_T, const Function &u) |
void | compute_facet_residual (SpecialFacetFunction &R_dT, const Function &u, const Function &R_T) |
void | compute_dual (Function &z, const std::vector< std::shared_ptr< const DirichletBC > > bcs) |
void | compute_extrapolation (const Function &z, const std::vector< std::shared_ptr< const DirichletBC > > bcs) |
Public Member Functions inherited from dolfin::Hierarchical< ErrorControl > | |
Hierarchical (ErrorControl &self) | |
Constructor. | |
virtual | ~Hierarchical () |
Destructor. | |
std::size_t | depth () const |
bool | has_parent () const |
bool | has_child () const |
ErrorControl & | parent () |
const ErrorControl & | parent () const |
Return parent in hierarchy (const version). | |
std::shared_ptr< ErrorControl > | parent_shared_ptr () |
std::shared_ptr< const ErrorControl > | parent_shared_ptr () const |
Return shared pointer to parent (const version). | |
ErrorControl & | child () |
const ErrorControl & | child () const |
Return child in hierarchy (const version). | |
std::shared_ptr< ErrorControl > | child_shared_ptr () |
std::shared_ptr< const ErrorControl > | child_shared_ptr () const |
Return shared pointer to child (const version). | |
ErrorControl & | root_node () |
const ErrorControl & | root_node () const |
Return root node object in hierarchy (const version). | |
std::shared_ptr< ErrorControl > | root_node_shared_ptr () |
std::shared_ptr< const ErrorControl > | root_node_shared_ptr () const |
Return shared pointer to root node object in hierarchy (const version). | |
ErrorControl & | leaf_node () |
const ErrorControl & | leaf_node () const |
Return leaf node object in hierarchy (const version). | |
std::shared_ptr< ErrorControl > | leaf_node_shared_ptr () |
std::shared_ptr< const ErrorControl > | leaf_node_shared_ptr () const |
Return shared pointer to leaf node object in hierarchy (const version). | |
void | set_parent (std::shared_ptr< ErrorControl > parent) |
Set parent. | |
void | clear_child () |
Clear child. | |
void | set_child (std::shared_ptr< ErrorControl > child) |
Set child. | |
const Hierarchical & | operator= (const Hierarchical &hierarchical) |
Assignment operator. | |
void | _debug () const |
Function useful for debugging the hierarchy. | |
Public Member Functions inherited from dolfin::Variable | |
Variable () | |
Create unnamed variable. | |
Variable (const std::string name, const std::string label) | |
Create variable with given name and label. | |
Variable (const Variable &variable) | |
Copy constructor. | |
virtual | ~Variable () |
Destructor. | |
const Variable & | operator= (const Variable &variable) |
Assignment operator. | |
void | rename (const std::string name, const std::string label) |
Rename variable. | |
std::string | name () const |
Return name. | |
std::string | label () const |
Return label (description) | |
std::size_t | id () const |
virtual std::string | str (bool verbose) const |
Return informal string representation (pretty-print) | |
Static Public Member Functions | |
static Parameters | default_parameters () |
Default parameter values. | |
Friends | |
std::shared_ptr< ErrorControl > | adapt (const ErrorControl &ec, std::shared_ptr< const Mesh > adapted_mesh, bool adapt_coefficients) |
Additional Inherited Members | |
Public Attributes inherited from dolfin::Variable | |
Parameters | parameters |
Parameters. | |
(Goal-oriented) Error Control class.
The notation used here follows the notation in "Automated goal-oriented error control I: stationary variational problems", ME Rognes and A Logg, 2010-2011.
ErrorControl::ErrorControl | ( | std::shared_ptr< Form > | a_star, |
std::shared_ptr< Form > | L_star, | ||
std::shared_ptr< Form > | residual, | ||
std::shared_ptr< Form > | a_R_T, | ||
std::shared_ptr< Form > | L_R_T, | ||
std::shared_ptr< Form > | a_R_dT, | ||
std::shared_ptr< Form > | L_R_dT, | ||
std::shared_ptr< Form > | eta_T, | ||
bool | is_linear | ||
) |
Create error control object
a_star | (Form) the bilinear form for the dual problem |
L_star | (Form) the linear form for the dual problem |
residual | (Form) a functional for the residual (error estimate) |
a_R_T | (Form) the bilinear form for the strong cell residual problem |
L_R_T | (Form) the linear form for the strong cell residual problem |
a_R_dT | (Form) the bilinear form for the strong facet residual problem |
L_R_dT | (Form) the linear form for the strong facet residual problem |
eta_T | (Form) a linear form over DG_0 for error indicators |
is_linear | (bool) true iff primal problem is linear |
void ErrorControl::compute_dual | ( | Function & | z, |
const std::vector< std::shared_ptr< const DirichletBC > > | bcs | ||
) |
Compute dual approximation defined by dual variational problem and dual boundary conditions given by homogenized primal boundary conditions.
z | (Function) the dual approximation (to be computed) |
bcs | (std::vector<DirichletBC>) the primal boundary conditions |
void ErrorControl::compute_extrapolation | ( | const Function & | z, |
const std::vector< std::shared_ptr< const DirichletBC > > | bcs | ||
) |
Compute extrapolation with boundary conditions
z | (Function) the extrapolated function (to be computed) |
bcs | (std::vector<DirichletBC>) the dual boundary conditions |
void ErrorControl::compute_facet_residual | ( | SpecialFacetFunction & | R_dT, |
const Function & | u, | ||
const Function & | R_T | ||
) |
Compute representation for the strong facet residual from the weak residual and the strong cell residual
R_dT | (SpecialFacetFunction) the strong facet residual (to be computed) |
u | (Function) the primal approximation |
R_T | (Function) the strong cell residual |
void ErrorControl::compute_indicators | ( | MeshFunction< double > & | indicators, |
const Function & | u | ||
) |
Compute error indicators
indicators | (MeshFunction<double>) the error indicators (to be computed) |
u | (Function) the primal approximation |
double ErrorControl::estimate_error | ( | const Function & | u, |
const std::vector< std::shared_ptr< const DirichletBC > > | bcs | ||
) |
Estimate the error relative to the goal M of the discrete approximation 'u' relative to the variational formulation by evaluating the weak residual at an approximation to the dual solution.
u | (Function) the primal approximation |
bcs | (std::vector<DirichletBC>) the primal boundary conditions |
void ErrorControl::residual_representation | ( | Function & | R_T, |
SpecialFacetFunction & | R_dT, | ||
const Function & | u | ||
) |
Compute strong representation (strong cell and facet residuals) of the weak residual.
R_T | (Function) the strong cell residual (to be computed) |
R_dT | (SpecialFacetFunction) the strong facet residual (to be computed) |
u | (Function) the primal approximation |
|
friend |
Adapt error control object based on adapted mesh
ec | (ErrorControl) The error control object to be adapted |
adapted_mesh | (Mesh) The new mesh |
adapt_coefficients | (bool) Optional argument, default is true. If false, any form coefficients are not explicitly adapted, but pre-adapted coefficients will be transferred. |