Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
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"
27#include "basis_fem_RTk.h"
28#include "basis_fem_trace_n.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"
36namespace rheolef {
37using namespace std;
38
39template<class T>
40bool
42 if (name == "bubble") return false;
43 if (name == "P1qd") return false;
44 return true;
45}
46template<class T>
47bool
49 if (name == "P0") return false;
50 if (name == "bubble") return false;
51 if (name == "P1qd") return false;
52 return true;
53}
54template<class T>
56basis_rep<T>::make_ptr (const std::string& name)
57{
59 basis_parse_from_string (name, fio);
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:
76 fio.option.valued()<<"-valued basis not yet supported, sorry");
77 }
78 }
79 if (fio.option.is_trace_n()) {
80 basis_option sopt2 = fio.option;
81 sopt2.set_trace_n(false);
82 std::string name2 = basis_rep<T>::standard_naming (fio.family, fio.index, sopt2);
83 // recursively call make_ptr without the trace_n option:
84 basis_basic<T> tr_basis;
85 tr_basis.basis_basic<T>::base::operator= (basis_rep<T>::make_ptr(name2));
86 return new_macro(basis_fem_trace_n<T>(tr_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:
101template basis_rep<Float>* basis_rep<Float>::make_ptr (const std::string&);
102template bool basis_rep<Float>::have_index_parameter (std::string family_name);
103template bool basis_rep<Float>::have_continuous_feature (std::string family_name);
104
105} // namespace rheolef
basis_basic(std::string name="")
Definition basis.h:691
see the basis_option page for the full documentation
bool is_trace_n() const
void set_trace_n(bool r=true)
valued_type valued_tag() const
const std::string & valued() const
void set_valued_tag(valued_type v)
virtual bool have_continuous_feature() const
Definition basis.h:233
virtual bool have_index_parameter() const
Definition basis.h:232
static std::string standard_naming(std::string family_name, size_t degree, const basis_option &sopt)
Definition basis_rep.cc:44
static basis_rep * make_ptr(const std::string &name)
Definition basis_list.cc:56
#define error_macro(message)
Definition dis_macros.h:49
Expr1::float_type T
Definition field_expr.h:230
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
void basis_parse_from_string(const std::string &str, family_index_option_type &fio)
Definition basis_get.cc:142
STL namespace.