DOLFIN
DOLFIN C++ interface
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dolfin::GenericAdaptiveVariationalSolver Class Referenceabstract

#include <GenericAdaptiveVariationalSolver.h>

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

Public Member Functions

void solve (const double tol)
 
virtual std::shared_ptr< const Functionsolve_primal ()=0
 
virtual std::vector< std::shared_ptr< const DirichletBC > > extract_bcs () const =0
 
virtual double evaluate_goal (Form &M, std::shared_ptr< const Function > u) const =0
 
virtual void adapt_problem (std::shared_ptr< const Mesh > mesh)=0
 
std::vector< std::shared_ptr< Parameters > > adaptive_data () const
 
void summary ()
 Present summary of all adaptive data and parameters.
 
- 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 ()
 

Protected Member Functions

virtual std::size_t num_dofs_primal ()=0
 

Protected Attributes

std::shared_ptr< Formgoal
 The goal functional.
 
std::shared_ptr< ErrorControlcontrol
 Error control object.
 
std::vector< std::shared_ptr< Parameters > > _adaptive_data
 

Additional Inherited Members

- Public Attributes inherited from dolfin::Variable
Parameters parameters
 Parameters.
 

Detailed Description

An abstract class for goal-oriented adaptive solution of variational problems.

Member Function Documentation

◆ adapt_problem()

virtual void dolfin::GenericAdaptiveVariationalSolver::adapt_problem ( std::shared_ptr< const Mesh mesh)
pure virtual

Adapt the problem to other mesh. Must be overloaded in subclass.

Arguments mesh (Mesh) The other mesh

Implemented in dolfin::AdaptiveNonlinearVariationalSolver, and dolfin::AdaptiveLinearVariationalSolver.

◆ adaptive_data()

std::vector< std::shared_ptr< Parameters > > GenericAdaptiveVariationalSolver::adaptive_data ( ) const

Return stored adaptive data

Returns std::vector<Parameters> The data stored in the adaptive loop

◆ default_parameters()

static Parameters dolfin::GenericAdaptiveVariationalSolver::default_parameters ( )
inlinestatic

Default parameter values:

"max_iterations"     (int)
"max_dimension"      (int)
"save_data"          (bool)
"data_label"         (std::string)
"reference"          (double)
"marking_strategy"   (std::string)
"marking_fraction"   (double)  

◆ evaluate_goal()

virtual double dolfin::GenericAdaptiveVariationalSolver::evaluate_goal ( Form M,
std::shared_ptr< const Function u 
) const
pure virtual

Evaluate the goal functional. Must be overloaded in subclass.

Arguments M (Form) The functional to be evaluated u (Function) The function of which to evaluate the functional

Returns double The value of M evaluated at u

Implemented in dolfin::AdaptiveNonlinearVariationalSolver, and dolfin::AdaptiveLinearVariationalSolver.

◆ extract_bcs()

virtual std::vector<std::shared_ptr<const DirichletBC> > dolfin::GenericAdaptiveVariationalSolver::extract_bcs ( ) const
pure virtual

Extract the boundary conditions for the primal problem. Must be overloaded in subclass.

Returns std::vector<DirichletBC> The primal boundary conditions

Implemented in dolfin::AdaptiveNonlinearVariationalSolver, and dolfin::AdaptiveLinearVariationalSolver.

◆ num_dofs_primal()

virtual std::size_t dolfin::GenericAdaptiveVariationalSolver::num_dofs_primal ( )
protectedpure virtual

Return the number of degrees of freedom for primal problem

Returns std::size_t The number of degrees of freedom

Implemented in dolfin::AdaptiveNonlinearVariationalSolver, and dolfin::AdaptiveLinearVariationalSolver.

◆ solve()

void GenericAdaptiveVariationalSolver::solve ( const double  tol)

Solve such that the functional error is less than the given tolerance. Note that each call to solve is based on the leaf-node of the variational problem

Arguments tol (double) The error tolerance

◆ solve_primal()

virtual std::shared_ptr<const Function> dolfin::GenericAdaptiveVariationalSolver::solve_primal ( )
pure virtual

Solve the primal problem. Must be overloaded in subclass.

Returns Function The solution to the primal problem

Implemented in dolfin::AdaptiveNonlinearVariationalSolver, and dolfin::AdaptiveLinearVariationalSolver.


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