15 #include "../bilininteg.hpp" 16 #include "../lininteg.hpp" 17 #include "../coefficient.hpp" 27 for (
int i = 0; i < dof; i++)
30 Trans.SetIntPoint(&ip);
41 for (
int i = 0; i < dof; i++)
44 Trans.SetIntPoint(&ip);
46 for (
int j = 0; j < x.Size(); j++)
59 if (nfe && dof == nfe->
GetDof())
75 pos_mass_inv.
Mult(mixed_mass, I);
81 const int dims,
const int p,
const DofMapType dmtype)
114 double x = ip.
x, y = ip.
y;
115 double l1x, l2x, l3x, l1y, l2y, l3y;
117 l1x = (1. - x) * (1. - x);
118 l2x = 2. * x * (1. - x);
120 l1y = (1. - y) * (1. - y);
121 l2y = 2. * y * (1. - y);
124 shape(0) = l1x * l1y;
125 shape(4) = l2x * l1y;
126 shape(1) = l3x * l1y;
127 shape(7) = l1x * l2y;
128 shape(8) = l2x * l2y;
129 shape(5) = l3x * l2y;
130 shape(3) = l1x * l3y;
131 shape(6) = l2x * l3y;
132 shape(2) = l3x * l3y;
138 double x = ip.
x, y = ip.
y;
139 double l1x, l2x, l3x, l1y, l2y, l3y;
140 double d1x, d2x, d3x, d1y, d2y, d3y;
142 l1x = (1. - x) * (1. - x);
143 l2x = 2. * x * (1. - x);
145 l1y = (1. - y) * (1. - y);
146 l2y = 2. * y * (1. - y);
156 dshape(0,0) = d1x * l1y;
157 dshape(0,1) = l1x * d1y;
159 dshape(4,0) = d2x * l1y;
160 dshape(4,1) = l2x * d1y;
162 dshape(1,0) = d3x * l1y;
163 dshape(1,1) = l3x * d1y;
165 dshape(7,0) = d1x * l2y;
166 dshape(7,1) = l1x * d2y;
168 dshape(8,0) = d2x * l2y;
169 dshape(8,1) = l2x * d2y;
171 dshape(5,0) = d3x * l2y;
172 dshape(5,1) = l3x * d2y;
174 dshape(3,0) = d1x * l3y;
175 dshape(3,1) = l1x * d3y;
177 dshape(6,0) = d2x * l3y;
178 dshape(6,1) = l2x * d3y;
180 dshape(2,0) = d3x * l3y;
181 dshape(2,1) = l3x * d3y;
189 Vector xx(&tr_ip.
x, 2), shape(
s, 9);
191 for (
int i = 0; i < 9; i++)
195 for (
int j = 0; j < 9; j++)
196 if (fabs(I(i,j) =
s[j]) < 1.0e-12)
201 for (
int i = 0; i < 9; i++)
204 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
205 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
206 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
207 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
208 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
209 0.25 * (d[0] + d[1] + d[2] + d[3]);
218 for (
int i = 0; i < 9; i++)
221 Trans.SetIntPoint(&ip);
224 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
225 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
226 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
227 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
228 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
229 0.25 * (d[0] + d[1] + d[2] + d[3]);
239 for (
int i = 0; i < 9; i++)
242 Trans.SetIntPoint(&ip);
244 for (
int j = 0; j < x.Size(); j++)
249 for (
int j = 0; j < x.Size(); j++)
251 double *d = &dofs(9*j);
253 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
254 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
255 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
256 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
257 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
258 0.25 * (d[0] + d[1] + d[2] + d[3]);
274 const double x = ip.
x, x1 = 1. - x;
278 shape(2) = 2. * x * x1;
284 const double x = ip.
x;
286 dshape(0,0) = 2. * x - 2.;
287 dshape(1,0) = 2. * x;
288 dshape(2,0) = 2. - 4. * x;
295 #ifndef MFEM_THREAD_SAFE 304 for (
int i = 1; i <
p; i++)
315 #ifdef MFEM_THREAD_SAFE 322 shape(0) = shape_x(0);
323 shape(1) = shape_x(
p);
324 for (
int i = 1; i <
p; i++)
326 shape(i+1) = shape_x(i);
335 #ifdef MFEM_THREAD_SAFE 342 dshape(0,0) = dshape_x(0);
343 dshape(1,0) = dshape_x(
p);
344 for (
int i = 1; i <
p; i++)
346 dshape(i+1,0) = dshape_x(i);
360 #ifndef MFEM_THREAD_SAFE 361 const int p1 =
p + 1;
370 for (
int j = 0; j <=
p; j++)
371 for (
int i = 0; i <=
p; i++)
382 #ifdef MFEM_THREAD_SAFE 390 for (
int o = 0, j = 0; j <=
p; j++)
391 for (
int i = 0; i <=
p; i++)
393 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
402 #ifdef MFEM_THREAD_SAFE 403 Vector shape_x(
p+1), shape_y(
p+1), dshape_x(
p+1), dshape_y(
p+1);
410 for (
int o = 0, j = 0; j <=
p; j++)
411 for (
int i = 0; i <=
p; i++)
413 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
414 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
428 #ifndef MFEM_THREAD_SAFE 429 const int p1 =
p + 1;
440 for (
int k = 0; k <=
p; k++)
441 for (
int j = 0; j <=
p; j++)
442 for (
int i = 0; i <=
p; i++)
452 #ifdef MFEM_THREAD_SAFE 453 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
460 for (
int o = 0, k = 0; k <=
p; k++)
461 for (
int j = 0; j <=
p; j++)
462 for (
int i = 0; i <=
p; i++)
464 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
473 #ifdef MFEM_THREAD_SAFE 474 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
475 Vector dshape_x(
p+1), dshape_y(
p+1), dshape_z(
p+1);
482 for (
int o = 0, k = 0; k <=
p; k++)
483 for (
int j = 0; j <=
p; j++)
484 for (
int i = 0; i <=
p; i++)
486 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
487 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
488 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
503 #ifndef MFEM_THREAD_SAFE 513 Index(
int p) { p2p3 = 2*
p + 3; }
514 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
528 for (
int i = 1; i <
p; i++)
533 for (
int i = 1; i <
p; i++)
538 for (
int i = 1; i <
p; i++)
545 for (
int j = 1; j <
p; j++)
546 for (
int i = 1; i + j <
p; i++)
555 const int p,
const double l1,
const double l2,
double *shape)
557 const double l3 = 1. - l1 - l2;
567 for (
int o = 0, j = 0; j <=
p; j++)
571 for (
int i = 0; i <=
p - j; i++)
581 const int p,
const double l1,
const double l2,
582 double *dshape_1d,
double *dshape)
584 const int dof = ((
p + 1)*(
p + 2))/2;
585 const double l3 = 1. - l1 - l2;
589 for (
int o = 0, j = 0; j <=
p; j++)
593 for (
int i = 0; i <=
p - j; i++)
600 for (
int i = 0; i <=
p; i++)
604 for (
int o = i, j = 0; j <=
p - i; j++)
616 #ifdef MFEM_THREAD_SAFE 620 for (
int i = 0; i <
dof; i++)
629 #ifdef MFEM_THREAD_SAFE 634 for (
int d = 0; d < 2; d++)
636 for (
int i = 0; i <
dof; i++)
648 #ifndef MFEM_THREAD_SAFE 658 int tri(
int k) {
return (k*(k + 1))/2; }
659 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
660 Index(
int p_) {
p = p_;
dof = tet(
p + 1); }
661 int operator()(
int i,
int j,
int k)
662 {
return dof - tet(
p - k) - tri(
p + 1 - k - j) + i; }
678 for (
int i = 1; i <
p; i++)
683 for (
int i = 1; i <
p; i++)
688 for (
int i = 1; i <
p; i++)
693 for (
int i = 1; i <
p; i++)
698 for (
int i = 1; i <
p; i++)
703 for (
int i = 1; i <
p; i++)
710 for (
int j = 1; j <
p; j++)
711 for (
int i = 1; i + j <
p; i++)
716 for (
int j = 1; j <
p; j++)
717 for (
int i = 1; i + j <
p; i++)
722 for (
int j = 1; j <
p; j++)
723 for (
int i = 1; i + j <
p; i++)
728 for (
int j = 1; j <
p; j++)
729 for (
int i = 1; i + j <
p; i++)
736 for (
int k = 1; k <
p; k++)
737 for (
int j = 1; j + k <
p; j++)
738 for (
int i = 1; i + j + k <
p; i++)
747 const int p,
const double l1,
const double l2,
const double l3,
750 const double l4 = 1. - l1 - l2 - l3;
759 for (
int o = 0, k = 0; k <=
p; k++)
762 const double ek = bp[k]*l3k;
764 for (
int j = 0; j <=
p - k; j++)
767 double ekj = ek*bpk[j]*l2j;
768 for (
int i = 0; i <=
p - k - j; i++)
780 const int p,
const double l1,
const double l2,
const double l3,
781 double *dshape_1d,
double *dshape)
783 const int dof = ((
p + 1)*(
p + 2)*(
p + 3))/6;
784 const double l4 = 1. - l1 - l2 - l3;
792 for (
int o = 0, k = 0; k <=
p; k++)
795 const double ek = bp[k]*l3k;
797 for (
int j = 0; j <=
p - k; j++)
800 double ekj = ek*bpk[j]*l2j;
801 for (
int i = 0; i <=
p - k - j; i++)
814 for (
int ok = 0, k = 0; k <=
p; k++)
817 const double ek = bp[k]*l3k;
819 for (
int i = 0; i <=
p - k; i++)
822 double eki = ek*bpk[i]*l1i;
824 for (
int j = 0; j <=
p - k - i; j++)
832 ok += ((
p - k + 2)*(
p - k + 1))/2;
839 for (
int j = 0; j <=
p; j++)
842 const double ej = bp[j]*l2j;
844 for (
int i = 0; i <=
p - j; i++)
847 double eji = ej*bpj[i]*l1i;
848 int m = ((
p + 2)*(
p + 1))/2;
849 int n = ((
p - j + 2)*(
p - j + 1))/2;
850 for (
int o = i, k = 0; k <=
p - j - i; k++)
868 #ifdef MFEM_THREAD_SAFE 872 for (
int i = 0; i <
dof; i++)
881 #ifdef MFEM_THREAD_SAFE 886 for (
int d = 0; d < 3; d++)
888 for (
int i = 0; i <
dof; i++)
902 #ifndef MFEM_THREAD_SAFE 922 for (
int i=1; i<
p; i++)
924 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
925 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
926 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
927 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
928 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
929 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
930 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
931 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
932 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
937 int nt = (
p-1)*(
p-2)/2;
938 for (
int j=1; j<
p; j++)
940 for (
int i=1; i<j; i++)
942 t_dof[6 + 9 * ne + k] = 3 *
p + k;
s_dof[6 + 9 * ne + k] = 0;
943 t_dof[6 + 9 * ne + nt + k] = 3 *
p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
950 int nq = (
p-1)*(
p-1);
951 for (
int j=1; j<
p; j++)
953 for (
int i=1; i<
p; i++)
955 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
956 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
957 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
959 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
960 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
961 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
972 for (
int j=1; j<
p; j++)
974 for (
int i=1; i<j; i++)
976 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 *
p + l;
977 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
986 for (
int i=0; i<
dof; i++)
997 #ifdef MFEM_THREAD_SAFE 1007 for (
int i=0; i<
dof; i++)
1016 #ifdef MFEM_THREAD_SAFE 1030 for (
int i=0; i<
dof; i++)
1041 #ifndef MFEM_THREAD_SAFE 1052 for (
int i = 0; i <=
p; i++)
1068 #ifdef MFEM_THREAD_SAFE 1079 dofs[vertex*
order] = 1.0;
1086 #ifndef MFEM_THREAD_SAFE 1099 for (
int o = 0, j = 0; j <=
p; j++)
1100 for (
int i = 0; i <=
p; i++)
1112 #ifdef MFEM_THREAD_SAFE 1119 for (
int o = 0, j = 0; j <=
p; j++)
1120 for (
int i = 0; i <=
p; i++)
1122 shape(o++) = shape_x(i)*shape_y(j);
1131 #ifdef MFEM_THREAD_SAFE 1132 Vector shape_x(
p+1), shape_y(
p+1), dshape_x(
p+1), dshape_y(
p+1);
1138 for (
int o = 0, j = 0; j <=
p; j++)
1139 for (
int i = 0; i <=
p; i++)
1141 dshape(o,0) = dshape_x(i)* shape_y(j);
1142 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
1153 case 0: dofs[0] = 1.0;
break;
1154 case 1: dofs[
p] = 1.0;
break;
1155 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1156 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1164 #ifndef MFEM_THREAD_SAFE 1179 for (
int o = 0, k = 0; k <=
p; k++)
1180 for (
int j = 0; j <=
p; j++)
1181 for (
int i = 0; i <=
p; i++)
1193 #ifdef MFEM_THREAD_SAFE 1194 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1201 for (
int o = 0, k = 0; k <=
p; k++)
1202 for (
int j = 0; j <=
p; j++)
1203 for (
int i = 0; i <=
p; i++)
1205 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
1214 #ifdef MFEM_THREAD_SAFE 1215 Vector shape_x(
p+1), shape_y(
p+1), shape_z(
p+1);
1216 Vector dshape_x(
p+1), dshape_y(
p+1), dshape_z(
p+1);
1223 for (
int o = 0, k = 0; k <=
p; k++)
1224 for (
int j = 0; j <=
p; j++)
1225 for (
int i = 0; i <=
p; i++)
1227 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
1228 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
1229 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
1240 case 0: dofs[0] = 1.0;
break;
1241 case 1: dofs[
p] = 1.0;
break;
1242 case 2: dofs[
p*(
p + 2)] = 1.0;
break;
1243 case 3: dofs[
p*(
p + 1)] = 1.0;
break;
1244 case 4: dofs[
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1245 case 5: dofs[
p +
p*(
p + 1)*(
p + 1)] = 1.0;
break;
1246 case 6: dofs[
dof - 1] = 1.0;
break;
1247 case 7: dofs[
dof -
p - 1] = 1.0;
break;
1256 #ifndef MFEM_THREAD_SAFE 1266 for (
int o = 0, j = 0; j <=
p; j++)
1267 for (
int i = 0; i + j <=
p; i++)
1283 #ifdef MFEM_THREAD_SAFE 1296 case 0: dofs[0] = 1.0;
break;
1297 case 1: dofs[
order] = 1.0;
break;
1298 case 2: dofs[
dof-1] = 1.0;
break;
1307 #ifndef MFEM_THREAD_SAFE 1317 for (
int o = 0, k = 0; k <=
p; k++)
1318 for (
int j = 0; j + k <=
p; j++)
1319 for (
int i = 0; i + j + k <=
p; i++)
1336 #ifdef MFEM_THREAD_SAFE 1349 case 0: dofs[0] = 1.0;
break;
1350 case 1: dofs[
order] = 1.0;
break;
1351 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
1352 case 3: dofs[
dof-1] = 1.0;
break;
1363 #ifndef MFEM_THREAD_SAFE 1375 for (
int k=0; k<=
p; k++)
1378 for (
int j=0; j<=
p; j++)
1380 for (
int i=0; i<=j; i++)
1392 for (
int i=0; i<
dof; i++)
1403 #ifdef MFEM_THREAD_SAFE 1413 for (
int i=0; i<
dof; i++)
1422 #ifdef MFEM_THREAD_SAFE 1436 for (
int i=0; i<
dof; i++)
Abstract class for all finite elements.
Class for an integration rule - an Array of IntegrationPoint.
L2Pos_WedgeElement(const int p)
Construct the L2Pos_WedgeElement of order p.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_TriangleElement(const int p)
Construct the L2Pos_TriangleElement of order p.
H1Pos_SegmentElement(const int p)
Construct the H1Pos_SegmentElement of order p.
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...
Base class for vector Coefficients that optionally depend on time and space.
Linear1DFiniteElement SegmentFE
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
Class for finite elements utilizing the always positive Bernstein basis.
L2Pos_TetrahedronElement(const int p)
Construct the L2Pos_TetrahedronElement of order p.
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
void SetSize(int s)
Resize the vector to size s.
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...
H1Pos_SegmentElement SegmentFE
H1Pos_TetrahedronElement(const int p)
Construct the H1Pos_TetrahedronElement of order p.
int dim
Dimension of reference space.
BiQuadPos2DFiniteElement()
Construct the BiQuadPos2DFiniteElement.
int Size() const
Returns the size of the vector.
Data type dense matrix using column-major storage.
double * Data() const
Returns the matrix data array.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
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...
Possible basis types. Note that not all elements can use all BasisType(s).
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
L2Pos_HexahedronElement(const int p)
Construct the L2Pos_HexahedronElement of order p.
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
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 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...
static void CalcBinomTerms(const int p, const double x, const double y, double *u)
Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocate...
H1Pos_TriangleElement(const int p)
Construct the H1Pos_TriangleElement of order p.
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...
Class for standard nodal finite elements.
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 CalcShape(const int p, const double x, const double y, double *shape)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
virtual void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat)
H1Pos_WedgeElement(const int p)
Construct the H1Pos_WedgeElement of order p.
void Invert()
Replaces the current matrix with its inverse.
L2Pos_QuadrilateralElement(const int p)
Construct the L2Pos_QuadrilateralElement of order p.
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
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)
int GetVDim()
Returns dimension of the vector.
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...
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...
double * GetData() const
Return a pointer to the beginning of the Vector data.
void Set3(const double x1, const double x2, const double x3)
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...
double p(const Vector &x, double t)
H1Pos_TriangleElement TriangleFE
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
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 SetSize(int nsize)
Change the logical size of the array, keep existing entries.
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 const int * Binom(const int p)
Get a pointer to an array containing the binomial coefficients "p choose k" for k=0,...,p for the given p.
int GetDof() const
Returns the number of degrees of freedom in the finite element.
L2Pos_TriangleElement TriangleFE
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
MFEM_EXPORT Linear2DFiniteElement TriangleFE
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement of order p.
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
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 integration point with weight.
L2Pos_SegmentElement SegmentFE
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
int dof
Number of degrees of freedom.
virtual void AssembleElementMatrix2(const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans, DenseMatrix &elmat)
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...
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 double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
L2Pos_SegmentElement(const int p)
Construct the L2Pos_SegmentElement of order p.
static void CalcBernstein(const int p, const double x, double *u)
Compute the values of the Bernstein basis functions of order p at coordinate x and store the results ...
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...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Describes the function space on each element.
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 Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
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 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 SetSize(int s)
Change the size of the DenseMatrix to s x s.
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
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.
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p assuming t...
int order
Order/degree of the shape functions.
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...