Loading...
Searching...
No Matches
adapt.h
// Copyright (C) 2010-2011 Anders Logg, Marie Rognes and Garth N. Wells
//
// 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/>.
//
// First added: 2010-02-10
// Last changed: 2011-10-11
//
// This file defines free functions for refinement/adaption of meshes,
// function spaces, functions etc.
#ifndef __DOLFIN_ADAPT_H
#define __DOLFIN_ADAPT_H
#include <vector>
namespace dolfin
{
// Forward declarations
class DirichletBC;
class ErrorControl;
class Form;
class Function;
class FunctionSpace;
class GenericFunction;
class LinearVariationalProblem;
class Mesh;
template <typename T> class MeshFunction;
class NonlinearVariationalProblem;
//--- Refinement of meshes ---
std::shared_ptr<Mesh> adapt(const Mesh& mesh);
std::shared_ptr<Mesh> adapt(const Mesh& mesh,
const MeshFunction<bool>& cell_markers);
//--- Refinement of function spaces ---
std::shared_ptr<FunctionSpace> adapt(const FunctionSpace& space);
std::shared_ptr<FunctionSpace> adapt(const FunctionSpace& space,
const MeshFunction<bool>& cell_markers);
std::shared_ptr<FunctionSpace> adapt(const FunctionSpace& space,
std::shared_ptr<const Mesh> adapted_mesh);
//--- Refinement of functions ---
std::shared_ptr<Function> adapt(const Function& function,
std::shared_ptr<const Mesh> adapted_mesh,
bool interpolate=true);
std::shared_ptr<GenericFunction>
adapt(std::shared_ptr<const GenericFunction> function,
std::shared_ptr<const Mesh> adapted_mesh);
std::shared_ptr<MeshFunction<std::size_t>>
adapt(const MeshFunction<std::size_t>& mesh_function,
std::shared_ptr<const Mesh> adapted_mesh);
//--- Refinement of boundary conditions ---
std::shared_ptr<DirichletBC> adapt(const DirichletBC& bc,
std::shared_ptr<const Mesh> adapted_mesh,
const FunctionSpace& S);
void adapt_markers(std::vector<std::size_t>& refined_markers,
const Mesh& adapted_mesh,
const std::vector<std::size_t>& markers,
const Mesh& mesh);
//--- Refinement of forms ---
std::shared_ptr<Form> adapt(const Form& form,
std::shared_ptr<const Mesh> adapted_mesh,
bool adapt_coefficients=true);
//--- Refinement of variational problems ---
std::shared_ptr<LinearVariationalProblem>
adapt(const LinearVariationalProblem& problem,
std::shared_ptr<const Mesh> adapted_mesh);
std::shared_ptr<NonlinearVariationalProblem>
adapt(const NonlinearVariationalProblem& problem,
std::shared_ptr<const Mesh> adapted_mesh);
std::shared_ptr<ErrorControl> adapt(const ErrorControl& ec,
std::shared_ptr<const Mesh> adapted_mesh,
bool adapt_coefficients=true);
}
#endif
dolfin::DirichletBC
Interface for setting (strong) Dirichlet boundary conditions.
Definition DirichletBC.h:125
dolfin::ErrorControl
(Goal-oriented) Error Control class.
Definition ErrorControl.h:51
dolfin::Form
Base class for UFC code generated by FFC for DOLFIN with option -l.
Definition Form.h:86
dolfin::FunctionSpace
Definition FunctionSpace.h:54
dolfin::Function
Definition Function.h:66
dolfin::GenericFunction
Definition GenericFunction.h:54
dolfin::LinearVariationalProblem
Definition LinearVariationalProblem.h:43
dolfin::MeshFunction
Definition MeshFunction.h:58
dolfin::Mesh
Definition Mesh.h:84
dolfin::NonlinearVariationalProblem
Definition NonlinearVariationalProblem.h:47
dolfin
Definition adapt.h:30
dolfin::adapt
std::shared_ptr< Mesh > adapt(const Mesh &mesh)
Definition adapt.cpp:56
dolfin::adapt_markers
void adapt_markers(std::vector< std::size_t > &refined_markers, const Mesh &adapted_mesh, const std::vector< std::size_t > &markers, const Mesh &mesh)
Helper function for refinement of boundary conditions.
Definition adapt.cpp:590