Loading...
Searching...
No Matches
AdaptiveLinearVariationalSolver.h
// Copyright (C) 2010--2012 Marie E. Rognes
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// Modified by Anders Logg, 2010-2011.
// Modified by Garth N. Wells, 2011.
//
// First added: 2010-08-19
// Last changed: 2012-11-14
#ifndef __ADAPTIVE_LINEAR_VARIATIONAL_SOLVER_H
#define __ADAPTIVE_LINEAR_VARIATIONAL_SOLVER_H
#include <memory>
#include "GenericAdaptiveVariationalSolver.h"
namespace dolfin
{
// Forward declarations
class DirichletBC;
class Form;
class Function;
class LinearVariationalProblem;
class GoalFunctional;
class Mesh;
class AdaptiveLinearVariationalSolver
: public GenericAdaptiveVariationalSolver
{
public:
AdaptiveLinearVariationalSolver(std::shared_ptr<LinearVariationalProblem> problem,
std::shared_ptr<GoalFunctional> goal);
AdaptiveLinearVariationalSolver(std::shared_ptr<LinearVariationalProblem> problem,
std::shared_ptr<Form> goal,
std::shared_ptr<ErrorControl> control);
~AdaptiveLinearVariationalSolver() {}
virtual std::shared_ptr<const Function> solve_primal();
virtual std::vector<std::shared_ptr<const DirichletBC>> extract_bcs() const;
virtual double evaluate_goal(Form& M,
std::shared_ptr<const Function> u) const;
virtual void adapt_problem(std::shared_ptr<const Mesh> mesh);
protected:
virtual std::size_t num_dofs_primal();
private:
void init(std::shared_ptr<LinearVariationalProblem> problem,
std::shared_ptr<GoalFunctional> goal);
// The primal problem
std::shared_ptr<LinearVariationalProblem> _problem;
};
}
#endif
dolfin::AdaptiveLinearVariationalSolver::extract_bcs
virtual std::vector< std::shared_ptr< const DirichletBC > > extract_bcs() const
Definition AdaptiveLinearVariationalSolver.cpp:97
dolfin::AdaptiveLinearVariationalSolver::evaluate_goal
virtual double evaluate_goal(Form &M, std::shared_ptr< const Function > u) const
Definition AdaptiveLinearVariationalSolver.cpp:104
dolfin::AdaptiveLinearVariationalSolver::solve_primal
virtual std::shared_ptr< const Function > solve_primal()
Definition AdaptiveLinearVariationalSolver.cpp:87
dolfin::AdaptiveLinearVariationalSolver::adapt_problem
virtual void adapt_problem(std::shared_ptr< const Mesh > mesh)
Definition AdaptiveLinearVariationalSolver.cpp:112
dolfin::AdaptiveLinearVariationalSolver::~AdaptiveLinearVariationalSolver
~AdaptiveLinearVariationalSolver()
Destructor.
Definition AdaptiveLinearVariationalSolver.h:93
dolfin::AdaptiveLinearVariationalSolver::num_dofs_primal
virtual std::size_t num_dofs_primal()
Definition AdaptiveLinearVariationalSolver.cpp:118
dolfin::AdaptiveLinearVariationalSolver::AdaptiveLinearVariationalSolver
AdaptiveLinearVariationalSolver(std::shared_ptr< LinearVariationalProblem > problem, std::shared_ptr< GoalFunctional > goal)
Definition AdaptiveLinearVariationalSolver.cpp:39
dolfin::DirichletBC
Interface for setting (strong) Dirichlet boundary conditions.
Definition DirichletBC.h:125
dolfin::Form
Base class for UFC code generated by FFC for DOLFIN with option -l.
Definition Form.h:86
dolfin::Function
Definition Function.h:66
dolfin::GenericAdaptiveVariationalSolver
Definition GenericAdaptiveVariationalSolver.h:46
dolfin::GenericAdaptiveVariationalSolver::goal
std::shared_ptr< Form > goal
The goal functional.
Definition GenericAdaptiveVariationalSolver.h:139
dolfin::GenericAdaptiveVariationalSolver::control
std::shared_ptr< ErrorControl > control
Error control object.
Definition GenericAdaptiveVariationalSolver.h:142
dolfin::GoalFunctional
Definition GoalFunctional.h:35
dolfin::LinearVariationalProblem
Definition LinearVariationalProblem.h:43
dolfin::Mesh
Definition Mesh.h:84
dolfin
Definition adapt.h:30
dolfin::init
void init(int argc, char *argv[])
Definition init.cpp:27