23 for (
int i = 0; i < 4; i++)
48 MFEM_VERIFY(f != 0,
"tetrahedron is not marked");
50 for (i = 0; i < 2; i++)
52 refinement_edges[i] = f & 7;
65 e1 = refinement_edges[0];
66 e2 = refinement_edges[1];
71 if (e1 == 2 && e2 == 1) {
break; }
73 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #1");
76 if (e1 == 3 && e2 == 1) {
break; }
77 if (e1 == 2 && e2 == 4) {
break; }
82 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #2");
87 if (e1 == 2 && e2 == 1) {
break; }
90 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #3");
93 if (flag == 0 && e1 == 5 && e2 == 5)
97 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #4");
102 if (e1 == 5 && e2 == 1) {
break; }
103 if (e1 == 2 && e2 == 5) {
break; }
105 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #5");
108 mfem_error(
"Error in Tetrahedron::CreateRefinementFlag(...) #6");
130 if (middle[m] != -1) {
return 1; }
132 if (middle[m] != -1) {
return 1; }
134 if (middle[m] != -1) {
return 1; }
136 if (middle[m] != -1) {
return 1; }
138 if (middle[m] != -1) {
return 1; }
140 if (middle[m] != -1) {
return 1; }
146 for (
int i = 0; i < 4; i++)
154 int ind[4], i, j, l, L, type;
158 if ((l = length[v_to_v(
indices[1],
indices[2])]) > L) { L = l; j = 1; }
159 if ((l = length[v_to_v(
indices[2],
indices[0])]) > L) { L = l; j = 2; }
160 if ((l = length[v_to_v(
indices[0],
indices[3])]) > L) { L = l; j = 3; }
161 if ((l = length[v_to_v(
indices[1],
indices[3])]) > L) { L = l; j = 4; }
162 if ((l = length[v_to_v(
indices[2],
indices[3])]) > L) { L = l; j = 5; }
164 for (i = 0; i < 4; i++)
195 ind[0] = 2; ind[1] = 1;
197 if ((l = length[v_to_v(
indices[0],
indices[3])]) > L) { L = l; ind[0] = 3; }
198 if ((l = length[v_to_v(
indices[2],
indices[3])]) > L) { L = l; ind[0] = 5; }
201 if ((l = length[v_to_v(
indices[1],
indices[3])]) > L) { L = l; ind[1] = 4; }
202 if ((l = length[v_to_v(
indices[2],
indices[3])]) > L) { L = l; ind[1] = 5; }
221 j = 1; ind[0] = 2; ind[1] = 1;
break;
224 j = 1; ind[0] = 5; ind[1] = 1;
233 j = 1; ind[0] = 2; ind[1] = 5;
break;
251 double *a = &pm(0,0), *b = &pm(0,1), *c = &pm(0,2), *d = &pm(0,3);
254 a[0] = 0.0, a[1] = 0.0, a[2] = 0.0;
255 b[0] = 1.0, b[1] = 0.0, b[2] = 0.0;
256 c[0] = 0.0, c[1] = 1.0, c[2] = 0.0;
257 d[0] = 0.0, d[1] = 0.0, d[2] = 1.0;
259 int chain[12], n = 0;
262 chain[n++] = (transform & 7) - 1;
270 #define ASGN(a, b) (a[0] = b[0], a[1] = b[1], a[2] = b[2])
271 #define SWAP(a, b) for (int i = 0; i < 3; i++) { std::swap(a[i], b[i]); }
272 #define AVG(a, b, c) for (int i = 0; i < 3; i++) { a[i] = (b[i]+c[i])*0.5; }
278 case 0: ASGN(b, c); ASGN(c, d);
break;
279 case 1: ASGN(a, c); ASGN(c, d);
break;
280 case 2: ASGN(b, a); ASGN(a, d);
break;
281 case 3: ASGN(a, b); ASGN(b, d);
break;
282 case 4: SWAP(a, c); ASGN(b, d);
break;
283 case 5: SWAP(b, c); ASGN(a, d);
break;
285 MFEM_ABORT(
"Invalid transform.");
294 for (
int i = 0; i < 4; i++)
302 #ifdef MFEM_USE_MEMALLOC
Data type dense matrix using column-major storage.
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
virtual Element * Duplicate(Mesh *m) const
void CreateRefinementFlag(int refinement_edges[2], int type, int flag=0)
Class for linear FE on tetrahedron.
Data type tetrahedron element.
int attribute
Element's attribute (specifying material property, etc).
void mfem_error(const char *msg)
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
virtual void MarkEdge(DenseMatrix &pmat)
Mark the longest edge by assuming/changing the order of the vertices.
Linear3DFiniteElement TetrahedronFE
virtual int * GetVertices()
virtual int NeedRefinement(DSTable &v_to_v, int *middle) const
Return 1 if the element needs refinement in order to get conforming mesh.
static void GetPointMatrix(unsigned transform, DenseMatrix &pm)
Calculate point matrix corresponding to a chain of transformations.
void SetAttribute(const int attr)
Set element's attribute.
MemAlloc< Tetrahedron, 1024 > TetMemory
void SetRefinementFlag(int rf)
void ParseRefinementFlag(int refinement_edges[2], int &type, int &flag)
Abstract data type element.