Rheolef  7.1
an efficient C++ finite element environment
basis_option.h
Go to the documentation of this file.
1 #ifndef _RHEO_BASIS_OPTION_H
2 #define _RHEO_BASIS_OPTION_H
3 //
4 // This file is part of Rheolef.
5 //
6 // Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7 //
8 // Rheolef is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Rheolef is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Rheolef; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 //
22 // =========================================================================
23 // author: Pierre.Saramito@imag.fr
24 // date: 2 september 2017
25 
26 namespace rheolef {
84 } // namespace rheolef
85 
86 #include "rheolef/smart_pointer.h"
87 #include "rheolef/reference_element.h"
88 #include "rheolef/space_constant.h"
89 
90 namespace rheolef {
91 
92 // [verbatim_basis_option]
93 class basis_option {
94 public:
95 // typedefs:
96 
97  typedef size_t size_type;
100 
101  typedef enum {
104  fekete = 2,
105  max_node = 3
106  } node_type; // update also node_name[]
107 
108  typedef enum {
109  monomial = 0,
111  dubiner = 2,
113  } raw_polynomial_type; // update also raw_polynomial_name[]
114 
117 
118 // allocators:
119 
120  basis_option(
121  node_type nt = default_node,
123 
124  basis_option (const basis_option& sopt);
125  basis_option& operator= (const basis_option& sopt);
126 
127 // accessors & modifiers:
128 
129  node_type get_node() const;
131  std::string get_node_name() const;
132  std::string get_raw_polynomial_name() const;
133  bool is_continuous() const;
134  bool is_discontinuous() const;
135  bool is_restricted_to_sides() const;
136  valued_type valued_tag() const;
137  const std::string& valued() const;
138  size_type dimension() const { return _dimension; }
140 
141  void set_node (node_type type);
143  void set (std::string option_name);
144  void set_node (std::string node_name);
145  void set_raw_polynomial (std::string raw_polynomial_name);
146  void set_continuous (bool c = true);
147  void set_discontinuous (bool d = true);
148  void set_restricted_to_sides (bool r = true);
152 
153  bool is_node_name (std::string name) const;
154  bool is_raw_polynomial_name (std::string name) const;
155  bool is_option_name (std::string name) const;
156 
157  std::string stamp() const;
158 // [verbatim_basis_option]
159 
160 // data:
161 protected:
169 // [verbatim_basis_option_cont]
170 };
171 // [verbatim_basis_option_cont]
172 // ------------------------------------------------------------
173 // ------------------------------------------------------------
174 // inlined
175 // ------------------------------------------------------------
176 inline
178  node_type nt,
180  : _node(nt),
181  _poly(pt),
182  _is_continuous(true),
183  _is_restricted_to_sides(false),
184  _valued_tag(space_constant::scalar),
185  _dimension(std::numeric_limits<size_type>::max()),
186  _sys_coord(space_constant::cartesian)
187 {
188 }
189 inline
191  : _node(sopt._node),
192  _poly(sopt._poly),
193  _is_continuous(sopt._is_continuous),
194  _is_restricted_to_sides(sopt._is_restricted_to_sides),
195  _valued_tag(sopt._valued_tag),
196  _dimension(sopt._dimension),
197  _sys_coord(sopt._sys_coord)
198 {
199 }
200 inline
203 {
204  _node = sopt._node;
205  _poly = sopt._poly;
208  _valued_tag = sopt._valued_tag;
209  _dimension = sopt._dimension;
210  _sys_coord = sopt._sys_coord;
211  return *this;
212 }
213 inline
216 {
217  return _node;
218 }
219 inline
222 {
223  return _poly;
224 }
225 inline
226 bool
228 {
229  return _is_continuous;
230 }
231 inline
232 bool
234 {
235  return !_is_continuous;
236 }
237 inline
238 bool
240 {
242 }
243 inline
246 {
247  return _valued_tag;
248 }
249 inline
250 const std::string&
252 {
254 }
255 inline
256 void
258 {
259  _node = nt;
260 }
261 inline
262 void
264 {
265  _poly = pt;
266 }
267 inline
268 void
270 {
271  _is_continuous = c;
272 }
273 inline
274 void
276 {
277  _is_continuous = !d;
278 }
279 inline
280 void
282 {
284 }
285 
286 }// namespace rheolef
287 #endif // _RHEO_BASIS_OPTION_H
see the basis_option page for the full documentation
Definition: basis_option.h:93
bool is_continuous() const
Definition: basis_option.h:227
raw_polynomial_type _poly
Definition: basis_option.h:163
space_constant::coordinate_type coordinate_type
Definition: basis_option.h:99
bool is_raw_polynomial_name(std::string name) const
Definition: basis_option.cc:75
coordinate_type coordinate_system() const
Definition: basis_option.h:139
std::string get_raw_polynomial_name() const
static const node_type default_node
Definition: basis_option.h:115
bool is_restricted_to_sides() const
Definition: basis_option.h:239
basis_option & operator=(const basis_option &sopt)
Definition: basis_option.h:202
void set_coordinate_system(coordinate_type sc)
Definition: basis_option.h:151
bool is_discontinuous() const
Definition: basis_option.h:233
coordinate_type _sys_coord
Definition: basis_option.h:168
std::string get_node_name() const
Definition: basis_option.cc:97
static const raw_polynomial_type default_raw_polynomial
Definition: basis_option.h:116
bool is_option_name(std::string name) const
Definition: basis_option.cc:82
void set_dimension(size_type d)
Definition: basis_option.h:150
space_constant::valued_type valued_type
Definition: basis_option.h:98
size_type dimension() const
Definition: basis_option.h:138
std::string stamp() const
valued_type valued_tag() const
Definition: basis_option.h:245
void set(std::string option_name)
void set_continuous(bool c=true)
Definition: basis_option.h:269
void set_node(node_type type)
Definition: basis_option.h:257
bool is_node_name(std::string name) const
Definition: basis_option.cc:68
void set_restricted_to_sides(bool r=true)
Definition: basis_option.h:281
void set_raw_polynomial(raw_polynomial_type type)
Definition: basis_option.h:263
void set_discontinuous(bool d=true)
Definition: basis_option.h:275
const std::string & valued() const
Definition: basis_option.h:251
raw_polynomial_type get_raw_polynomial() const
Definition: basis_option.h:221
basis_option(node_type nt=default_node, raw_polynomial_type pt=default_raw_polynomial)
Definition: basis_option.h:177
void set_valued_tag(valued_type v)
Definition: basis_option.h:149
valued_type _valued_tag
Definition: basis_option.h:166
node_type get_node() const
Definition: basis_option.h:215
rheolef::std type
const std::string & valued_name(valued_type valued_tag)
This file is part of Rheolef.