Flow123d  release_3.0.0-1075-gba2c39a
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(bool boundary=false) const;
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  bool check_compatible_mesh( Mesh & mesh, vector<LongIdx> & bulk_elements_id, vector<LongIdx> & boundary_elements_id ) override;
59 
60  /// Overwrite Mesh::n_nodes()
61  unsigned int n_nodes() const override;
62 
63  /// Overwrite Mesh::element_accessor()
64  ElementAccessor<3> element_accessor(unsigned int idx) const override;
65 
66 private:
67  /// Pointer to parent (bulk) mesh
69 
70  /// Distribution of boundary elements to processors
72 
73 };
74 
75 
76 #endif //BC_MESH_H
77 //-----------------------------------------------------------------------------
78 // vim: set cindent:
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Definition: long_idx.hh:22
Class for the mesh partitioning. This should provide:
Definition: partitioning.hh:52
BCMesh(Mesh *parent_mesh)
Definition: bc_mesh.cc:31
unsigned int n_elements(bool boundary=false) const
Returns count of boundary elements of parent mesh.
Definition: bc_mesh.cc:54
Range< ElementAccessor< 3 > > elements_range() const override
Returns range of boundary elements of parent mesh.
Definition: bc_mesh.cc:46
ElementAccessor< 3 > element_accessor(unsigned int idx) const override
Overwrite Mesh::element_accessor()
Definition: bc_mesh.cc:89
Definition: mesh.h:76
unsigned int n_nodes() const override
Overwrite Mesh::n_nodes()
Definition: bc_mesh.cc:84
bool check_compatible_mesh(Mesh &mesh, vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) override
Overwrite Mesh::check_compatible_mesh()
Definition: bc_mesh.cc:79
Partitioning * get_part() override
Overwrite Mesh::get_part()
Definition: bc_mesh.cc:59
Range helper class.
LongIdx * local_part_
Distribution of boundary elements to processors.
Definition: bc_mesh.hh:71
Class represents boundary part of mesh.
Definition: bc_mesh.hh:35
const LongIdx * get_local_part() override
Overwrite Mesh::get_local_part()
Definition: bc_mesh.cc:63
Mesh * parent_mesh_
Pointer to parent (bulk) mesh.
Definition: bc_mesh.hh:68
~BCMesh()
Destructor.
Definition: bc_mesh.cc:40