MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
fe_pos.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2026, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11
12#ifndef MFEM_FE_POS
13#define MFEM_FE_POS
14
15#include "fe_base.hpp"
16#include "fe_pyramid.hpp"
17
18namespace mfem
19{
20
21/** @brief Class for finite elements utilizing the
22 always positive Bernstein basis. */
24{
25public:
26 /** @brief Construct PositiveFiniteElement with given
27 @param D Reference space dimension
28 @param G Geometry type (of type Geometry::Type)
29 @param Do Number of degrees of freedom in the FiniteElement
30 @param O Order/degree of the FiniteElement
31 @param F FunctionSpace type of the FiniteElement
32 */
33 PositiveFiniteElement(int D, Geometry::Type G, int Do, int O,
34 int F = FunctionSpace::Pk) :
35 ScalarFiniteElement(D, G, Do, O, F)
36 { }
37
39 DenseMatrix &I) const override
40 { ScalarLocalInterpolation(Trans, I, *this); }
41
43 DenseMatrix &R) const override
44 { ScalarLocalL2Restriction(Trans, R, *this); }
45
48 DenseMatrix &I) const override
49 { CheckScalarFE(fe).ScalarLocalInterpolation(Trans, I, *this); }
50
52
53 // Low-order monotone "projection" (actually it is not a projection): the
54 // dofs are set to be the Coefficient values at the nodes.
55 void Project(Coefficient &coeff,
56 ElementTransformation &Trans, Vector &dofs) const override;
57
58 void Project (VectorCoefficient &vc,
59 ElementTransformation &Trans, Vector &dofs) const override;
60
61 void Project(const FiniteElement &fe, ElementTransformation &Trans,
62 DenseMatrix &I) const override;
63};
64
65
68{
69public:
70 PositiveTensorFiniteElement(const int dims, const int p,
71 const DofMapType dmtype);
72
74 DofToQuad::Mode mode) const override
75 {
76 return (mode == DofToQuad::FULL) ?
78 GetTensorDofToQuad(*this, ir, mode, basis1d, true, dof2quad_array);
79 }
80
81 void GetFaceMap(const int face_id, Array<int> &face_map) const override;
82};
83
84
85/// A 2D positive bi-quadratic element on a square utilizing the 2nd order
86/// Bernstein basis
88{
89public:
90 /// Construct the BiQuadPos2DFiniteElement
92 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
93 void CalcDShape(const IntegrationPoint &ip,
94 DenseMatrix &dshape) const override;
96 DenseMatrix &I) const override;
98 void Project(Coefficient &coeff, ElementTransformation &Trans,
99 Vector &dofs) const override;
101 Vector &dofs) const override;
102 void ProjectDelta(int vertex, Vector &dofs) const override
103 { dofs = 0.; dofs(vertex) = 1.; }
104};
105
106
107/// A 1D quadratic positive element utilizing the 2nd order Bernstein basis
109{
110public:
111 /// Construct the QuadPos1DFiniteElement
113 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
114 void CalcDShape(const IntegrationPoint &ip,
115 DenseMatrix &dshape) const override;
116};
117
118
119/// Arbitrary order H1 elements in 1D utilizing the Bernstein basis
121{
122private:
123#ifndef MFEM_THREAD_SAFE
124 // This is to share scratch space between invocations, which helps speed
125 // things up, but with OpenMP, we need one copy per thread. Right now, we
126 // solve this by allocating this space within each function call every time
127 // we call it. Alternatively, we should do some sort thread private thing.
128 // Brunner, Jan 2014
129 mutable Vector shape_x, dshape_x;
130#endif
131
132public:
133 /// Construct the H1Pos_SegmentElement of order @a p
134 H1Pos_SegmentElement(const int p);
135 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
136 void CalcDShape(const IntegrationPoint &ip,
137 DenseMatrix &dshape) const override;
138 void ProjectDelta(int vertex, Vector &dofs) const override;
139};
140
141
142/// Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a square
144{
145private:
146#ifndef MFEM_THREAD_SAFE
147 // See comment in H1Pos_SegmentElement
148 mutable Vector shape_x, shape_y, dshape_x, dshape_y;
149#endif
150
151public:
152 /// Construct the H1Pos_QuadrilateralElement of order @a p
153 H1Pos_QuadrilateralElement(const int p);
154 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
155 void CalcDShape(const IntegrationPoint &ip,
156 DenseMatrix &dshape) const override;
157 void ProjectDelta(int vertex, Vector &dofs) const override;
158};
159
160
161/// Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a cube
163{
164private:
165#ifndef MFEM_THREAD_SAFE
166 // See comment in H1Pos_SegmentElement.
167 mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
168#endif
169
170public:
171 /// Construct the H1Pos_HexahedronElement of order @a p
172 H1Pos_HexahedronElement(const int p);
173 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
174 void CalcDShape(const IntegrationPoint &ip,
175 DenseMatrix &dshape) const override;
176 void ProjectDelta(int vertex, Vector &dofs) const override;
177};
178
179
180/// Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a triangle
182{
183protected:
184#ifndef MFEM_THREAD_SAFE
187#endif
189
190public:
191 /// Construct the H1Pos_TriangleElement of order @a p
192 H1Pos_TriangleElement(const int p);
193
195 DofToQuad::Mode mode) const override
196 {
197 return (mode == DofToQuad::RAGGED_TENSOR) ?
198 GetRaggedTensorDofToQuad(*this, ir, mode, dof2quad_array) :
200 }
201
203 const FiniteElement &fe, const IntegrationRule &ir,
204 DofToQuad::Mode mode,
206
207 const Array<int> &GetDofMap() const { return dof_map; }
208
209 // The size of shape is (p+1)(p+2)/2 (dof).
210 static void CalcShape(const int p, const real_t x, const real_t y,
211 real_t *shape);
212
213 // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
214 static void CalcDShape(const int p, const real_t x, const real_t y,
215 real_t *dshape_1d, real_t *dshape);
216
217 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
218 void CalcDShape(const IntegrationPoint &ip,
219 DenseMatrix &dshape) const override;
220};
221
222
223/// Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a
224/// tetrahedron
226{
227protected:
228#ifndef MFEM_THREAD_SAFE
231#endif
233
234public:
235 /// Construct the H1Pos_TetrahedronElement of order @a p
236 H1Pos_TetrahedronElement(const int p);
237
239 DofToQuad::Mode mode) const override
240 {
241 return (mode == DofToQuad::RAGGED_TENSOR) ?
242 GetRaggedTensorDofToQuad(*this, ir, mode, dof2quad_array) :
244 }
245
247 const FiniteElement &fe, const IntegrationRule &ir,
248 DofToQuad::Mode mode,
250
251 const Array<int> &GetDofMap() const { return dof_map; }
252
253 // The size of shape is (p+1)(p+2)(p+3)/6 (dof).
254 static void CalcShape(const int p, const real_t x, const real_t y,
255 const real_t z, real_t *shape);
256
257 // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
258 static void CalcDShape(const int p, const real_t x, const real_t y,
259 const real_t z, real_t *dshape_1d, real_t *dshape);
260
261 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
262 void CalcDShape(const IntegrationPoint &ip,
263 DenseMatrix &dshape) const override;
264};
265
266
267/// Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a wedge
269{
270protected:
271#ifndef MFEM_THREAD_SAFE
274#endif
276
279
280public:
281 /// Construct the H1Pos_WedgeElement of order @a p
282 H1Pos_WedgeElement(const int p);
283
284 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
285 void CalcDShape(const IntegrationPoint &ip,
286 DenseMatrix &dshape) const override;
287};
288
289
290/// Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a pyramid
291///
292/// The pyramid affine-related coordinates $\lambda_i$ for $i=1,\ldots,5$ can
293/// be used to define a positive H1 basis by noting that $\lambda_i \ge 0$
294/// inside the pyramid for all $i$ and that $\sum_{i=1}^5\lambda_i=1$. This
295/// leads to $1 = (\sum_{i=1}^5\lambda_i)^p$. The terms of this product,
296/// expanded as a polynomial in the $\lambda_i$, can be used as a Bernstein
297/// basis of order $p$ on a pyramid.
299{
300protected:
301 const int nterms;
302#ifndef MFEM_THREAD_SAFE
306#endif
307 std::map<int,int> dof_map;
308
309 struct Index
310 {
311 Index() = default;
312 int operator()(int i1, int i2, int i3, int i4, int i5)
313 {
314 const int p = i1 + i2 + i3 + i4 + i5;
315 const int min24 = std::min(i2,i4);
316 i1 += min24;
317 i2 -= min24;
318 i3 += min24;
319 i4 -= min24;
320 return i2 + i3 * (p - i4 - i5) - i4 * i5 * (p + 2)
321 - ((i3 - 3) * i3) / 2 + i4 * ((p + 1) * (p + 2)) / 2
322 + (i4 * i5 * (i4 + i5)) / 2 + ((i4 - 1) * i4 * (i4 +1)) / 6
323 - (p + 2) * ((i4 - 1) * i4) / 2
324 + (i5 * (5 + 2 * p - i5) * (i5 * i5 - i5 * (5 + 2 * p)
325 + 2 * (5 + 5 * p + p * p))) / 24;
326 }
327 };
328
329public:
330 /// Construct the H1Pos_PyramidElement of order @a p
331 H1Pos_PyramidElement(const int p);
332
333 // The size of shape is (p+1)(p+2)(p+3)(p+4)/24.
334 // The size of shape_1d should be at least p+1.
335 static void CalcShape(const int p, const real_t x, const real_t y,
336 const real_t z, real_t *shape_1d, real_t *shape);
337
338 // The size of dshape is (p+1)(p+2)(p+3)(p+4)/24 by 3.
339 // The size of dshape_1d should be at least p+1.
340 static void CalcDShape(const int p, const real_t x, const real_t y,
341 const real_t z, real_t *dshape_1d, real_t *dshape);
342
343 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
344 virtual void CalcDShape(const IntegrationPoint &ip,
345 DenseMatrix &dshape) const;
346
347 // Returns (p+1)(p+2)(p+3)(p+4)/24 which is the size of the temporary arrays
348 // needed above
349 int GetNumTerms() const { return nterms; }
350};
351
352
353/// Arbitrary order L2 elements in 1D utilizing the Bernstein basis on a segment
355{
356private:
357#ifndef MFEM_THREAD_SAFE
358 mutable Vector shape_x, dshape_x;
359#endif
360
361public:
362 /// Construct the L2Pos_SegmentElement of order @a p
363 L2Pos_SegmentElement(const int p);
364 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
365 void CalcDShape(const IntegrationPoint &ip,
366 DenseMatrix &dshape) const override;
367 void ProjectDelta(int vertex, Vector &dofs) const override;
368};
369
370
371/// Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a square
373{
374private:
375#ifndef MFEM_THREAD_SAFE
376 mutable Vector shape_x, shape_y, dshape_x, dshape_y;
377#endif
378
379public:
380 /// Construct the L2Pos_QuadrilateralElement of order @a p
381 L2Pos_QuadrilateralElement(const int p);
382 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
383 void CalcDShape(const IntegrationPoint &ip,
384 DenseMatrix &dshape) const override;
385 void ProjectDelta(int vertex, Vector &dofs) const override;
386};
387
388
389/// Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a cube
391{
392private:
393#ifndef MFEM_THREAD_SAFE
394 mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
395#endif
396
397public:
398 /// Construct the L2Pos_HexahedronElement of order @a p
399 L2Pos_HexahedronElement(const int p);
400 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
401 void CalcDShape(const IntegrationPoint &ip,
402 DenseMatrix &dshape) const override;
403 void ProjectDelta(int vertex, Vector &dofs) const override;
404};
405
406
407/// Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a triangle
409{
410private:
411#ifndef MFEM_THREAD_SAFE
412 mutable Vector dshape_1d;
413#endif
414
415public:
416 /// Construct the L2Pos_TriangleElement of order @a p
417 L2Pos_TriangleElement(const int p);
418 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
419 void CalcDShape(const IntegrationPoint &ip,
420 DenseMatrix &dshape) const override;
421 void ProjectDelta(int vertex, Vector &dofs) const override;
422};
423
424
425/// Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a
426/// tetrahedron
428{
429private:
430#ifndef MFEM_THREAD_SAFE
431 mutable Vector dshape_1d;
432#endif
433
434public:
435 /// Construct the L2Pos_TetrahedronElement of order @a p
436 L2Pos_TetrahedronElement(const int p);
437 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
438 void CalcDShape(const IntegrationPoint &ip,
439 DenseMatrix &dshape) const override;
440 void ProjectDelta(int vertex, Vector &dofs) const override;
441};
442
443
444/// Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a wedge
446{
447protected:
448#ifndef MFEM_THREAD_SAFE
451#endif
453
456
457public:
458 /// Construct the L2Pos_WedgeElement of order @a p
459 L2Pos_WedgeElement(const int p);
460
461 void CalcShape(const IntegrationPoint &ip, Vector &shape) const override;
462 void CalcDShape(const IntegrationPoint &ip,
463 DenseMatrix &dshape) const override;
464};
465
466/// Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a pyramid
468{
469protected:
470 const int nterms;
471#ifndef MFEM_THREAD_SAFE
475#endif
476 std::map<int,int> dof_map;
477
478 struct Index
479 {
480 Index() = default;
481 int operator()(int i1, int i2, int i3, int i4, int i5)
482 {
483 const int p = i1 + i2 + i3 + i4 + i5;
484 const int min24 = std::min(i2,i4);
485 i1 += min24;
486 i2 -= min24;
487 i3 += min24;
488 i4 -= min24;
489 return i2 + i3 * (p - i4 - i5) - i4 * i5 * (p + 2)
490 - ((i3 - 3) * i3) / 2 + i4 * ((p + 1) * (p + 2)) / 2
491 + (i4 * i5 * (i4 + i5)) / 2 + ((i4 - 1) * i4 * (i4 +1)) / 6
492 - (p + 2) * ((i4 - 1) * i4) / 2
493 + (i5 * (5 + 2 * p - i5) * (i5 * i5 - i5 * (5 + 2 * p)
494 + 2 * (5 + 5 * p + p * p))) / 24;
495 }
496 };
497
498 // Returns (p+1)(p+2)(p+3)(p+4)/24 which is the size of the temporary arrays
499 // needed below
500 int GetNumTerms() const { return nterms; }
501
502 // The size of shape is (p+1)(p+2)(p+3)(p+4)/24.
503 // The size of shape_1d should be at least p+1.
504 static void CalcShape(const int p, const real_t x, const real_t y,
505 const real_t z, real_t *shape_1d, real_t *shape);
506
507 // The size of dshape is (p+1)(p+2)(p+3)(p+4)/24 by 3.
508 // The size of dshape_1d should be at least p+1.
509 static void CalcDShape(const int p, const real_t x, const real_t y,
510 const real_t z, real_t *dshape_1d, real_t *dshape);
511
512public:
513 /// Construct the L2Pos_PyramidElement of order @a p
514 L2Pos_PyramidElement(const int p);
515
516 virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
517 virtual void CalcDShape(const IntegrationPoint &ip,
518 DenseMatrix &dshape) const;
519};
520
521} // namespace mfem
522
523#endif
BiQuadPos2DFiniteElement()
Construct the BiQuadPos2DFiniteElement.
Definition fe_pos.cpp:95
void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Definition fe_pos.cpp:220
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:118
void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const override
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition fe_pos.cpp:191
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.hpp:102
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:142
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Definition fe_base.hpp:141
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
Definition fe_base.hpp:154
@ RAGGED_TENSOR
Ragged tensor product representation using 1D matrices/tensors with dimensions using 1D number of qua...
Definition fe_base.hpp:178
@ FULL
Full multidimensional representation which does not use tensor product structure. The ordering of the...
Definition fe_base.hpp:158
Abstract class for all finite elements.
Definition fe_base.hpp:294
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
Definition fe_base.cpp:373
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Definition fe_base.cpp:136
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
Definition fe_base.hpp:313
@ Pk
Polynomials of order k.
Definition fe_base.hpp:280
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a cube.
Definition fe_pos.hpp:163
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:475
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:454
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
Definition fe_pos.cpp:432
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:499
H1Pos_PyramidElement(const int p)
Construct the H1Pos_PyramidElement of order p.
Definition fe_pos.cpp:1347
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape_1d, real_t *shape)
Definition fe_pos.cpp:1495
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
Definition fe_pos.cpp:1548
std::map< int, int > dof_map
Definition fe_pos.hpp:307
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a square.
Definition fe_pos.hpp:144
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:384
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:425
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement of order p.
Definition fe_pos.cpp:364
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:404
Arbitrary order H1 elements in 1D utilizing the Bernstein basis.
Definition fe_pos.hpp:121
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:337
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:317
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:357
H1Pos_SegmentElement(const int p)
Construct the H1Pos_SegmentElement of order p.
Definition fe_pos.cpp:299
static const DofToQuad & GetRaggedTensorDofToQuad(const FiniteElement &fe, const IntegrationRule &ir, DofToQuad::Mode mode, Array< DofToQuad * > &dof2quad_array)
Definition fe_pos.cpp:847
const Array< int > & GetDofMap() const
Definition fe_pos.hpp:251
H1Pos_TetrahedronElement(const int p)
Construct the H1Pos_TetrahedronElement of order p.
Definition fe_pos.cpp:746
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const override
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
Definition fe_pos.hpp:238
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape)
Definition fe_pos.cpp:1055
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
Definition fe_pos.cpp:1088
Arbitrary order H1 elements in 2D utilizing the Bernstein basis on a triangle.
Definition fe_pos.hpp:182
H1Pos_TriangleElement(const int p)
Construct the H1Pos_TriangleElement of order p.
Definition fe_pos.cpp:506
static void CalcDShape(const int p, const real_t x, const real_t y, real_t *dshape_1d, real_t *dshape)
Definition fe_pos.cpp:682
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const override
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
Definition fe_pos.hpp:194
const Array< int > & GetDofMap() const
Definition fe_pos.hpp:207
static const DofToQuad & GetRaggedTensorDofToQuad(const FiniteElement &fe, const IntegrationRule &ir, DofToQuad::Mode mode, Array< DofToQuad * > &dof2quad_array)
Definition fe_pos.cpp:560
static void CalcShape(const int p, const real_t x, const real_t y, real_t *shape)
Definition fe_pos.cpp:656
Arbitrary order H1 elements in 3D utilizing the Bernstein basis on a wedge.
Definition fe_pos.hpp:269
H1Pos_TriangleElement TriangleFE
Definition fe_pos.hpp:277
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:1322
H1Pos_SegmentElement SegmentFE
Definition fe_pos.hpp:278
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:1303
H1Pos_WedgeElement(const int p)
Construct the H1Pos_WedgeElement of order p.
Definition fe_pos.cpp:1205
Class for integration point with weight.
Definition intrules.hpp:35
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:96
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a cube.
Definition fe_pos.hpp:391
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:1926
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:1971
L2Pos_HexahedronElement(const int p)
Construct the L2Pos_HexahedronElement of order p.
Definition fe_pos.cpp:1899
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:1947
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a pyramid.
Definition fe_pos.hpp:468
static void CalcDShape(const int p, const real_t x, const real_t y, const real_t z, real_t *dshape_1d, real_t *dshape)
Definition fe_pos.cpp:2284
std::map< int, int > dof_map
Definition fe_pos.hpp:476
static void CalcShape(const int p, const real_t x, const real_t y, const real_t z, real_t *shape_1d, real_t *shape)
Definition fe_pos.cpp:2231
L2Pos_PyramidElement(const int p)
Construct the L2Pos_PyramidElement of order p.
Definition fe_pos.cpp:2182
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a square.
Definition fe_pos.hpp:373
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:1845
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:1884
L2Pos_QuadrilateralElement(const int p)
Construct the L2Pos_QuadrilateralElement of order p.
Definition fe_pos.cpp:1821
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:1864
Arbitrary order L2 elements in 1D utilizing the Bernstein basis on a segment.
Definition fe_pos.hpp:355
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:1797
L2Pos_SegmentElement(const int p)
Construct the L2Pos_SegmentElement of order p.
Definition fe_pos.cpp:1776
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:1803
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:1814
L2Pos_TetrahedronElement(const int p)
Construct the L2Pos_TetrahedronElement of order p.
Definition fe_pos.cpp:2041
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:2082
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:2064
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:2071
Arbitrary order L2 elements in 2D utilizing the Bernstein basis on a triangle.
Definition fe_pos.hpp:409
L2Pos_TriangleElement(const int p)
Construct the L2Pos_TriangleElement of order p.
Definition fe_pos.cpp:1990
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:2012
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:2018
void ProjectDelta(int vertex, Vector &dofs) const override
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Definition fe_pos.cpp:2029
Arbitrary order L2 elements in 3D utilizing the Bernstein basis on a wedge.
Definition fe_pos.hpp:446
L2Pos_TriangleElement TriangleFE
Definition fe_pos.hpp:454
L2Pos_WedgeElement(const int p)
Construct the L2Pos_WedgeElement of order p.
Definition fe_pos.cpp:2095
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:2157
L2Pos_SegmentElement SegmentFE
Definition fe_pos.hpp:455
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:2138
Class for finite elements utilizing the always positive Bernstein basis.
Definition fe_pos.hpp:24
void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const override
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.
Definition fe_pos.hpp:42
PositiveFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Construct PositiveFiniteElement with given.
Definition fe_pos.hpp:33
void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const override
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition fe_pos.hpp:46
void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Definition fe_pos.cpp:25
void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const override
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition fe_pos.hpp:38
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
Definition fe_pos.cpp:81
void GetFaceMap(const int face_id, Array< int > &face_map) const override
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
Definition fe_pos.cpp:88
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const override
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
Definition fe_pos.hpp:73
A 1D quadratic positive element utilizing the 2nd order Bernstein basis.
Definition fe_pos.hpp:109
void CalcShape(const IntegrationPoint &ip, Vector &shape) const override
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition fe_pos.cpp:278
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
Definition fe_pos.cpp:270
void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const override
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition fe_pos.cpp:288
Class for finite elements with basis functions that return scalar values.
Definition fe_base.hpp:739
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get matrix I "Interpolation" defined through local L2-projection in the space defined by the fine_fe.
Definition fe_base.cpp:565
void ScalarLocalL2Restriction(ElementTransformation &Trans, DenseMatrix &R, const ScalarFiniteElement &coarse_fe) const
Get restriction matrix R defined through local L2-projection in the space defined by the coarse_fe.
Definition fe_base.cpp:606
static const ScalarFiniteElement & CheckScalarFE(const FiniteElement &fe)
Definition fe_base.hpp:741
Poly_1D::Basis & basis1d
Definition fe_base.hpp:1331
static const DofToQuad & GetTensorDofToQuad(const FiniteElement &fe, const IntegrationRule &ir, DofToQuad::Mode mode, const Poly_1D::Basis &basis, bool closed, Array< DofToQuad * > &dof2quad_array)
Definition fe_base.cpp:2697
Base class for vector Coefficients that optionally depend on time and space.
Vector data type.
Definition vector.hpp:82
float real_t
Definition config.hpp:46
real_t p(const Vector &x, real_t t)
int operator()(int i1, int i2, int i3, int i4, int i5)
Definition fe_pos.hpp:312
int operator()(int i1, int i2, int i3, int i4, int i5)
Definition fe_pos.hpp:481