basis_list.cc
Go to the documentation of this file.
// file automatically generated by: ../../../rheolef/fem/lib/make_basis_list_cxx.sh
#include "rheolef/basis.h"
#include "rheolef/basis_get.h"
#include "basis_fem_Pk_lagrange.h"
#include "basis_fem_Pk_bernstein.h"
#include "basis_fem_Pk_sherwin.h"
#include "basis_fem_RTk.h"
#include "basis_fem_sides.h"
#include "basis_fem_vector.h"
#include "basis_fem_tensor.h"
#include "basis_fem_empty.h"
#include "P0.h"
#include "P1.h"
#include "bubble.h"
#include "P1qd.h"
namespace rheolef {
using namespace std;
template<class T>
bool
basis_rep<T>::have_index_parameter (std::string name) {
if (name == "bubble") return false;
if (name == "P1qd") return false;
return true;
}
template<class T>
bool
basis_rep<T>::have_continuous_feature (std::string name) {
if (name == "P0") return false;
if (name == "bubble") return false;
if (name == "P1qd") return false;
return true;
}
template<class T>
basis_rep<T>*
basis_rep<T>::make_ptr (const std::string& name)
{
family_index_option_type fio;
basis_parse_from_string (name, fio);
if (fio.family == "") return 0;
if (fio.option.valued_tag() != space_constant::scalar) {
basis_option sopt2 = fio.option;
sopt2.set_valued_tag (space_constant::scalar);
std::string name2 = basis_rep<T>::standard_naming (fio.family, fio.index, sopt2);
// recursively call make_ptr without the vector/tensor option:
basis_basic<T> scalar_basis;
scalar_basis.basis_basic<T>::base::operator= (basis_rep<T>::make_ptr(name2));
switch (fio.option.valued_tag()) {
case space_constant::vector:
return new_macro(basis_fem_vector<T>(scalar_basis,fio.option));
case space_constant::tensor:
return new_macro(basis_fem_tensor<T>(scalar_basis,fio.option));
default:
check_macro (fio.option.valued_tag() == space_constant::scalar,
fio.option.valued()<<"-valued basis not yet supported, sorry");
}
}
if (fio.option.is_restricted_to_sides()) {
basis_option sopt2 = fio.option;
sopt2.set_restricted_to_sides(false);
std::string name2 = basis_rep<T>::standard_naming (fio.family, fio.index, sopt2);
// recursively call make_ptr without the side option:
basis_basic<T> side_basis;
side_basis.basis_basic<T>::base::operator= (basis_rep<T>::make_ptr(name2));
return new_macro(basis_fem_sides<T>(side_basis));
}
if (fio.family == "P" && fio.index == 0) return new_macro(basis_P0<T>());
if (fio.family == "P" && fio.index == 1) return new_macro(basis_P1<T>(fio.option));
if (fio.family == "bubble") return new_macro(basis_bubble<T>);
if (fio.family == "P1qd") return new_macro(basis_P1qd<T>);
if (fio.family == "P") return new_macro(basis_fem_Pk_lagrange<T> (fio.index, fio.option));
if (fio.family == "B") return new_macro(basis_fem_Pk_bernstein<T>(fio.index, fio.option));
if (fio.family == "S") return new_macro(basis_fem_Pk_sherwin<T> (fio.index, fio.option));
if (fio.family == "RT") return new_macro(basis_fem_RTk<T> (fio.index, fio.option));
if (fio.family == "empty") return new_macro(basis_fem_empty<T>());
error_macro ("undefined basis `" << fio.family << "'");
return 0;
}
// instanciation in library:
template basis_rep<Float>* basis_rep<Float>::make_ptr (const std::string&);
template bool basis_rep<Float>::have_index_parameter (std::string family_name);
template bool basis_rep<Float>::have_continuous_feature (std::string family_name);
} // namespace rheolef
P0.h
P1.h
P1qd.h
basis_fem_Pk_bernstein.h
basis_fem_Pk_lagrange.h
basis_fem_Pk_sherwin.h
basis_fem_RTk.h
basis_fem_empty.h
basis_fem_sides.h
basis_fem_tensor.h
basis_fem_vector.h
bubble.h
rheolef::basis_P0
Definition: P0.h:31
rheolef::basis_P1
Definition: P1.h:31
rheolef::basis_P1qd
Definition: P1qd.h:29
rheolef::basis_basic
Definition: basis.h:532
rheolef::basis_basic::basis_basic
basis_basic(std::string name="")
Definition: basis.h:652
rheolef::basis_bubble
Definition: bubble.h:31
rheolef::basis_fem_Pk_bernstein
Definition: basis_fem_Pk_bernstein.h:61
rheolef::basis_fem_Pk_lagrange
Definition: basis_fem_Pk_lagrange.h:52
rheolef::basis_fem_Pk_sherwin
Definition: basis_fem_Pk_sherwin.h:56
rheolef::basis_fem_RTk
Definition: basis_fem_RTk.h:53
rheolef::basis_fem_empty
Definition: basis_fem_empty.h:51
rheolef::basis_fem_sides
Definition: basis_fem_sides.h:48
rheolef::basis_fem_tensor
Definition: basis_fem_tensor.h:43
rheolef::basis_fem_vector
Definition: basis_fem_vector.h:43
rheolef::basis_option
see the basis_option page for the full documentation
Definition: basis_option.h:93
rheolef::basis_option::is_restricted_to_sides
bool is_restricted_to_sides() const
Definition: basis_option.h:239
rheolef::basis_option::valued_tag
valued_type valued_tag() const
Definition: basis_option.h:245
rheolef::basis_option::set_restricted_to_sides
void set_restricted_to_sides(bool r=true)
Definition: basis_option.h:281
rheolef::basis_option::valued
const std::string & valued() const
Definition: basis_option.h:251
rheolef::basis_option::set_valued_tag
void set_valued_tag(valued_type v)
Definition: basis_option.h:149
rheolef::basis_rep
Definition: basis.h:209
rheolef::basis_rep::have_continuous_feature
virtual bool have_continuous_feature() const
Definition: basis.h:233
rheolef::basis_rep::have_index_parameter
virtual bool have_index_parameter() const
Definition: basis.h:232
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_rep::make_ptr
static basis_rep * make_ptr(const std::string &name)
Definition: basis_list.cc:56
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
T
Expr1::float_type T
Definition: field_expr.h:261
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::space_constant::tensor
@ tensor
Definition: space_constant.h:138
rheolef::space_constant::scalar
@ scalar
Definition: space_constant.h:136
rheolef::space_constant::vector
@ vector
Definition: space_constant.h:137
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::basis_parse_from_string
void basis_parse_from_string(const std::string &str, family_index_option_type &fio)
Definition: basis_get.cc:142
rheolef::family_index_option_type
Definition: basis_get.h:31
rheolef::family_index_option_type::option
basis_option option
Definition: basis_get.h:36
rheolef::family_index_option_type::index
size_t index
Definition: basis_get.h:35
rheolef::family_index_option_type::family
std::string family
Definition: basis_get.h:34