Loading...
Searching...
No Matches
MultiMeshForm.h
// Copyright (C) 2013-2016 Anders Logg
//
// 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: 2013-09-12
// Last changed: 2016-03-02
#ifndef __MULTI_MESH_FORM_H
#define __MULTI_MESH_FORM_H
#include <vector>
#include <memory>
namespace dolfin
{
// Forward declarations
class MultiMeshFunctionSpace;
class MultiMeshFunction;
class MultiMesh;
class Form;
class MultiMeshForm
{
public:
// FIXME: Test multimesh functionals. Should likely require a multimesh
// when instaniated and this constructor should then be removed.
MultiMeshForm() {}
MultiMeshForm(std::shared_ptr<const MultiMesh> multimesh);
MultiMeshForm(std::shared_ptr<const MultiMeshFunctionSpace> function_space);
MultiMeshForm(std::shared_ptr<const MultiMeshFunctionSpace> function_space_0,
std::shared_ptr<const MultiMeshFunctionSpace> function_space_1);
~MultiMeshForm();
std::size_t rank() const;
std::size_t num_parts() const;
std::shared_ptr<const MultiMesh> multimesh() const;
std::shared_ptr<const Form> part(std::size_t i) const;
std::shared_ptr<const MultiMeshFunctionSpace> function_space(std::size_t i) const;
void add(std::shared_ptr<const Form> form);
void build();
void clear();
void set_multimesh_coefficient(std::size_t i,
std::shared_ptr<const MultiMeshFunction> coefficient);
std::map<std::size_t, std::shared_ptr<const MultiMeshFunction>> multimesh_coefficients() const;
std::shared_ptr<const MultiMeshFunction> multimesh_coefficient(std::size_t i) const;
std::vector<std::size_t> multimesh_coefficient_keys() const;
private:
// The rank of the form
std::size_t _rank;
// Multimesh
std::shared_ptr<const MultiMesh> _multimesh;
// Function spaces (one for each argument)
std::vector<std::shared_ptr<const MultiMeshFunctionSpace>> _function_spaces;
// List of forms (one for each part)
std::vector<std::shared_ptr<const Form>> _forms;
// Map of MultiMesh coefficents
std::map<std::size_t, std::shared_ptr<const MultiMeshFunction>> _multimesh_coefficients;
};
}
#endif
dolfin::Form
Base class for UFC code generated by FFC for DOLFIN with option -l.
Definition Form.h:86
dolfin::MultiMeshForm::num_parts
std::size_t num_parts() const
Definition MultiMeshForm.cpp:60
dolfin::MultiMeshForm::multimesh_coefficient
std::shared_ptr< const MultiMeshFunction > multimesh_coefficient(std::size_t i) const
Get one multimesh coefficient.
Definition MultiMeshForm.cpp:166
dolfin::MultiMeshForm::rank
std::size_t rank() const
Definition MultiMeshForm.cpp:55
dolfin::MultiMeshForm::set_multimesh_coefficient
void set_multimesh_coefficient(std::size_t i, std::shared_ptr< const MultiMeshFunction > coefficient)
Set MultiMeshCoeeficient.
Definition MultiMeshForm.cpp:152
dolfin::MultiMeshForm::multimesh_coefficient_keys
std::vector< std::size_t > multimesh_coefficient_keys() const
Get multimesh coefficient keys.
Definition MultiMeshForm.cpp:172
dolfin::MultiMeshForm::clear
void clear()
Clear MultiMesh form.
Definition MultiMeshForm.cpp:144
dolfin::MultiMeshForm::part
std::shared_ptr< const Form > part(std::size_t i) const
Definition MultiMeshForm.cpp:103
dolfin::MultiMeshForm::build
void build()
Build MultiMesh form.
Definition MultiMeshForm.cpp:123
dolfin::MultiMeshForm::~MultiMeshForm
~MultiMeshForm()
Destructor.
Definition MultiMeshForm.cpp:50
dolfin::MultiMeshForm::function_space
std::shared_ptr< const MultiMeshFunctionSpace > function_space(std::size_t i) const
Definition MultiMeshForm.cpp:110
dolfin::MultiMeshForm::multimesh
std::shared_ptr< const MultiMesh > multimesh() const
Definition MultiMeshForm.cpp:65
dolfin::MultiMeshForm::multimesh_coefficients
std::map< std::size_t, std::shared_ptr< const MultiMeshFunction > > multimesh_coefficients() const
Get all MultiMesh Coefficients.
Definition MultiMeshForm.cpp:160
dolfin::MultiMeshForm::add
void add(std::shared_ptr< const Form > form)
Definition MultiMeshForm.cpp:116
dolfin::MultiMeshFunctionSpace
Definition MultiMeshFunctionSpace.h:48
dolfin::MultiMeshFunction
Definition MultiMeshFunction.h:43
dolfin::MultiMesh
Definition MultiMesh.h:51
dolfin
Definition adapt.h:30