P0.cc
Go to the documentation of this file.
// file automatically generated by "../../../rheolef/fem/lib/basis_symbolic_cxx.cc"
#include "P0.h"
#include "piola_fem_lagrange.h"
namespace rheolef {
using namespace std;
template<class T>
class basis_P0_p {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_e {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_t {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_q {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_T {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_P {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
class basis_P0_H {
public:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
static void evaluate (const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
static void grad_evaluate (const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
};
template<class T>
void
basis_P0_p<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_p<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
}
template<class T>
void
basis_P0_p<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>();
}
template<class T>
void
basis_P0_e<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_e<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
}
template<class T>
void
basis_P0_e<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>(5.0000000000000000e-01);
}
template<class T>
void
basis_P0_t<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_t<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
values[0][1] = 0.0;
}
template<class T>
void
basis_P0_t<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>((1.0/3.0), (1.0/3.0));
}
template<class T>
void
basis_P0_q<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_q<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
values[0][1] = 0.0;
}
template<class T>
void
basis_P0_q<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>(0.0, 0.0);
}
template<class T>
void
basis_P0_T<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_T<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
values[0][1] = 0.0;
values[0][2] = 0.0;
}
template<class T>
void
basis_P0_T<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>(2.5000000000000000e-01, 2.5000000000000000e-01, 2.5000000000000000e-01);
}
template<class T>
void
basis_P0_P<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_P<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
values[0][1] = 0.0;
values[0][2] = 0.0;
}
template<class T>
void
basis_P0_P<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>((1.0/3.0), (1.0/3.0), 0.0);
}
template<class T>
void
basis_P0_H<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = 1.0;
}
template<class T>
void
basis_P0_H<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0][0] = 0.0;
values[0][1] = 0.0;
values[0][2] = 0.0;
}
template<class T>
void
basis_P0_H<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(1);
x[0] = point_basic<T>(0.0, 0.0, 0.0);
}
template<class T>
basis_P0<T>::basis_P0()
: base(basis_option()), _hat_node()
{
base::_sopt.set_continuous(false);
_initialize_cstor_sizes();
base::_name = "P0";
base::_piola_fem.piola_fem<T>::base::operator= (new_macro(piola_fem_lagrange<T>));
}
template<class T>
basis_P0<T>::~basis_P0()
{
}
template<class T>
typename basis_P0<T>::size_type
basis_P0<T>::degree () const
{
return 0;
}
template<class T>
void
basis_P0<T>::evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values) const
{
switch (hat_K.variant()) {
case reference_element::p: {
return basis_P0_p<T>::evaluate (hat_x, values);
}
case reference_element::e: {
return basis_P0_e<T>::evaluate (hat_x, values);
}
case reference_element::t: {
return basis_P0_t<T>::evaluate (hat_x, values);
}
case reference_element::q: {
return basis_P0_q<T>::evaluate (hat_x, values);
}
case reference_element::T: {
return basis_P0_T<T>::evaluate (hat_x, values);
}
case reference_element::P: {
return basis_P0_P<T>::evaluate (hat_x, values);
}
case reference_element::H: {
return basis_P0_H<T>::evaluate (hat_x, values);
}
default : {
error_macro ("evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_P0<T>::grad_evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values) const
{
switch (hat_K.variant()) {
case reference_element::p: {
return basis_P0_p<T>::grad_evaluate (hat_x, values);
}
case reference_element::e: {
return basis_P0_e<T>::grad_evaluate (hat_x, values);
}
case reference_element::t: {
return basis_P0_t<T>::grad_evaluate (hat_x, values);
}
case reference_element::q: {
return basis_P0_q<T>::grad_evaluate (hat_x, values);
}
case reference_element::T: {
return basis_P0_T<T>::grad_evaluate (hat_x, values);
}
case reference_element::P: {
return basis_P0_P<T>::grad_evaluate (hat_x, values);
}
case reference_element::H: {
return basis_P0_H<T>::grad_evaluate (hat_x, values);
}
default : {
error_macro ("grad_evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_P0<T>::_compute_dofs (
reference_element hat_K,
const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod,
Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const
{
dof = f_xnod;
}
template<class T>
void
basis_P0<T>::_initialize_cstor_sizes() const
{
basis_fem_Pk_lagrange<T>::initialize_local_first (
0,
base::is_continuous(),
base::_ndof_on_subgeo,
base::_nnod_on_subgeo,
base::_first_idof_by_dimension,
base::_first_inod_by_dimension);
}
template<class T>
void
basis_P0<T>::_initialize_data(
reference_element hat_K) const
{
switch (hat_K.variant()) {
case reference_element::p: {
return basis_P0_p<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::e: {
return basis_P0_e<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::t: {
return basis_P0_t<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::q: {
return basis_P0_q<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::T: {
return basis_P0_T<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::P: {
return basis_P0_P<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::H: {
return basis_P0_H<T>::hat_node (_hat_node[hat_K.variant()]);
}
default : {
error_macro ("hat_node: unsupported `" << hat_K.name() << "' element type");
}
}
}
// instantiation in library:
template class basis_P0<Float>;
} // namespace rheolef
rheolef::basis_P0::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &values) const
Definition: P0.cc:292
rheolef::reference_element::e
static const variant_type e
Definition: reference_element.h:76
rheolef::reference_element::H
static const variant_type H
Definition: reference_element.h:81
rheolef::point_basic
Definition: point.h:87
rheolef::piola_fem_lagrange
Definition: piola_fem_lagrange.h:65
rheolef::basis_P0::_compute_dofs
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
Definition: P0.cc:360
rheolef::reference_element::T
static const variant_type T
Definition: reference_element.h:79
rheolef::basis_P0::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition: P0.cc:381
rheolef::size_type
size_t size_type
Definition: basis_get.cc:76
rheolef::basis_option
see the basis_option page for the full documentation
Definition: basis_option.h:93
rheolef::basis_P0::degree
size_type degree() const
Definition: P0.cc:286
rheolef::basis_P0::grad_evaluate
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &values) const
Definition: P0.cc:326
rheolef::reference_element
see the reference_element page for the full documentation
Definition: reference_element.h:66
rheolef::basis_P0::size_type
base::size_type size_type
Definition: P0.h:34
rheolef::basis_rep::_piola_fem
piola_fem< T > _piola_fem
Definition: basis.h:394
rheolef::basis_P0
Definition: P0.h:31
rheolef::reference_element::name
char name() const
Definition: reference_element.h:100
rheolef::basis_P0::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition: P0.cc:369
rheolef::reference_element::variant
variant_type variant() const
Definition: reference_element.h:99
rheolef::basis_rep::_sopt
basis_option _sopt
Definition: basis.h:393
rheolef::basis_rep::_name
std::string _name
Definition: basis.h:392
rheolef::basis_option::set_continuous
void set_continuous(bool c=true)
Definition: basis_option.h:269
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::basis_P0::~basis_P0
~basis_P0()
Definition: P0.cc:281
rheolef::basis_fem_Pk_lagrange::initialize_local_first
static void initialize_local_first(size_type k, bool is_continuous, std::array< std::array< size_type, reference_element::max_variant >, 4 > &ndof_on_subgeo, std::array< std::array< size_type, reference_element::max_variant >, 4 > &nnod_on_subgeo, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_idof_by_dimension, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_inod_by_dimension)
Definition: basis_fem_Pk_lagrange.cc:41
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
rheolef::point_basic< T >
point_basic< T >
Definition: piola_fem.h:135
rheolef::reference_element::p
static const variant_type p
Definition: reference_element.h:75
rheolef::reference_element::q
static const variant_type q
Definition: reference_element.h:78
rheolef::reference_element::P
static const variant_type P
Definition: reference_element.h:80
rheolef::reference_element::t
static const variant_type t
Definition: reference_element.h:77
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::basis_P0::basis_P0
basis_P0()
Definition: P0.cc:272
piola_fem_lagrange.h
rheolef::evaluate
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
Definition: field_expr_recursive.h:873
rheolef::basis_rep
Definition: basis.h:209
T
Expr1::float_type T
Definition: field_expr.h:218
P0.h