NiHu  2.0
lib_domain.cpp
Go to the documentation of this file.
1 // This file is a part of NiHu, a C++ BEM template library.
2 //
3 // Copyright (C) 2012-2019 Peter Fiala <fiala@hit.bme.hu>
4 // Copyright (C) 2012-2019 Peter Rucz <rucz@hit.bme.hu>
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
27 #include "lib_domain.hpp"
28 
29 namespace NiHu
30 {
31 
32 // definition of line_domain
33 
34 namespace domain_traits
35 {
36 template <>
37 const std::string name<line_domain>::value = "Line domain";
38 }
39 
41 const line_domain::m_corners = {
42 line_domain::xi_t::Constant(-1.),
43 line_domain::xi_t::Constant(1.)
44 };
45 
46 line_domain::edges_t const line_domain::m_edges = { {0, 1} };
47 
48 line_domain::xi_t const line_domain::m_center = line_domain::xi_t::Zero();
49 
50 
51 // definition of tria_domain
52 
53 namespace domain_traits
54 {
55 template <>
56 std::string const name<tria_domain>::value = "Tria domain";
57 }
58 
60 const tria_domain::m_corners = {
61 tria_domain::xi_t(0.,0.),
62 tria_domain::xi_t(1.,0.),
63 tria_domain::xi_t(0.,1.)
64 };
65 
66 tria_domain::edges_t const tria_domain::m_edges = {
67  {0, 1}, {1, 2}, {2, 0}
68 };
69 
70 tria_domain::xi_t const tria_domain::m_center
71 = tria_domain::xi_t::Constant(1. / 3.);
72 
73 
74 // definition of quad_domain
75 
76 namespace domain_traits
77 {
78 template <>
79 std::string const name<quad_domain>::value = "Quad domain";
80 }
81 
83 const quad_domain::m_corners = {
84 quad_domain::xi_t(-1.,-1.),
85 quad_domain::xi_t(1.,-1.),
86 quad_domain::xi_t(1., 1.),
87 quad_domain::xi_t(-1., 1.)
88 };
89 
90 quad_domain::edges_t const quad_domain::m_edges = {
91  {0, 1}, {1, 2}, {2, 3}, {3, 0}
92 };
93 
94 quad_domain::xi_t const quad_domain::m_center = quad_domain::xi_t::Zero();
95 
96 
97 // definition of brick_domain
98 
99 namespace domain_traits
100 {
101 template <>
102 std::string const name<brick_domain>::value = "Brick domain";
103 }
104 
106  const brick_domain::m_corners = {
107  brick_domain::xi_t(-1.,-1.,-1.), brick_domain::xi_t( 1.,-1.,-1.),
108  brick_domain::xi_t( 1., 1.,-1.), brick_domain::xi_t(-1., 1.,-1.),
109  brick_domain::xi_t(-1.,-1., 1.), brick_domain::xi_t( 1.,-1., 1.),
110  brick_domain::xi_t( 1., 1., 1.), brick_domain::xi_t(-1., 1., 1.)
111 };
112 
113 brick_domain::edges_t const brick_domain::m_edges = {
114  {0, 1}, {1, 2}, {2, 3}, {3, 0},
115  {4+0, 4+1}, {4+1, 4+2}, {4+2, 4+3}, {4+3, 4+0},
116  {0, 4}, {1, 5}, {2, 6}, {3, 7}
117  };
118 
119 brick_domain::xi_t const brick_domain::m_center = brick_domain::xi_t::Zero();
120 
121 } // end of namespace NiHu
NiHu::domain_base< line_domain >::xi_t
space_t::location_t xi_t
coordinate vector type
Definition: domain.hpp:91
NiHu::domain_base< line_domain >::edges_t
domain_edge_t edges_t[num_edges]
type of edges array
Definition: domain.hpp:97
lib_domain.hpp
implementation of library domains
NiHu::domain_base< line_domain >::corners_t
std::array< xi_t, num_corners > corners_t
type of corners array
Definition: domain.hpp:93