Flow123d  master-f44eb46
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 #define NOT_IMPLEMENTED { ASSERT_PERMANENT(false); return 0; }
22 
23 
24 #include "mesh/mesh.h"
25 
26 class Partitioning;
27 class Neighbour;
28 
29 
30 /**
31  * \brief Class represents boundary part of mesh.
32  *
33  * Holds pointer to parent Mesh and overwrites methods, that allow access to boundary
34  * elements and other functionality and structures necessary to work above boundary
35  * part of mesh.
36  */
37 class BCMesh : public MeshBase {
38 public:
39  /**
40  * Constructor from parent (bulk) Mesh.
41  */
42  BCMesh(Mesh* parent_mesh);
43 
44  /// Destructor
45  ~BCMesh() override;
46 
47  /// Overwrite Mesh::get_part()
48  Partitioning *get_part() override;
49 
50  /// Overwrite Mesh::get_local_part()
51  const LongIdx *get_local_part() override;
52 
53  /// Overwrite Mesh::check_compatible_mesh()
54  std::shared_ptr<EquivalentMeshMap> check_compatible_mesh( Mesh & input_mesh) override;
55 
56  /// Implement MeshBase::bc_mesh()
57  BCMesh *bc_mesh() const override {
58  return nullptr;
59  }
60 
61 private:
62 
63  /// setup distribution of elements and related vectors
64  void init_distribution();
65 
67 
68  // unused methods (should not be used)
69  Boundary boundary(unsigned int) const override;
70 
71 
72 
73  /// Pointer to parent (bulk) mesh
75 
76  /// Distribution of boundary elements to processors
78 
79 
80  friend class Mesh;
81 
82 };
83 
84 
85 #endif //BC_MESH_H
86 //-----------------------------------------------------------------------------
87 // vim: set cindent:
Class represents boundary part of mesh.
Definition: bc_mesh.hh:37
BCMesh * bc_mesh() const override
Implement MeshBase::bc_mesh()
Definition: bc_mesh.hh:57
std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh) override
Overwrite Mesh::check_compatible_mesh()
Definition: bc_mesh.cc:98
void make_neighbours_and_edges()
Definition: bc_mesh.cc:110
void init_distribution()
setup distribution of elements and related vectors
Definition: bc_mesh.cc:47
BCMesh(Mesh *parent_mesh)
Definition: bc_mesh.cc:30
~BCMesh() override
Destructor.
Definition: bc_mesh.cc:42
Partitioning * get_part() override
Overwrite Mesh::get_part()
Definition: bc_mesh.cc:78
const LongIdx * get_local_part() override
Overwrite Mesh::get_local_part()
Definition: bc_mesh.cc:82
Mesh * parent_mesh_
Pointer to parent (bulk) mesh.
Definition: bc_mesh.hh:74
Boundary boundary(unsigned int) const override
Definition: bc_mesh.cc:103
LongIdx * local_part_
Distribution of boundary elements to processors.
Definition: bc_mesh.hh:77
Base class for Mesh and BCMesh.
Definition: mesh.h:96
Definition: mesh.h:362
Class for the mesh partitioning. This should provide:
Definition: partitioning.hh:52
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Definition: index_types.hh:24