Loading...
Searching...
No Matches
MultiMeshFunctionSpace.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-08-05
// Last changed: 2017-09-22
#ifndef __MULTI_MESH_FUNCTION_SPACE_H
#define __MULTI_MESH_FUNCTION_SPACE_H
#include <vector>
#include <map>
#include <memory>
#include <dolfin/common/types.h>
#include <dolfin/common/Variable.h>
#include <dolfin/mesh/MultiMesh.h>
namespace dolfin
{
// Forward declarations
class GenericMatrix;
class GenericVector;
class FunctionSpace;
class MultiMeshDofMap;
class MultiMeshFunctionSpace : public Variable
{
public:
MultiMeshFunctionSpace(std::shared_ptr<const MultiMesh> multimesh);
~MultiMeshFunctionSpace();
std::size_t dim() const;
std::shared_ptr<const MultiMesh> multimesh() const;
std::shared_ptr<const MultiMeshDofMap> dofmap() const;
std::size_t num_parts() const;
std::shared_ptr<const FunctionSpace> part(std::size_t i) const;
std::shared_ptr<const FunctionSpace> view(std::size_t i) const;
void add(std::shared_ptr<const FunctionSpace> function_space);
void build();
void build(const std::vector<dolfin::la_index>& offsets);
void lock_inactive_dofs(GenericMatrix &A, GenericVector &b) const;
private:
// Friends
friend class MultiMeshSubSpace;
// List of function spaces
std::vector<std::shared_ptr<const FunctionSpace> > _function_spaces;
// List of function space views
std::vector<std::shared_ptr<const FunctionSpace> > _function_space_views;
// Multimesh
std::shared_ptr<const MultiMesh> _multimesh;
// Multimesh dofmap
std::shared_ptr<MultiMeshDofMap> _dofmap;
// Quadrature order
std::size_t _quadrature_order;
// Build multimesh
void _build_multimesh();
// Build dofmap
void _build_dofmap(const std::vector<dolfin::la_index>& offsets);
// Build views
void _build_views();
};
}
#endif
dolfin::FunctionSpace
Definition FunctionSpace.h:54
dolfin::GenericMatrix
This class defines a common interface for matrices.
Definition GenericMatrix.h:47
dolfin::GenericVector
This class defines a common interface for vectors.
Definition GenericVector.h:48
dolfin::MultiMeshDofMap
Definition MultiMeshDofMap.h:38
dolfin::MultiMeshFunctionSpace::dim
std::size_t dim() const
Definition MultiMeshFunctionSpace.cpp:56
dolfin::MultiMeshFunctionSpace::num_parts
std::size_t num_parts() const
Definition MultiMeshFunctionSpace.cpp:74
dolfin::MultiMeshFunctionSpace::dofmap
std::shared_ptr< const MultiMeshDofMap > dofmap() const
Definition MultiMeshFunctionSpace.cpp:68
dolfin::MultiMeshFunctionSpace::build
void build()
Build multimesh function space.
Definition MultiMeshFunctionSpace.cpp:101
dolfin::MultiMeshFunctionSpace::part
std::shared_ptr< const FunctionSpace > part(std::size_t i) const
Definition MultiMeshFunctionSpace.cpp:80
dolfin::MultiMeshFunctionSpace::view
std::shared_ptr< const FunctionSpace > view(std::size_t i) const
Definition MultiMeshFunctionSpace.cpp:87
dolfin::MultiMeshFunctionSpace::lock_inactive_dofs
void lock_inactive_dofs(GenericMatrix &A, GenericVector &b) const
Lock inactive dofs of a system.
Definition MultiMeshFunctionSpace.cpp:169
dolfin::MultiMeshFunctionSpace::MultiMeshFunctionSpace
MultiMeshFunctionSpace(std::shared_ptr< const MultiMesh > multimesh)
Create multimesh function space on multimesh (shared pointer version).
Definition MultiMeshFunctionSpace.cpp:38
dolfin::MultiMeshFunctionSpace::add
void add(std::shared_ptr< const FunctionSpace > function_space)
Definition MultiMeshFunctionSpace.cpp:94
dolfin::MultiMeshFunctionSpace::multimesh
std::shared_ptr< const MultiMesh > multimesh() const
Definition MultiMeshFunctionSpace.cpp:62
dolfin::MultiMeshFunctionSpace::~MultiMeshFunctionSpace
~MultiMeshFunctionSpace()
Destructor.
Definition MultiMeshFunctionSpace.cpp:51
dolfin::Variable::Variable
Variable()
Create unnamed variable.
Definition Variable.cpp:31
dolfin
Definition adapt.h:30