22#include "rheolef/geo_element.h"
34 if (!is.good())
return 0;
36 while (is.good() && (c ==
' ' || c ==
'\t')) {
38 }
while (is.good() && (c ==
' ' || c ==
'\t'));
73 while (is.good() && isdigit(c) && nvertex < 3) {
84 default:
error_macro (
"unexpected element with "<<nvertex<<
" vertices");
98 os <<
"p" <<
order() <<
" ";
100 for (
size_type loc_inod = 0, loc_nnod =
n_node(); loc_inod < loc_nnod; loc_inod++) {
101 if (loc_inod != 0) os <<
" ";
120 "get_orientation_and_shift: elements have different dimensions "<<
dimension()<<
" and "<<S.
dimension());
122 "get_orientation_and_shift: elements have different sizes "<<
size()<<
" and "<<S.
size());
136 for (shift = 0; shift <
shift_type(n); shift++) {
137 if (
operator[](0) == S[shift])
break;
141 shift = std::numeric_limits<shift_type>::max();
144 orient = (
operator[](1) == S[(shift+1)%n]) ? 1 : -1;
158 return (
operator[](0) == dis_iv0) ? 1 : -1;
168 geo_element_get_orientation_and_shift (*
this, dis_iv0, dis_iv1, dis_iv2, orient, shift);
178 geo_element_get_orientation_and_shift (*
this, dis_iv0, dis_iv1, dis_iv2, dis_iv3, orient, shift);
190 loc_isid = shift = 0;
192 "get_side_orientation: side have unexpected dimension "<<S.
dimension()<<
": "
196 for (
size_type loc_nsid = K.
n_subgeo(side_dim); loc_isid < loc_nsid; loc_isid++) {
198 if (sid_nloc != S.
size())
continue;
199 for (shift = 0; shift < sid_nloc; shift++) {
201 if (K[loc_jv] != S[0])
continue;
205 for (
size_type sid_kloc = 1; sid_kloc < sid_nloc; sid_kloc++) {
207 if (K[loc_kv] != S[sid_kloc]) { matches =
false;
break; }
210 if (side_dim == 1 && shift == 1) {
219 for (
size_type sid_kloc = 1; sid_kloc < sid_nloc; sid_kloc++) {
221 if (K[loc_kv] != S[sid_kloc]) { matches =
false;
break; }
223 if (matches) {
return -1; }
226 fatal_macro (
"get_side_orientation: side is not part of the element");
259 return geo_element_fix_edge_indirect (K, loc_iedg, loc_iedg_j,
order);
270 geo_element_loc_tri_inod2lattice (loc_tri_inod,
order, ij_lattice);
279 return geo_element_fix_triangle_indirect (orient, shift,
order, loc_itri_j);
288 return geo_element_fix_triangle_indirect (K, loc_ifac, loc_itri_j,
order);
299 geo_element_loc_qua_inod2lattice (loc_qua_inod,
order, ij_lattice);
308 return geo_element_fix_quadrangle_indirect (orient, shift,
order, loc_iqua_j);
317 return geo_element_fix_quadrangle_indirect (K, loc_ifac, loc_iqua_j,
order);
327 switch (subgeo_variant) {
331 default:
return loc_comp_idof_on_subgeo;
see the geo_element page for the full documentation
geo_element_indirect::orientation_type orientation_type
bool get_orientation_and_shift(const geo_element &S, orientation_type &orient, shift_type &shift) const
return orientation and shift between *this element and S
size_type & operator[](size_type loc_inod)
size_type subgeo_local_vertex(size_type subgeo_dim, size_type i_subgeo, size_type i_subgeo_vertex) const
static size_type fix_edge_indirect(const geo_element &K, size_type loc_iedg, size_type loc_iedg_j, size_type order)
static size_type fix_triangle_indirect(const geo_element &K, size_type loc_itri, size_type loc_itri_j, size_type order)
reference_element::size_type size_type
void put(std::ostream &is) const
size_type dimension() const
void get(std::istream &os)
size_type subgeo_size(size_type subgeo_dim, size_type loc_isid) const
orientation_type get_side_orientation(const geo_element &S) const
static size_type fix_indirect(const geo_element &K, size_type subgeo_variant, size_type loc_ige, size_type loc_comp_idof_on_subgeo, size_type order)
variant_type variant() const
static void loc_qua_inod2lattice(size_type loc_qua_inod, size_type order, point_basic< size_type > &ij_lattice)
orientation_type get_edge_orientation(size_type dis_iv0, size_type dis_iv1) const
static void loc_tri_inod2lattice(size_type loc_tri_inod, size_type order, point_basic< size_type > &ij_lattice)
geo_element_indirect::shift_type shift_type
orientation_type get_side_informations(const geo_element &S, size_type &loc_isid, size_type &shift) const
size_type n_subgeo(size_type subgeo_dim) const
static size_type fix_quadrangle_indirect(const geo_element &K, size_type loc_iqua, size_type loc_iqua_j, size_type order)
virtual void reset(variant_type variant, size_type order)=0
reference_element::variant_type variant_type
static const variant_type q
static const variant_type e
void set_variant(variant_type x)
static const variant_type max_variant
static const variant_type p
variant_type variant() const
static const variant_type t
#define error_macro(message)
#define fatal_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
char skip_blancs_and_tabs(std::istream &is)