Loading...
Searching...
No Matches
MeshView.h
// Copyright (C) 2017 Chris Richardson
//
// 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/>.
//
#ifndef __MESH_VIEW_H
#define __MESH_VIEW_H
namespace dolfin
{
// Forward declarations
class Mesh;
template <typename T> class MeshFunction;
class MeshView
{
public:
MeshView(std::shared_ptr<const Mesh> parent_mesh,
std::vector<std::size_t>& vertex_map,
std::vector<std::size_t>& cell_map)
: _mesh(parent_mesh), _vertex_map(vertex_map), _cell_map(cell_map)
{
// Do nothing
}
std::shared_ptr<const Mesh> mesh() const
{
return _mesh;
}
const std::vector<std::size_t>& vertex_map() const
{
return _vertex_map;
}
const std::vector<std::size_t>& cell_map() const
{
return _cell_map;
}
static Mesh create(const MeshFunction<std::size_t>& marker, std::size_t tag);
private:
// The parent mesh which this mapping points to
std::shared_ptr<const Mesh> _mesh;
// Map to vertices in _mesh
std::vector<std::size_t> _vertex_map;
// Map to cells in _mesh
std::vector<std::size_t> _cell_map;
};
}
#endif
dolfin::MeshFunction
Definition MeshFunction.h:58
dolfin::MeshView::vertex_map
const std::vector< std::size_t > & vertex_map() const
Map to vertices of parent mesh.
Definition MeshView.h:51
dolfin::MeshView::mesh
std::shared_ptr< const Mesh > mesh() const
Access parent mesh.
Definition MeshView.h:45
dolfin::MeshView::MeshView
MeshView(std::shared_ptr< const Mesh > parent_mesh, std::vector< std::size_t > &vertex_map, std::vector< std::size_t > &cell_map)
Constructor.
Definition MeshView.h:36
dolfin::MeshView::create
static Mesh create(const MeshFunction< std::size_t > &marker, std::size_t tag)
Definition MeshView.cpp:28
dolfin::MeshView::cell_map
const std::vector< std::size_t > & cell_map() const
Map to cells of parent mesh.
Definition MeshView.h:57
dolfin::Mesh
Definition Mesh.h:84
dolfin
Definition adapt.h:30