Loading...
Searching...
No Matches
Pk_get_local_idof_on_side.icc
Go to the documentation of this file.
#ifndef _RHEOLEF_PK_GET_LOCAL_IDOF_ON_SIDE_ICC
#define _RHEOLEF_PK_GET_LOCAL_IDOF_ON_SIDE_ICC
//
// evaluate the Dubiner-Sherwin basis on a point of the reference element
// see SheKar-2005, pages 52 (1d) & 114 (2d) & app. D
//
// author: Pierre.Saramito@imag.fr
//
// date: 5 september 2017
//
#include "rheolef/reference_element.h"
#include "rheolef/reference_element_face_transformation.h"
namespace rheolef { namespace details {
// TODO: .h and .cc instead of copying multiple binary code
static
void
Pk_get_local_idof_on_side (
reference_element tilde_K,
const side_information_type& sid,
size_t k,
Eigen::Matrix<size_t,Eigen::Dynamic,1>& loc_idof)
{
typedef reference_element::size_type size_type;
check_macro (sid.shift == 0, "sid.shift !=0 : not yet, sorry"); // TODO: honor also 3d sid.shift
switch (tilde_K.variant()) {
case reference_element::p: {
loc_idof.resize (0);
return;
}
case reference_element::e: {
loc_idof.resize (2);
loc_idof [0] = 0;
loc_idof [1] = 1;
return;
}
case reference_element::t: {
size_type loc_ndof = k+1;
loc_idof.resize (loc_ndof);
size_type loc_sid_idof = 0;
for (size_type u = 0; u <= k; ++u, ++loc_sid_idof) {
point_basic<size_type> side_ilat (u);
point_basic<size_type> ilat = reference_element_face_transformation (tilde_K, sid, k, side_ilat);
loc_idof [loc_sid_idof] = reference_element_t::ilat2loc_inod (k, ilat);
}
return;
}
case reference_element::q: {
size_type loc_ndof = k+1;
loc_idof.resize (loc_ndof);
size_type loc_sid_idof = 0;
for (size_type u = 0; u <= k; ++u, ++loc_sid_idof) {
point_basic<size_type> side_ilat (u);
point_basic<size_type> ilat = reference_element_face_transformation (tilde_K, sid, k, side_ilat);
loc_idof [loc_sid_idof] = reference_element_q::ilat2loc_inod (k, ilat);
}
return;
}
case reference_element::T: {
size_type loc_ndof = (k+1)*(k+2)/2;
loc_idof.resize (loc_ndof);
size_type loc_sid_idof = 0;
for (size_type u = 0; u <= k; ++u) {
for (size_type v = 0; v <= k-u; ++v, ++loc_sid_idof) {
point_basic<size_type> side_ilat (u,v);
point_basic<size_type> ilat = reference_element_face_transformation (tilde_K, sid, k, side_ilat);
loc_idof [loc_sid_idof] = reference_element_T::ilat2loc_inod (k, ilat);
}}
return;
}
case reference_element::H: {
size_type loc_ndof = (k+1)*(k+1);
loc_idof.resize (loc_ndof);
size_type loc_sid_idof = 0;
for (size_type u = 0; u <= k; ++u) {
for (size_type v = 0; v <= k; ++v, ++loc_sid_idof) {
point_basic<size_type> side_ilat (u,v);
point_basic<size_type> ilat = reference_element_face_transformation (tilde_K, sid, k, side_ilat);
loc_idof [loc_sid_idof] = reference_element_H::ilat2loc_inod (k, ilat);
}}
return;
}
case reference_element::P: {
reference_element hat_S = tilde_K.side (sid.loc_isid);
size_type loc_ndof = (hat_S.variant() == reference_element::t) ? (k+1)*(k+2)/2 : (k+1)*(k+1);
loc_idof.resize (loc_ndof);
size_type loc_sid_idof = 0;
for (size_type u = 0; u <= k; ++u) {
size_type vf = (hat_S.variant() == reference_element::t) ? k-u : k;
for (size_type v = 0; v <= vf; ++v, ++loc_sid_idof) {
point_basic<size_type> side_ilat (u,v);
point_basic<size_type> ilat = reference_element_face_transformation (tilde_K, sid, k, side_ilat);
loc_idof [loc_sid_idof] = reference_element_P::ilat2loc_inod (k, ilat);
}
}
return;
}
default: error_macro ("get_local_idof_on_side: element "<<tilde_K.name()<<" not yet supported");
}
}
}} // namespace rheolef::details
#endif // _RHEOLEF_PK_GET_LOCAL_IDOF_ON_SIDE_ICC
size_type
field::size_type size_type
Definition branch.cc:430
rheolef::reference_element_H::ilat2loc_inod
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
Definition reference_element.cc:790
rheolef::reference_element_P::ilat2loc_inod
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
Definition reference_element.cc:695
rheolef::reference_element_T::ilat2loc_inod
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
Definition reference_element.cc:582
rheolef::reference_element_q::ilat2loc_inod
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
Definition reference_element.cc:481
rheolef::reference_element_t::ilat2loc_inod
static size_type ilat2loc_inod(size_type order, const point_basic< size_type > &ilat)
Definition reference_element.cc:413
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::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::size_type
std::vector< int >::size_type size_type
Definition reference_element.h:71
rheolef::reference_element::T
static const variant_type T
Definition reference_element.h:79
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
error_macro
#define error_macro(message)
Definition dis_macros.h:49
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
rheolef::reference_element_face_transformation
point_basic< T > reference_element_face_transformation(reference_element tilde_K, const side_information_type &sid, const point_basic< T > &sid_hat_x)
Definition reference_element_face_transformation.cc:33
u
Definition leveque.h:25