Rheolef  7.1
an efficient C++ finite element environment
basis_list.cc
Go to the documentation of this file.
1 // file automatically generated by: ../../../rheolef/fem/lib/make_basis_list_cxx.sh
22 #include "rheolef/basis.h"
23 #include "rheolef/basis_get.h"
24 #include "basis_fem_Pk_lagrange.h"
25 #include "basis_fem_Pk_bernstein.h"
26 #include "basis_fem_Pk_sherwin.h"
27 #include "basis_fem_RTk.h"
28 #include "basis_fem_sides.h"
29 #include "basis_fem_vector.h"
30 #include "basis_fem_tensor.h"
31 #include "basis_fem_empty.h"
32 #include "P0.h"
33 #include "P1.h"
34 #include "bubble.h"
35 #include "P1qd.h"
36 namespace rheolef {
37 using namespace std;
38 
39 template<class T>
40 bool
42  if (name == "bubble") return false;
43  if (name == "P1qd") return false;
44  return true;
45 }
46 template<class T>
47 bool
49  if (name == "P0") return false;
50  if (name == "bubble") return false;
51  if (name == "P1qd") return false;
52  return true;
53 }
54 template<class T>
56 basis_rep<T>::make_ptr (const std::string& name)
57 {
60 
61  if (fio.family == "") return 0;
63  basis_option sopt2 = fio.option;
65  std::string name2 = basis_rep<T>::standard_naming (fio.family, fio.index, sopt2);
66  // recursively call make_ptr without the vector/tensor option:
67  basis_basic<T> scalar_basis;
68  scalar_basis.basis_basic<T>::base::operator= (basis_rep<T>::make_ptr(name2));
69  switch (fio.option.valued_tag()) {
71  return new_macro(basis_fem_vector<T>(scalar_basis,fio.option));
73  return new_macro(basis_fem_tensor<T>(scalar_basis,fio.option));
74  default:
75  check_macro (fio.option.valued_tag() == space_constant::scalar,
76  fio.option.valued()<<"-valued basis not yet supported, sorry");
77  }
78  }
79  if (fio.option.is_restricted_to_sides()) {
80  basis_option sopt2 = fio.option;
81  sopt2.set_restricted_to_sides(false);
82  std::string name2 = basis_rep<T>::standard_naming (fio.family, fio.index, sopt2);
83  // recursively call make_ptr without the side option:
84  basis_basic<T> side_basis;
85  side_basis.basis_basic<T>::base::operator= (basis_rep<T>::make_ptr(name2));
86  return new_macro(basis_fem_sides<T>(side_basis));
87  }
88  if (fio.family == "P" && fio.index == 0) return new_macro(basis_P0<T>());
89  if (fio.family == "P" && fio.index == 1) return new_macro(basis_P1<T>(fio.option));
90  if (fio.family == "bubble") return new_macro(basis_bubble<T>);
91  if (fio.family == "P1qd") return new_macro(basis_P1qd<T>);
92  if (fio.family == "P") return new_macro(basis_fem_Pk_lagrange<T> (fio.index, fio.option));
93  if (fio.family == "B") return new_macro(basis_fem_Pk_bernstein<T>(fio.index, fio.option));
94  if (fio.family == "S") return new_macro(basis_fem_Pk_sherwin<T> (fio.index, fio.option));
95  if (fio.family == "RT") return new_macro(basis_fem_RTk<T> (fio.index, fio.option));
96  if (fio.family == "empty") return new_macro(basis_fem_empty<T>());
97  error_macro ("undefined basis `" << fio.family << "'");
98  return 0;
99 }
100 // instanciation in library:
101 template basis_rep<Float>* basis_rep<Float>::make_ptr (const std::string&);
102 template bool basis_rep<Float>::have_index_parameter (std::string family_name);
103 template bool basis_rep<Float>::have_continuous_feature (std::string family_name);
104 
105 } // namespace rheolef
P1.h
rheolef::basis_option::valued
const std::string & valued() const
Definition: basis_option.h:251
rheolef::basis_option::is_restricted_to_sides
bool is_restricted_to_sides() const
Definition: basis_option.h:239
basis_fem_empty.h
rheolef::family_index_option_type::family
std::string family
Definition: basis_get.h:34
rheolef::basis_fem_tensor
Definition: basis_fem_tensor.h:43
rheolef::basis_fem_RTk
Definition: basis_fem_RTk.h:53
rheolef::basis_rep::have_index_parameter
virtual bool have_index_parameter() const
Definition: basis.h:232
rheolef::family_index_option_type::index
size_t index
Definition: basis_get.h:35
basis_fem_Pk_lagrange.h
rheolef::basis_fem_Pk_bernstein
Definition: basis_fem_Pk_bernstein.h:61
rheolef::basis_option::set_restricted_to_sides
void set_restricted_to_sides(bool r=true)
Definition: basis_option.h:281
rheolef::basis_P1
Definition: P1.h:31
rheolef::basis_option
see the basis_option page for the full documentation
Definition: basis_option.h:93
basis_fem_tensor.h
rheolef::basis_basic
Definition: basis.h:532
rheolef::space_constant::tensor
@ tensor
Definition: space_constant.h:138
rheolef::space_constant::scalar
@ scalar
Definition: space_constant.h:136
rheolef::basis_P1qd
Definition: P1qd.h:29
rheolef::basis_fem_empty
Definition: basis_fem_empty.h:51
rheolef::basis_basic::basis_basic
basis_basic(std::string name="")
Definition: basis.h:652
basis_fem_Pk_sherwin.h
rheolef::basis_P0
Definition: P0.h:31
rheolef::basis_rep::have_continuous_feature
virtual bool have_continuous_feature() const
Definition: basis.h:233
basis_fem_sides.h
rheolef::basis_fem_sides
Definition: basis_fem_sides.h:48
basis_fem_Pk_bernstein.h
basis_fem_RTk.h
P1qd.h
rheolef::family_index_option_type
Definition: basis_get.h:31
rheolef::basis_bubble
Definition: bubble.h:31
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
rheolef::basis_fem_vector
Definition: basis_fem_vector.h:43
bubble.h
rheolef::basis_option::set_valued_tag
void set_valued_tag(valued_type v)
Definition: basis_option.h:149
rheolef::family_index_option_type::option
basis_option option
Definition: basis_get.h:36
rheolef::space_constant::vector
@ vector
Definition: space_constant.h:137
rheolef::basis_rep::standard_naming
static std::string standard_naming(std::string family_name, size_t degree, const basis_option &sopt)
Definition: basis_rep.cc:44
rheolef::basis_parse_from_string
void basis_parse_from_string(const std::string &str, family_index_option_type &fio)
Definition: basis_get.cc:142
basis_fem_vector.h
rheolef::basis_fem_Pk_lagrange
Definition: basis_fem_Pk_lagrange.h:52
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::basis_fem_Pk_sherwin
Definition: basis_fem_Pk_sherwin.h:56
rheolef::basis_rep::make_ptr
static basis_rep * make_ptr(const std::string &name)
Definition: basis_list.cc:56
rheolef::basis_rep
Definition: basis.h:209
T
Expr1::float_type T
Definition: field_expr.h:261
P0.h
rheolef::basis_option::valued_tag
valued_type valued_tag() const
Definition: basis_option.h:245