Loading...
Searching...
No Matches
MultiMeshDofMap.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-19
// Last changed: 2016-03-02
#ifndef __MULTI_MESH_DOF_MAP_H
#define __MULTI_MESH_DOF_MAP_H
#include "GenericDofMap.h"
#include <dolfin/mesh/MultiMesh.h>
namespace dolfin
{
// Forward declarations
class MultiMeshFunctionSpace;
class MultiMesh;
class MultiMeshDofMap
{
public:
MultiMeshDofMap();
MultiMeshDofMap(const MultiMeshDofMap& dofmap);
~MultiMeshDofMap();
std::size_t num_parts() const;
std::shared_ptr<const GenericDofMap> part(std::size_t i) const;
void add(std::shared_ptr<const GenericDofMap> dofmap);
void build(const MultiMeshFunctionSpace& function_space,
const std::vector<dolfin::la_index>& offsets);
void clear();
std::size_t global_dimension() const;
std::pair<std::size_t, std::size_t> ownership_range() const;
const std::vector<int>& off_process_owner() const;
std::shared_ptr<IndexMap> index_map() const;
std::string str(bool verbose) const;
std::vector<dolfin::la_index> inactive_dofs(const MultiMesh &multimesh,
std::size_t part_id) const;
private:
// Index Map containing total global dimension (sum of parts)
// FIXME: make it work in parallel
std::shared_ptr<IndexMap> _index_map;
// List of original dofmaps
std::vector<std::shared_ptr<const GenericDofMap>> _original_dofmaps;
// List of modified dofmaps
std::vector<std::shared_ptr<GenericDofMap>> _new_dofmaps;
};
}
#endif
dolfin::MultiMeshDofMap::num_parts
std::size_t num_parts() const
Definition MultiMeshDofMap.cpp:50
dolfin::MultiMeshDofMap::part
std::shared_ptr< const GenericDofMap > part(std::size_t i) const
Definition MultiMeshDofMap.cpp:55
dolfin::MultiMeshDofMap::MultiMeshDofMap
MultiMeshDofMap()
Constructor.
Definition MultiMeshDofMap.cpp:33
dolfin::MultiMeshDofMap::add
void add(std::shared_ptr< const GenericDofMap > dofmap)
Definition MultiMeshDofMap.cpp:61
dolfin::MultiMeshDofMap::global_dimension
std::size_t global_dimension() const
Definition MultiMeshDofMap.cpp:126
dolfin::MultiMeshDofMap::ownership_range
std::pair< std::size_t, std::size_t > ownership_range() const
Definition MultiMeshDofMap.cpp:131
dolfin::MultiMeshDofMap::str
std::string str(bool verbose) const
Return informal string representation (pretty-print).
Definition MultiMeshDofMap.cpp:150
dolfin::MultiMeshDofMap::clear
void clear()
Clear MultiMesh dofmap.
Definition MultiMeshDofMap.cpp:119
dolfin::MultiMeshDofMap::index_map
std::shared_ptr< IndexMap > index_map() const
Return the map.
Definition MultiMeshDofMap.cpp:144
dolfin::MultiMeshDofMap::~MultiMeshDofMap
~MultiMeshDofMap()
Destructor.
Definition MultiMeshDofMap.cpp:45
dolfin::MultiMeshDofMap::inactive_dofs
std::vector< dolfin::la_index > inactive_dofs(const MultiMesh &multimesh, std::size_t part_id) const
Return inactive dofs.
Definition MultiMeshDofMap.cpp:163
dolfin::MultiMeshDofMap::build
void build(const MultiMeshFunctionSpace &function_space, const std::vector< dolfin::la_index > &offsets)
Build MultiMesh dofmap.
Definition MultiMeshDofMap.cpp:68
dolfin::MultiMeshDofMap::off_process_owner
const std::vector< int > & off_process_owner() const
Definition MultiMeshDofMap.cpp:138
dolfin::MultiMeshFunctionSpace
Definition MultiMeshFunctionSpace.h:48
dolfin::MultiMesh
Definition MultiMesh.h:51
dolfin
Definition adapt.h:30