DOLFIN
DOLFIN C++ interface
Public Member Functions | Static Public Member Functions | Friends | List of all members
dolfin::ErrorControl Class Reference

(Goal-oriented) Error Control class. More...

#include <ErrorControl.h>

Inheritance diagram for dolfin::ErrorControl:
Inheritance graph
[legend]
Collaboration diagram for dolfin::ErrorControl:
Collaboration graph
[legend]

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
 
ErrorControlparent ()
 
const ErrorControlparent () const
 Return parent in hierarchy (const version).
 
std::shared_ptr< ErrorControlparent_shared_ptr ()
 
std::shared_ptr< const ErrorControlparent_shared_ptr () const
 Return shared pointer to parent (const version).
 
ErrorControlchild ()
 
const ErrorControlchild () const
 Return child in hierarchy (const version).
 
std::shared_ptr< ErrorControlchild_shared_ptr ()
 
std::shared_ptr< const ErrorControlchild_shared_ptr () const
 Return shared pointer to child (const version).
 
ErrorControlroot_node ()
 
const ErrorControlroot_node () const
 Return root node object in hierarchy (const version).
 
std::shared_ptr< ErrorControlroot_node_shared_ptr ()
 
std::shared_ptr< const ErrorControlroot_node_shared_ptr () const
 Return shared pointer to root node object in hierarchy (const version).
 
ErrorControlleaf_node ()
 
const ErrorControlleaf_node () const
 Return leaf node object in hierarchy (const version).
 
std::shared_ptr< ErrorControlleaf_node_shared_ptr ()
 
std::shared_ptr< const ErrorControlleaf_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 Hierarchicaloperator= (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 Variableoperator= (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< ErrorControladapt (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.
 

Detailed Description

(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.

Constructor & Destructor Documentation

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

Parameters
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

Member Function Documentation

void ErrorControl::compute_cell_residual ( Function R_T,
const Function u 
)

Compute representation for the strong cell residual from the weak residual

Parameters
R_T(Function) the strong cell residual (to be computed)
u(Function) the primal approximation
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.

Parameters
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

Parameters
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

Parameters
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

Parameters
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.

Parameters
u(Function) the primal approximation
bcs(std::vector<DirichletBC>) the primal boundary conditions
Returns
double error estimate
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.

Parameters
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

Friends And Related Function Documentation

std::shared_ptr<ErrorControl> adapt ( const ErrorControl ec,
std::shared_ptr< const Mesh adapted_mesh,
bool  adapt_coefficients 
)
friend

Adapt error control object based on adapted mesh

Parameters
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.
Returns
ErrorControl The adapted error control object

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