Loading...
Searching...
No Matches
P1qd.cc
Go to the documentation of this file.
// file automatically generated by "../../../rheolef/fem/lib/basis_symbolic_cxx.cc"
#include "P1qd.h"
#include "piola_fem_lagrange.h"
namespace rheolef {
using namespace std;
template<class T>
class basis_P1qd_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_P1qd_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_P1qd_q<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(3);
values[0] = hat_x[1]+5.0000000000000000e-01;
values[1] = -hat_x[1]+hat_x[0];
values[2] = -hat_x[0]+5.0000000000000000e-01;
}
template<class T>
void
basis_P1qd_q<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(3);
values[0][0] = 0.0;
values[0][1] = 1.0;
values[1][0] = 1.0;
values[1][1] = -1.0000000000000000e+00;
values[2][0] = -1.0000000000000000e+00;
values[2][1] = 0.0;
}
template<class T>
void
basis_P1qd_q<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(3);
x[0] = point_basic<T>(5.0000000000000000e-01, 5.0000000000000000e-01);
x[1] = point_basic<T>(5.0000000000000000e-01, -5.0000000000000000e-01);
x[2] = point_basic<T>(-5.0000000000000000e-01, -5.0000000000000000e-01);
}
template<class T>
void
basis_P1qd_H<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(4);
values[0] = hat_x[2]+5.0000000000000000e-01;
values[1] = -hat_x[2]+hat_x[1];
values[2] = hat_x[0]-hat_x[1];
values[3] = -hat_x[0]+5.0000000000000000e-01;
}
template<class T>
void
basis_P1qd_H<T>::grad_evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
{
values.resize(4);
values[0][0] = 0.0;
values[0][1] = 0.0;
values[0][2] = 1.0;
values[1][0] = 0.0;
values[1][1] = 1.0;
values[1][2] = -1.0000000000000000e+00;
values[2][0] = 1.0;
values[2][1] = -1.0000000000000000e+00;
values[2][2] = 0.0;
values[3][0] = -1.0000000000000000e+00;
values[3][1] = 0.0;
values[3][2] = 0.0;
}
template<class T>
void
basis_P1qd_H<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
{
x.resize(4);
x[0] = point_basic<T>(5.0000000000000000e-01, 5.0000000000000000e-01, 5.0000000000000000e-01);
x[1] = point_basic<T>(5.0000000000000000e-01, 5.0000000000000000e-01, -5.0000000000000000e-01);
x[2] = point_basic<T>(5.0000000000000000e-01, -5.0000000000000000e-01, -5.0000000000000000e-01);
x[3] = point_basic<T>(-5.0000000000000000e-01, -5.0000000000000000e-01, -5.0000000000000000e-01);
}
template<class T>
basis_P1qd<T>::basis_P1qd()
: base(basis_option()), _hat_node()
{
base::_sopt.set_continuous(false);
_initialize_cstor_sizes();
base::_name = "P1qd";
base::_piola_fem.piola_fem<T>::base::operator= (new_macro(piola_fem_lagrange<T>));
}
template<class T>
basis_P1qd<T>::~basis_P1qd()
{
}
template<class T>
typename basis_P1qd<T>::size_type
basis_P1qd<T>::degree () const
{
return 1;
}
template<class T>
void
basis_P1qd<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::q: {
return basis_P1qd_q<T>::evaluate (hat_x, values);
}
case reference_element::H: {
return basis_P1qd_H<T>::evaluate (hat_x, values);
}
default : {
error_macro ("evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_P1qd<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::q: {
return basis_P1qd_q<T>::grad_evaluate (hat_x, values);
}
case reference_element::H: {
return basis_P1qd_H<T>::grad_evaluate (hat_x, values);
}
default : {
error_macro ("grad_evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_P1qd<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_P1qd<T>::_initialize_cstor_sizes() const
{
fatal_macro("::_initialize_cstor_sizes: not yet"); /* TODO */
}
template<class T>
void
basis_P1qd<T>::_initialize_data(
reference_element hat_K) const
{
switch (hat_K.variant()) {
case reference_element::q: {
return basis_P1qd_q<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::H: {
return basis_P1qd_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_P1qd<Float>;
} // namespace rheolef
P1qd.h
size_type
field::size_type size_type
Definition branch.cc:430
rheolef::basis_P1qd
Definition P1qd.h:29
rheolef::basis_P1qd::base
basis_rep< T > base
Definition P1qd.h:31
rheolef::basis_P1qd::basis_P1qd
basis_P1qd()
Definition P1qd.cc:121
rheolef::basis_P1qd::size_type
base::size_type size_type
Definition P1qd.h:32
rheolef::basis_P1qd::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition P1qd.cc:188
rheolef::basis_P1qd::~basis_P1qd
~basis_P1qd()
Definition P1qd.cc:130
rheolef::basis_P1qd::_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 P1qd.cc:179
rheolef::basis_P1qd::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &values) const
Definition P1qd.cc:141
rheolef::basis_P1qd::degree
size_type degree() const
Definition P1qd.cc:135
rheolef::basis_P1qd::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 P1qd.cc:160
rheolef::basis_P1qd::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition P1qd.cc:194
rheolef::basis_option
see the basis_option page for the full documentation
Definition basis_option.h:93
rheolef::basis_rep::vector
vector
Definition basis.h:323
rheolef::piola_fem_lagrange
Definition piola_fem_lagrange.h:65
rheolef::point_basic
Definition point.h:86
rheolef::reference_element
see the reference_element page for the full documentation
Definition reference_element.h:66
rheolef::reference_element::H
static const variant_type H
Definition reference_element.h:81
rheolef::reference_element::q
static const variant_type q
Definition reference_element.h:78
rheolef::reference_element::variant
variant_type variant() const
Definition reference_element.h:99
rheolef::reference_element::name
char name() const
Definition reference_element.h:100
error_macro
#define error_macro(message)
Definition dis_macros.h:49
fatal_macro
#define fatal_macro(message)
Definition dis_macros.h:33
T
Expr1::float_type T
Definition field_expr.h:230
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
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:915
std
STL namespace.
piola_fem_lagrange.h