Loading...
Searching...
No Matches
bubble.cc
Go to the documentation of this file.
// file automatically generated by "../../../rheolef/fem/lib/basis_symbolic_cxx.cc"
#include "bubble.h"
#include "piola_fem_lagrange.h"
namespace rheolef {
using namespace std;
template<class T>
class basis_bubble_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_bubble_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_bubble_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_bubble_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>
void
basis_bubble_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_bubble_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_bubble_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_bubble_e<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = -4.0*(hat_x[0]*hat_x[0])+4.0*hat_x[0];
}
template<class T>
void
basis_bubble_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] = -8.0*hat_x[0]+4.0;
}
template<class T>
void
basis_bubble_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_bubble_t<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = -27.0*(hat_x[1]*hat_x[1])*hat_x[0]+-27.0*hat_x[1]*( (hat_x[0]*hat_x[0])-hat_x[0]);
}
template<class T>
void
basis_bubble_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] = -27.0*( 2.0*hat_x[0]-1.0)*hat_x[1]+-27.0*(hat_x[1]*hat_x[1]);
values[0][1] = -27.0*(hat_x[0]*hat_x[0])+27.0*hat_x[0]+-54.0*hat_x[0]*hat_x[1];
}
template<class T>
void
basis_bubble_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_bubble_T<T>::evaluate (
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& values)
{
values.resize(1);
values[0] = -256.0*( (hat_x[1]*hat_x[1])*hat_x[0]+( (hat_x[0]*hat_x[0])-hat_x[0])*hat_x[1])*hat_x[2]+-256.0*hat_x[1]*(hat_x[2]*hat_x[2])*hat_x[0];
}
template<class T>
void
basis_bubble_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] = -256.0*hat_x[1]*(hat_x[2]*hat_x[2])+-256.0*( (hat_x[1]*hat_x[1])+( 2.0*hat_x[0]-1.0)*hat_x[1])*hat_x[2];
values[0][1] = -256.0*hat_x[2]*( (hat_x[0]*hat_x[0])+2.0*hat_x[1]*hat_x[0]-hat_x[0])+-256.0*(hat_x[2]*hat_x[2])*hat_x[0];
values[0][2] = -512.0*hat_x[1]*hat_x[2]*hat_x[0]+-256.0*hat_x[1]*( (hat_x[0]*hat_x[0])-hat_x[0])+-256.0*(hat_x[1]*hat_x[1])*hat_x[0];
}
template<class T>
void
basis_bubble_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>
basis_bubble<T>::basis_bubble()
: base(basis_option()), _hat_node()
{
_initialize_cstor_sizes();
base::_name = "bubble";
base::_piola_fem.piola_fem<T>::base::operator= (new_macro(piola_fem_lagrange<T>));
}
template<class T>
basis_bubble<T>::~basis_bubble()
{
}
template<class T>
typename basis_bubble<T>::size_type
basis_bubble<T>::degree () const
{
return 4;
}
template<class T>
void
basis_bubble<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_bubble_p<T>::evaluate (hat_x, values);
}
case reference_element::e: {
return basis_bubble_e<T>::evaluate (hat_x, values);
}
case reference_element::t: {
return basis_bubble_t<T>::evaluate (hat_x, values);
}
case reference_element::T: {
return basis_bubble_T<T>::evaluate (hat_x, values);
}
default : {
error_macro ("evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_bubble<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_bubble_p<T>::grad_evaluate (hat_x, values);
}
case reference_element::e: {
return basis_bubble_e<T>::grad_evaluate (hat_x, values);
}
case reference_element::t: {
return basis_bubble_t<T>::grad_evaluate (hat_x, values);
}
case reference_element::T: {
return basis_bubble_T<T>::grad_evaluate (hat_x, values);
}
default : {
error_macro ("grad_evaluate: unsupported `" << hat_K.name() << "' element type");
}
}
}
template<class T>
void
basis_bubble<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_bubble<T>::_initialize_cstor_sizes() const
{
basis_fem_Pk_lagrange<T>::initialize_local_first (
0,
false,
base::_ndof_on_subgeo_internal,
base::_ndof_on_subgeo,
base::_nnod_on_subgeo_internal,
base::_nnod_on_subgeo,
base::_first_idof_by_dimension_internal,
base::_first_idof_by_dimension,
base::_first_inod_by_dimension_internal,
base::_first_inod_by_dimension);
}
template<class T>
void
basis_bubble<T>::_initialize_data(
reference_element hat_K) const
{
switch (hat_K.variant()) {
case reference_element::p: {
return basis_bubble_p<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::e: {
return basis_bubble_e<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::t: {
return basis_bubble_t<T>::hat_node (_hat_node[hat_K.variant()]);
}
case reference_element::T: {
return basis_bubble_T<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_bubble<Float>;
} // namespace rheolef
size_type
field::size_type size_type
Definition branch.cc:430
bubble.h
rheolef::basis_bubble
Definition bubble.h:31
rheolef::basis_bubble::base
basis_rep< T > base
Definition bubble.h:33
rheolef::basis_bubble::size_type
base::size_type size_type
Definition bubble.h:34
rheolef::basis_bubble::degree
size_type degree() const
Definition bubble.cc:178
rheolef::basis_bubble::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition bubble.cc:243
rheolef::basis_bubble::basis_bubble
basis_bubble()
Definition bubble.cc:165
rheolef::basis_bubble::_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 bubble.cc:234
rheolef::basis_bubble::~basis_bubble
~basis_bubble()
Definition bubble.cc:173
rheolef::basis_bubble::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &values) const
Definition bubble.cc:184
rheolef::basis_bubble::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 bubble.cc:209
rheolef::basis_bubble::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition bubble.cc:259
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_internal, 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_internal, 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_internal, 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_internal, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_inod_by_dimension)
Definition basis_fem_Pk_lagrange.cc:41
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::e
static const variant_type e
Definition reference_element.h:76
rheolef::reference_element::p
static const variant_type p
Definition reference_element.h:75
rheolef::reference_element::variant
variant_type variant() const
Definition reference_element.h:99
rheolef::reference_element::T
static const variant_type T
Definition reference_element.h:79
rheolef::reference_element::name
char name() const
Definition reference_element.h:100
rheolef::reference_element::t
static const variant_type t
Definition reference_element.h:77
error_macro
#define error_macro(message)
Definition dis_macros.h:49
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