27 #ifndef MFEM_THREAD_SAFE
32 for (
int i = 0; i <=
p; i++)
47 #ifdef MFEM_THREAD_SAFE
63 for (
int i = 0; i <=
p; i++)
70 for (
int i = 0; i <=
p; i++)
84 #ifndef MFEM_THREAD_SAFE
91 for (
int o = 0, j = 0; j <=
p; j++)
92 for (
int i = 0; i <=
p; i++)
103 #ifdef MFEM_THREAD_SAFE
104 Vector shape_x(p+1), shape_y(p+1);
110 for (
int o = 0, j = 0; j <=
p; j++)
111 for (
int i = 0; i <=
p; i++)
113 shape(o++) = shape_x(i)*shape_y(j);
122 #ifdef MFEM_THREAD_SAFE
123 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
129 for (
int o = 0, j = 0; j <=
p; j++)
130 for (
int i = 0; i <=
p; i++)
132 dshape(o,0) = dshape_x(i)* shape_y(j);
133 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
142 #ifdef MFEM_THREAD_SAFE
143 Vector shape_x(p+1), shape_y(p+1);
146 for (
int i = 0; i <=
p; i++)
155 for (
int o = 0, j = 0; j <=
p; j++)
156 for (
int i = 0; i <=
p; i++)
158 dofs[o++] = shape_x(i)*shape_x(j);
162 for (
int o = 0, j = 0; j <=
p; j++)
163 for (
int i = 0; i <=
p; i++)
165 dofs[o++] = shape_y(i)*shape_x(j);
169 for (
int o = 0, j = 0; j <=
p; j++)
170 for (
int i = 0; i <=
p; i++)
172 dofs[o++] = shape_y(i)*shape_y(j);
176 for (
int o = 0, j = 0; j <=
p; j++)
177 for (
int i = 0; i <=
p; i++)
179 dofs[o++] = shape_x(i)*shape_y(j);
191 #ifndef MFEM_THREAD_SAFE
200 for (
int o = 0, k = 0; k <=
p; k++)
201 for (
int j = 0; j <=
p; j++)
202 for (
int i = 0; i <=
p; i++)
213 #ifdef MFEM_THREAD_SAFE
214 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
221 for (
int o = 0, k = 0; k <=
p; k++)
222 for (
int j = 0; j <=
p; j++)
223 for (
int i = 0; i <=
p; i++)
225 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
234 #ifdef MFEM_THREAD_SAFE
235 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
236 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
243 for (
int o = 0, k = 0; k <=
p; k++)
244 for (
int j = 0; j <=
p; j++)
245 for (
int i = 0; i <=
p; i++)
247 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
248 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
249 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
258 #ifdef MFEM_THREAD_SAFE
259 Vector shape_x(p+1), shape_y(p+1);
262 for (
int i = 0; i <=
p; i++)
271 for (
int o = 0, k = 0; k <=
p; k++)
272 for (
int j = 0; j <=
p; j++)
273 for (
int i = 0; i <=
p; i++)
275 dofs[o++] = shape_x(i)*shape_x(j)*shape_x(k);
279 for (
int o = 0, k = 0; k <=
p; k++)
280 for (
int j = 0; j <=
p; j++)
281 for (
int i = 0; i <=
p; i++)
283 dofs[o++] = shape_y(i)*shape_x(j)*shape_x(k);
287 for (
int o = 0, k = 0; k <=
p; k++)
288 for (
int j = 0; j <=
p; j++)
289 for (
int i = 0; i <=
p; i++)
291 dofs[o++] = shape_y(i)*shape_y(j)*shape_x(k);
295 for (
int o = 0, k = 0; k <=
p; k++)
296 for (
int j = 0; j <=
p; j++)
297 for (
int i = 0; i <=
p; i++)
299 dofs[o++] = shape_x(i)*shape_y(j)*shape_x(k);
303 for (
int o = 0, k = 0; k <=
p; k++)
304 for (
int j = 0; j <=
p; j++)
305 for (
int i = 0; i <=
p; i++)
307 dofs[o++] = shape_x(i)*shape_x(j)*shape_y(k);
311 for (
int o = 0, k = 0; k <=
p; k++)
312 for (
int j = 0; j <=
p; j++)
313 for (
int i = 0; i <=
p; i++)
315 dofs[o++] = shape_y(i)*shape_x(j)*shape_y(k);
319 for (
int o = 0, k = 0; k <=
p; k++)
320 for (
int j = 0; j <=
p; j++)
321 for (
int i = 0; i <=
p; i++)
323 dofs[o++] = shape_y(i)*shape_y(j)*shape_y(k);
327 for (
int o = 0, k = 0; k <=
p; k++)
328 for (
int j = 0; j <=
p; j++)
329 for (
int i = 0; i <=
p; i++)
331 dofs[o++] = shape_x(i)*shape_y(j)*shape_y(k);
344 #ifndef MFEM_THREAD_SAFE
354 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
357 for (
int o = 0, j = 0; j <=
p; j++)
358 for (
int i = 0; i + j <=
p; i++)
360 double w = op[i] + op[j] + op[p-i-j];
365 for (
int k = 0; k <
dof; k++)
372 for (
int o = 0, j = 0; j <=
p; j++)
373 for (
int i = 0; i + j <=
p; i++)
375 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
388 #ifdef MFEM_THREAD_SAFE
389 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
dof);
396 for (
int o = 0, j = 0; j <=
p; j++)
397 for (
int i = 0; i + j <=
p; i++)
399 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
410 #ifdef MFEM_THREAD_SAFE
411 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
412 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
420 for (
int o = 0, j = 0; j <=
p; j++)
421 for (
int i = 0; i + j <=
p; i++)
424 du(o,0) = ((dshape_x(i)* shape_l(k)) -
425 ( shape_x(i)*dshape_l(k)))*shape_y(j);
426 du(o,1) = ((dshape_y(j)* shape_l(k)) -
427 ( shape_y(j)*dshape_l(k)))*shape_x(i);
439 for (
int i = 0; i <
dof; i++)
446 for (
int i = 0; i <
dof; i++)
453 for (
int i = 0; i <
dof; i++)
469 #ifndef MFEM_THREAD_SAFE
481 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
484 for (
int o = 0, k = 0; k <=
p; k++)
485 for (
int j = 0; j + k <=
p; j++)
486 for (
int i = 0; i + j + k <=
p; i++)
488 double w = op[i] + op[j] + op[k] + op[p-i-j-k];
493 for (
int m = 0; m <
dof; m++)
501 for (
int o = 0, k = 0; k <=
p; k++)
502 for (
int j = 0; j + k <=
p; j++)
503 for (
int i = 0; i + j + k <=
p; i++)
505 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
518 #ifdef MFEM_THREAD_SAFE
519 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
528 for (
int o = 0, k = 0; k <=
p; k++)
529 for (
int j = 0; j + k <=
p; j++)
530 for (
int i = 0; i + j + k <=
p; i++)
532 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
543 #ifdef MFEM_THREAD_SAFE
544 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
545 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
554 for (
int o = 0, k = 0; k <=
p; k++)
555 for (
int j = 0; j + k <=
p; j++)
556 for (
int i = 0; i + j + k <=
p; i++)
558 int l = p - i - j - k;
559 du(o,0) = ((dshape_x(i)* shape_l(l)) -
560 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
561 du(o,1) = ((dshape_y(j)* shape_l(l)) -
562 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
563 du(o,2) = ((dshape_z(k)* shape_l(l)) -
564 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
576 for (
int i = 0; i <
dof; i++)
583 for (
int i = 0; i <
dof; i++)
590 for (
int i = 0; i <
dof; i++)
597 for (
int i = 0; i <
dof; i++)
613 #ifndef MFEM_THREAD_SAFE
625 for (
int k=0; k<=
p; k++)
628 for (
int j=0; j<=
p; j++)
630 for (
int i=0; i<=j; i++)
642 for (
int i=0; i<
dof; i++)
653 #ifdef MFEM_THREAD_SAFE
663 for (
int i=0; i<
dof; i++)
665 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
672 #ifdef MFEM_THREAD_SAFE
686 for (
int i=0; i<
dof; i++)
688 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
689 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
690 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Class for an integration rule - an Array of IntegrationPoint.
static double CalcDelta(const int p, const double x)
Evaluate a representation of a Delta function at point x.
void SetSize(int s)
Resize the vector to size s.
int dim
Dimension of reference space.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_SegmentElement of order p and BasisType btype.
Data type dense matrix using column-major storage.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Factor()
Factor the current DenseMatrix, *a.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
static void CalcBasis(const int p, const double x, double *u)
Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degre...
Class for standard nodal finite elements.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
static int VerifyOpen(int b_type)
Ensure that the BasisType of b_type is open (doesn't have Quadrature1D points on the boundary)...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Set2(const double x1, const double x2)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_QuadrilateralElement of order p and BasisType btype.
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Get coordinates of an open (GaussLegendre) set of points if degree p.
L2_WedgeElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_WedgeElement of order p and BasisType btype.
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_TetrahedronElement of order p and BasisType btype.
FDualNumber< tbase > pow(const FDualNumber< tbase > &a, const FDualNumber< tbase > &b)
pow([dual number],[dual number])
void Set3(const double x1, const double x2, const double x3)
double * Data() const
Returns the matrix data array.
double p(const Vector &x, double t)
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
Linear2DFiniteElement TriangleFE
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Class for integration point with weight.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
int dof
Number of degrees of freedom.
static int VerifyNodal(int b_type)
Ensure that the BasisType of b_type nodal (satisfies the interpolation property). ...
void Eval(const double x, Vector &u) const
Evaluate the basis functions at point x in [0,1].
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Describes the function space on each element.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Linear1DFiniteElement SegmentFE
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_HexahedronElement of order p and BasisType btype.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
L2_TriangleElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_TriangleElement of order p and BasisType btype.
int order
Order/degree of the shape functions.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...