16 #ifndef __H2D_ELEMENT_H
17 #define __H2D_ELEMENT_H
19 #include "../global.h"
31 HERMES_TYPE_VERTEX = 0,
80 bool is_constrained_vertex()
const;
82 void ref_element(
Element* e =
nullptr);
125 void calc_area(
bool precise_for_curvature =
false);
128 void calc_diameter();
131 void get_center(
double& x,
double& y);
147 bool get_edge_orientation(
int ie)
const;
150 return (nvert == 3) ? HERMES_MODE_TRIANGLE : HERMES_MODE_QUAD;
153 inline bool is_triangle()
const {
156 inline bool is_quad()
const {
159 inline bool is_curved()
const {
160 return cm !=
nullptr;
162 inline unsigned char get_nvert()
const {
166 inline bool is_parallelogram()
const
168 if (this->nvert == 3)
170 else if (this->
id == -1)
173 const double eps = 1e-14;
174 return fabs(this->vn[2]->x - (this->vn[1]->x + this->vn[3]->x - this->vn[0]->x)) < eps &&
175 fabs(this->vn[2]->y - (this->vn[1]->y + this->vn[3]->y - this->vn[0]->y)) < eps;
178 inline bool has_const_ref_map()
const
180 return (this->nvert == 3 || is_parallelogram()) && (!this->cm);
193 double x_center, y_center;
204 return ((i + 1) % nvert);
207 inline unsigned char prev_vert(
unsigned char i)
const
209 return ((i + nvert - 1) % nvert);
214 Element* get_neighbor(
int ie)
const;
217 void ref_all_nodes();
219 void unref_all_nodes(HashTable* ht);
225 static Node* get_edge_node();
228 const int TOP_LEVEL_REF = 123456;
double x
vertex node coordinates
unsigned char next_vert(unsigned char i) const
Helper functions to obtain the index of the next or previous vertex/edge.
Node * next_hash
next node in hash synonym list
Stores one element of a mesh.
bool visited
true if the element has been visited during assembling
CurvMap * cm
curved mapping, nullptr if not curvilinear
Stores one node of a mesh.
bool used
array item usage flag
unsigned char nvert
number of vertices (3 or 4)
::xsd::cxx::tree::type type
C++ type corresponding to the anyType XML Schema built-in type.
double area
Serves for saving the once calculated area of this element.
#define H2D_MAX_NUMBER_EDGES
A maximum number of edges of an element.
unsigned short iro_cache
Increase in integration order, see RefMap::calc_inv_ref_order()
#define H2D_MAX_NUMBER_VERTICES
A maximum number of vertices of an element.
#define H2D_MAX_ELEMENT_SONS
Macros.
bool active
0 = active, no sons; 1 = inactive (refined), has sons
double diameter
Serves for saving the once calculated diameter of this element.
Element * parent
pointer to the parent element for the current son
Stores and searches node tables.