16 #include "transformable.h"
22 #define H2D_IDENTIFY_TRF { 1.0, 1.0 }, { 0.0, 0.0 }
26 { { 0.5, 0.5 }, { -0.5, -0.5 } },
27 { { 0.5, 0.5 }, { 0.5, -0.5 } },
28 { { 0.5, 0.5 }, { -0.5, 0.5 } },
29 { { -0.5, -0.5 }, { -0.5, -0.5 } },
39 { { 0.5, 0.5 }, { -0.5, -0.5 } },
40 { { 0.5, 0.5 }, { 0.5, -0.5 } },
41 { { 0.5, 0.5 }, { 0.5, 0.5 } },
42 { { 0.5, 0.5 }, { -0.5, 0.5 } },
43 { { 1.0, 0.5 }, { 0.0, -0.5 } },
44 { { 1.0, 0.5 }, { 0.0, 0.5 } },
45 { { 0.5, 1.0 }, { -0.5, 0.0 } },
46 { { 0.5, 1.0 }, { 0.5, 0.0 } },
50 Transformable::Transformable()
57 Transformable::~Transformable() {}
82 throw Exceptions::NullException(1);
95 son[i++] = (idx - 1) & 7;
99 for (
int k = i - 1; k >= 0; k--)
113 throw Hermes::Exceptions::Exception(
"Too deep transform.");
116 Trf* tr = (
element->is_triangle() ? tri_trf + son : quad_trf + son);
118 mat->m[0] =
ctm->m[0] * tr->m[0];
119 mat->m[1] =
ctm->m[1] * tr->m[1];
120 mat->
t[0] =
ctm->m[0] * tr->t[0] +
ctm->
t[0];
121 mat->
t[1] =
ctm->m[1] * tr->t[1] +
ctm->
t[1];
128 void Transformable::push_transforms(std::set<Transformable *>& transformables,
int son)
130 for (std::set<Transformable *>::iterator it = transformables.begin(); it != transformables.end(); ++it)
132 (*it)->push_transform(son);
134 void Transformable::pop_transforms(std::set<Transformable *>& transformables)
136 for (std::set<Transformable *>::iterator it = transformables.begin(); it != transformables.end(); ++it)
138 (*it)->pop_transform();
HERMES_API Trf quad_trf[H2D_TRF_NUM]
A table of quad sub-subdomain transforms. Only first ::H2D_TRF_QUAD_NUM transformations are valid...
Stores one element of a mesh.
double2 t
The 2x2 diagonal transformation matrix.
HERMES_API Trf tri_trf[H2D_TRF_NUM]
A table of triangle sub-subdomain transforms. Only first ::H2D_TRF_TRI_NUM transformations are valid...