Flow123d  JS_before_hm-1717-gd762018d2
bc_mesh.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file bc_mesh.h
15  * @brief
16  */
17 
18 #ifndef BC_MESH_H
19 #define BC_MESH_H
20 
21 
22 #include "mesh/mesh.h"
23 
24 class Partitioning;
25 class Neighbour;
26 
27 
28 /**
29  * \brief Class represents boundary part of mesh.
30  *
31  * Holds pointer to parent Mesh and overwrites methods, that allow access to boundary
32  * elements and other functionality and structures necessary to work above boundary
33  * part of mesh.
34  */
35 class BCMesh : public Mesh {
36 public:
37  /**
38  * Constructor from parent (bulk) Mesh.
39  */
40  BCMesh(Mesh* parent_mesh);
41 
42  /// Destructor
43  ~BCMesh();
44 
45  /// Returns range of boundary elements of parent mesh
46  Range<ElementAccessor<3>> elements_range() const override;
47 
48  /// Returns count of boundary elements of parent mesh
49  unsigned int n_elements() const override;
50 
51  /// Overwrite Mesh::get_part()
52  Partitioning *get_part() override;
53 
54  /// Overwrite Mesh::get_local_part()
55  const LongIdx *get_local_part() override;
56 
57  /// Overwrite Mesh::check_compatible_mesh()
58  std::shared_ptr<std::vector<LongIdx>> check_compatible_mesh( Mesh & input_mesh) override;
59 
60  /// Overwrite Mesh::check_compatible_discont_mesh()
61  std::shared_ptr<std::vector<LongIdx>> check_compatible_discont_mesh( Mesh & input_mesh) override;
62 
63  /// Overwrite Mesh::n_nodes()
64  unsigned int n_nodes() const override;
65 
66  /// Overwrite Mesh::element_accessor()
67  ElementAccessor<3> element_accessor(unsigned int idx) const override;
68 
69 private:
70  /// Pointer to parent (bulk) mesh
72 
73  /// Distribution of boundary elements to processors
75 
76 };
77 
78 
79 #endif //BC_MESH_H
80 //-----------------------------------------------------------------------------
81 // vim: set cindent:
BCMesh::elements_range
Range< ElementAccessor< 3 > > elements_range() const override
Returns range of boundary elements of parent mesh.
Definition: bc_mesh.cc:45
BCMesh::check_compatible_discont_mesh
std::shared_ptr< std::vector< LongIdx > > check_compatible_discont_mesh(Mesh &input_mesh) override
Overwrite Mesh::check_compatible_discont_mesh()
Definition: bc_mesh.cc:83
Mesh::BCMesh
friend class BCMesh
Definition: mesh.h:605
BCMesh::get_local_part
const LongIdx * get_local_part() override
Overwrite Mesh::get_local_part()
Definition: bc_mesh.cc:62
ElementAccessor< 3 >
Partitioning
Class for the mesh partitioning. This should provide:
Definition: partitioning.hh:52
Neighbour
Definition: neighbours.h:117
BCMesh::check_compatible_mesh
std::shared_ptr< std::vector< LongIdx > > check_compatible_mesh(Mesh &input_mesh) override
Overwrite Mesh::check_compatible_mesh()
Definition: bc_mesh.cc:78
BCMesh::parent_mesh_
Mesh * parent_mesh_
Pointer to parent (bulk) mesh.
Definition: bc_mesh.hh:71
BCMesh::local_part_
LongIdx * local_part_
Distribution of boundary elements to processors.
Definition: bc_mesh.hh:74
BCMesh::~BCMesh
~BCMesh()
Destructor.
Definition: bc_mesh.cc:39
BCMesh::n_nodes
unsigned int n_nodes() const override
Overwrite Mesh::n_nodes()
Definition: bc_mesh.cc:88
mesh.h
BCMesh::element_accessor
ElementAccessor< 3 > element_accessor(unsigned int idx) const override
Overwrite Mesh::element_accessor()
Definition: bc_mesh.cc:93
LongIdx
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Definition: index_types.hh:24
Mesh
Definition: mesh.h:77
Range
Range helper class.
Definition: range_wrapper.hh:65
BCMesh::get_part
Partitioning * get_part() override
Overwrite Mesh::get_part()
Definition: bc_mesh.cc:58
BCMesh
Class represents boundary part of mesh.
Definition: bc_mesh.hh:35
BCMesh::n_elements
unsigned int n_elements() const override
Returns count of boundary elements of parent mesh.
Definition: bc_mesh.cc:53