DOLFIN
DOLFIN C++ interface
SubMesh.h
1 // Copyright (C) 2009 Anders Logg
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2009-02-11
19 // Last changed: 2013-02-11
20 
21 #ifndef __SUB_MESH_H
22 #define __SUB_MESH_H
23 
24 #include <map>
25 #include "Mesh.h"
26 
27 namespace dolfin
28 {
29 
30  class SubDomain;
31  template <typename T> class MeshFunction;
32 
39 
40  class SubMesh : public Mesh
41  {
42  public:
43 
45  SubMesh(const Mesh& mesh, const SubDomain& sub_domain);
46 
48  SubMesh(const Mesh& mesh, const MeshFunction<std::size_t>& sub_domains,
49  std::size_t sub_domain);
50 
52  SubMesh(const Mesh& mesh, std::size_t sub_domain);
53 
55  ~SubMesh();
56 
57  private:
58 
60  void init(const Mesh& mesh, const std::vector<std::size_t>& sub_domains,
61  std::size_t sub_domain);
62 
63  };
64 
65 }
66 
67 #endif
Definition: SubDomain.h:42
void init() const
Compute all entities and connectivity.
Definition: Mesh.cpp:216
Definition: adapt.h:29
~SubMesh()
Destructor.
Definition: SubMesh.cpp:96
Definition: SubMesh.h:40
SubMesh(const Mesh &mesh, const SubDomain &sub_domain)
Create subset of given mesh marked by sub domain.
Definition: SubMesh.cpp:39
Definition: Mesh.h:82