HArD::Core3D
Hybrid Arbitrary Degree::Core 3D - Library to implement 3D schemes with vertex, edge, face and cell polynomials as unknowns
BoundaryConditions.hpp
Go to the documentation of this file.
1 // Class to provide description of boundary conditions
2 //
3 //
4 // Author: Jerome Droniou (jerome.droniou@monash.edu)
5 //
6 
7 /*
8 *
9 * This library was developed around HHO methods, although some parts of it have a more
10 * general purpose. If you use this code or part of it in a scientific publication,
11 * please mention the following book as a reference for the underlying principles
12 * of HHO schemes:
13 *
14 * The Hybrid High-Order Method for Polytopal Meshes: Design, Analysis, and Applications.
15 * D. A. Di Pietro and J. Droniou. 2019, 516p.
16 * url: https://hal.archives-ouvertes.fr/hal-02151813.
17 *
18 */
19 
20 
21 #ifndef _BOUNDARY_CONDITIONS_HPP
22 #define _BOUNDARY_CONDITIONS_HPP
23 
24 #include <iostream>
25 #include <string>
26 #include <mesh.hpp>
27 
28 using namespace HArDCore3D;
29 
35 // ----------------------------------------------------------------------------
36 // Class definition
37 // ----------------------------------------------------------------------------
38 
39 // @addtogroup TestCases
41 
44 
45 public:
48  const std::string bc_id,
49  Mesh& mesh
50  );
51 
53  const std::string type(
54  Face& face
55  ) const ;
63  inline const size_t n_dir_faces() const {
64  return m_n_dir_faces;
65  };
66 
68  inline const std::string name() const {
69  if (m_bc_id == "D"){
70  return "Dirichlet";
71  }else if (m_bc_id == "N"){
72  return "Neumann";
73  }else if (m_bc_id == "M0"){
74  return "Mixed #0";
75  }
76  std::cout << "Unknown boundary conditions: " << m_bc_id << "\n";
77  exit(1);
78  };
79 
81  void reorder_faces(const std::string pos = "end");
82 
83 private:
84  // Parameters: id of boundary condition, reference to mesh
85  const std::string m_bc_id;
86  Mesh& m_mesh;
87 
88  // Number of Dirichlet faces
89  size_t m_n_dir_faces;
90 };
91 
92 
94 
95 #endif //_BOUNDARY_CONDITION_HPP
The BoundaryConditions class provides definition of boundary conditions.
Definition: BoundaryConditions.hpp:43
const std::string name() const
Returns the complete name of the boundary condition.
Definition: BoundaryConditions.hpp:68
const size_t n_dir_faces() const
Returns the number of Dirichlet faces.
Definition: BoundaryConditions.hpp:63
Class to describe a mesh.
Definition: MeshND.hpp:17
std::string bc_id
Definition: HHO_DiffAdvecReac.hpp:44
Definition: ddr-magnetostatics.hpp:40
MeshND::Mesh< 2 > Mesh
Definition: Mesh2D.hpp:9
MeshND::Face< 2 > Face
Definition: Mesh2D.hpp:12