15 #include "../bilininteg.hpp"
16 #include "../coefficient.hpp"
26 for (
int i = 0; i < dof; i++)
30 dofs(i) = coeff.
Eval(Trans, ip);
40 for (
int i = 0; i < dof; i++)
44 vc.
Eval (x, Trans, ip);
45 for (
int j = 0; j < x.Size(); j++)
58 if (nfe && dof == nfe->
GetDof())
74 pos_mass_inv.
Mult(mixed_mass, I);
80 const int dims,
const int p,
const DofMapType dmtype)
113 double x = ip.
x, y = ip.
y;
114 double l1x, l2x, l3x, l1y, l2y, l3y;
116 l1x = (1. - x) * (1. - x);
117 l2x = 2. * x * (1. - x);
119 l1y = (1. - y) * (1. - y);
120 l2y = 2. * y * (1. - y);
123 shape(0) = l1x * l1y;
124 shape(4) = l2x * l1y;
125 shape(1) = l3x * l1y;
126 shape(7) = l1x * l2y;
127 shape(8) = l2x * l2y;
128 shape(5) = l3x * l2y;
129 shape(3) = l1x * l3y;
130 shape(6) = l2x * l3y;
131 shape(2) = l3x * l3y;
137 double x = ip.
x, y = ip.
y;
138 double l1x, l2x, l3x, l1y, l2y, l3y;
139 double d1x, d2x, d3x, d1y, d2y, d3y;
141 l1x = (1. - x) * (1. - x);
142 l2x = 2. * x * (1. - x);
144 l1y = (1. - y) * (1. - y);
145 l2y = 2. * y * (1. - y);
155 dshape(0,0) = d1x * l1y;
156 dshape(0,1) = l1x * d1y;
158 dshape(4,0) = d2x * l1y;
159 dshape(4,1) = l2x * d1y;
161 dshape(1,0) = d3x * l1y;
162 dshape(1,1) = l3x * d1y;
164 dshape(7,0) = d1x * l2y;
165 dshape(7,1) = l1x * d2y;
167 dshape(8,0) = d2x * l2y;
168 dshape(8,1) = l2x * d2y;
170 dshape(5,0) = d3x * l2y;
171 dshape(5,1) = l3x * d2y;
173 dshape(3,0) = d1x * l3y;
174 dshape(3,1) = l1x * d3y;
176 dshape(6,0) = d2x * l3y;
177 dshape(6,1) = l2x * d3y;
179 dshape(2,0) = d3x * l3y;
180 dshape(2,1) = l3x * d3y;
188 Vector xx(&tr_ip.
x, 2), shape(s, 9);
190 for (
int i = 0; i < 9; i++)
194 for (
int j = 0; j < 9; j++)
195 if (fabs(I(i,j) = s[j]) < 1.0e-12)
200 for (
int i = 0; i < 9; i++)
203 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
204 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
205 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
206 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
207 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
208 0.25 * (d[0] + d[1] + d[2] + d[3]);
217 for (
int i = 0; i < 9; i++)
221 d[i] = coeff.
Eval(Trans, ip);
223 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
224 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
225 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
226 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
227 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
228 0.25 * (d[0] + d[1] + d[2] + d[3]);
238 for (
int i = 0; i < 9; i++)
242 vc.
Eval (x, Trans, ip);
243 for (
int j = 0; j < x.Size(); j++)
248 for (
int j = 0; j < x.Size(); j++)
250 double *d = &dofs(9*j);
252 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
253 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
254 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
255 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
256 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
257 0.25 * (d[0] + d[1] + d[2] + d[3]);
273 const double x = ip.
x, x1 = 1. - x;
277 shape(2) = 2. * x * x1;
283 const double x = ip.
x;
285 dshape(0,0) = 2. * x - 2.;
286 dshape(1,0) = 2. * x;
287 dshape(2,0) = 2. - 4. * x;
294 #ifndef MFEM_THREAD_SAFE
303 for (
int i = 1; i <
p; i++)
314 #ifdef MFEM_THREAD_SAFE
321 shape(0) = shape_x(0);
322 shape(1) = shape_x(p);
323 for (
int i = 1; i <
p; i++)
325 shape(i+1) = shape_x(i);
334 #ifdef MFEM_THREAD_SAFE
335 Vector shape_x(p+1), dshape_x(p+1);
341 dshape(0,0) = dshape_x(0);
342 dshape(1,0) = dshape_x(p);
343 for (
int i = 1; i <
p; i++)
345 dshape(i+1,0) = dshape_x(i);
359 #ifndef MFEM_THREAD_SAFE
360 const int p1 = p + 1;
369 for (
int j = 0; j <=
p; j++)
370 for (
int i = 0; i <=
p; i++)
381 #ifdef MFEM_THREAD_SAFE
382 Vector shape_x(p+1), shape_y(p+1);
389 for (
int o = 0, j = 0; j <=
p; j++)
390 for (
int i = 0; i <=
p; i++)
392 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
401 #ifdef MFEM_THREAD_SAFE
402 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
409 for (
int o = 0, j = 0; j <=
p; j++)
410 for (
int i = 0; i <=
p; i++)
412 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
413 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
427 #ifndef MFEM_THREAD_SAFE
428 const int p1 = p + 1;
439 for (
int k = 0; k <=
p; k++)
440 for (
int j = 0; j <=
p; j++)
441 for (
int i = 0; i <=
p; i++)
451 #ifdef MFEM_THREAD_SAFE
452 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
459 for (
int o = 0, k = 0; k <=
p; k++)
460 for (
int j = 0; j <=
p; j++)
461 for (
int i = 0; i <=
p; i++)
463 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
472 #ifdef MFEM_THREAD_SAFE
473 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
474 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
481 for (
int o = 0, k = 0; k <=
p; k++)
482 for (
int j = 0; j <=
p; j++)
483 for (
int i = 0; i <=
p; i++)
485 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
486 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
487 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
502 #ifndef MFEM_THREAD_SAFE
512 Index(
int p) { p2p3 = 2*p + 3; }
513 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
527 for (
int i = 1; i <
p; i++)
532 for (
int i = 1; i <
p; i++)
537 for (
int i = 1; i <
p; i++)
544 for (
int j = 1; j <
p; j++)
545 for (
int i = 1; i + j <
p; i++)
554 const int p,
const double l1,
const double l2,
double *shape)
556 const double l3 = 1. - l1 - l2;
566 for (
int o = 0, j = 0; j <=
p; j++)
570 for (
int i = 0; i <= p - j; i++)
580 const int p,
const double l1,
const double l2,
581 double *dshape_1d,
double *dshape)
583 const int dof = ((p + 1)*(p + 2))/2;
584 const double l3 = 1. - l1 - l2;
588 for (
int o = 0, j = 0; j <=
p; j++)
592 for (
int i = 0; i <= p - j; i++)
594 dshape[o++] = s*dshape_1d[i];
599 for (
int i = 0; i <=
p; i++)
603 for (
int o = i, j = 0; j <= p - i; j++)
605 dshape[dof + o] = s*dshape_1d[j];
615 #ifdef MFEM_THREAD_SAFE
619 for (
int i = 0; i <
dof; i++)
628 #ifdef MFEM_THREAD_SAFE
633 for (
int d = 0; d < 2; d++)
635 for (
int i = 0; i <
dof; i++)
647 #ifndef MFEM_THREAD_SAFE
657 int tri(
int k) {
return (k*(k + 1))/2; }
658 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
659 Index(
int p_) { p = p_;
dof = tet(p + 1); }
660 int operator()(
int i,
int j,
int k)
661 {
return dof - tet(p - k) - tri(p + 1 - k - j) + i; }
677 for (
int i = 1; i <
p; i++)
682 for (
int i = 1; i <
p; i++)
687 for (
int i = 1; i <
p; i++)
692 for (
int i = 1; i <
p; i++)
697 for (
int i = 1; i <
p; i++)
702 for (
int i = 1; i <
p; i++)
709 for (
int j = 1; j <
p; j++)
710 for (
int i = 1; i + j <
p; i++)
715 for (
int j = 1; j <
p; j++)
716 for (
int i = 1; i + j <
p; i++)
721 for (
int j = 1; j <
p; j++)
722 for (
int i = 1; i + j <
p; i++)
727 for (
int j = 1; j <
p; j++)
728 for (
int i = 1; i + j <
p; i++)
735 for (
int k = 1; k <
p; k++)
736 for (
int j = 1; j + k <
p; j++)
737 for (
int i = 1; i + j + k <
p; i++)
746 const int p,
const double l1,
const double l2,
const double l3,
749 const double l4 = 1. - l1 - l2 - l3;
758 for (
int o = 0, k = 0; k <=
p; k++)
761 const double ek = bp[k]*l3k;
763 for (
int j = 0; j <= p - k; j++)
766 double ekj = ek*bpk[j]*l2j;
767 for (
int i = 0; i <= p - k - j; i++)
779 const int p,
const double l1,
const double l2,
const double l3,
780 double *dshape_1d,
double *dshape)
782 const int dof = ((p + 1)*(p + 2)*(p + 3))/6;
783 const double l4 = 1. - l1 - l2 - l3;
791 for (
int o = 0, k = 0; k <=
p; k++)
794 const double ek = bp[k]*l3k;
796 for (
int j = 0; j <= p - k; j++)
799 double ekj = ek*bpk[j]*l2j;
800 for (
int i = 0; i <= p - k - j; i++)
802 dshape[o++] = dshape_1d[i]*ekj;
813 for (
int ok = 0, k = 0; k <=
p; k++)
816 const double ek = bp[k]*l3k;
818 for (
int i = 0; i <= p - k; i++)
821 double eki = ek*bpk[i]*l1i;
823 for (
int j = 0; j <= p - k - i; j++)
825 dshape[dof + o] = dshape_1d[j]*eki;
831 ok += ((p - k + 2)*(p - k + 1))/2;
838 for (
int j = 0; j <=
p; j++)
841 const double ej = bp[j]*l2j;
843 for (
int i = 0; i <= p - j; i++)
846 double eji = ej*bpj[i]*l1i;
847 int m = ((p + 2)*(p + 1))/2;
848 int n = ((p - j + 2)*(p - j + 1))/2;
849 for (
int o = i, k = 0; k <= p - j - i; k++)
854 dshape[2*dof + o - n] = dshape_1d[k]*eji;
867 #ifdef MFEM_THREAD_SAFE
871 for (
int i = 0; i <
dof; i++)
880 #ifdef MFEM_THREAD_SAFE
885 for (
int d = 0; d < 3; d++)
887 for (
int i = 0; i <
dof; i++)
901 #ifndef MFEM_THREAD_SAFE
921 for (
int i=1; i<
p; i++)
923 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
924 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
925 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
926 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
927 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
928 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
929 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
930 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
931 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
936 int nt = (p-1)*(p-2)/2;
937 for (
int j=1; j<
p; j++)
939 for (
int i=1; i<j; i++)
941 t_dof[6 + 9 * ne + k] = 3 * p + k;
s_dof[6 + 9 * ne + k] = 0;
942 t_dof[6 + 9 * ne + nt + k] = 3 * p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
949 int nq = (p-1)*(p-1);
950 for (
int j=1; j<
p; j++)
952 for (
int i=1; i<
p; i++)
954 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
955 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
956 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
958 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
959 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
960 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
971 for (
int j=1; j<
p; j++)
973 for (
int i=1; i<j; i++)
975 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
976 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
985 for (
int i=0; i<
dof; i++)
996 #ifdef MFEM_THREAD_SAFE
1006 for (
int i=0; i<
dof; i++)
1015 #ifdef MFEM_THREAD_SAFE
1029 for (
int i=0; i<
dof; i++)
1040 #ifndef MFEM_THREAD_SAFE
1051 for (
int i = 0; i <=
p; i++)
1067 #ifdef MFEM_THREAD_SAFE
1078 dofs[vertex*
order] = 1.0;
1085 #ifndef MFEM_THREAD_SAFE
1098 for (
int o = 0, j = 0; j <=
p; j++)
1099 for (
int i = 0; i <=
p; i++)
1111 #ifdef MFEM_THREAD_SAFE
1112 Vector shape_x(p+1), shape_y(p+1);
1118 for (
int o = 0, j = 0; j <=
p; j++)
1119 for (
int i = 0; i <=
p; i++)
1121 shape(o++) = shape_x(i)*shape_y(j);
1130 #ifdef MFEM_THREAD_SAFE
1131 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
1137 for (
int o = 0, j = 0; j <=
p; j++)
1138 for (
int i = 0; i <=
p; i++)
1140 dshape(o,0) = dshape_x(i)* shape_y(j);
1141 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
1152 case 0: dofs[0] = 1.0;
break;
1153 case 1: dofs[
p] = 1.0;
break;
1154 case 2: dofs[p*(p + 2)] = 1.0;
break;
1155 case 3: dofs[p*(p + 1)] = 1.0;
break;
1163 #ifndef MFEM_THREAD_SAFE
1178 for (
int o = 0, k = 0; k <=
p; k++)
1179 for (
int j = 0; j <=
p; j++)
1180 for (
int i = 0; i <=
p; i++)
1192 #ifdef MFEM_THREAD_SAFE
1193 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
1200 for (
int o = 0, k = 0; k <=
p; k++)
1201 for (
int j = 0; j <=
p; j++)
1202 for (
int i = 0; i <=
p; i++)
1204 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
1213 #ifdef MFEM_THREAD_SAFE
1214 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
1215 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
1222 for (
int o = 0, k = 0; k <=
p; k++)
1223 for (
int j = 0; j <=
p; j++)
1224 for (
int i = 0; i <=
p; i++)
1226 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
1227 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
1228 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
1239 case 0: dofs[0] = 1.0;
break;
1240 case 1: dofs[
p] = 1.0;
break;
1241 case 2: dofs[p*(p + 2)] = 1.0;
break;
1242 case 3: dofs[p*(p + 1)] = 1.0;
break;
1243 case 4: dofs[p*(p + 1)*(p + 1)] = 1.0;
break;
1244 case 5: dofs[p + p*(p + 1)*(p + 1)] = 1.0;
break;
1245 case 6: dofs[
dof - 1] = 1.0;
break;
1246 case 7: dofs[
dof - p - 1] = 1.0;
break;
1255 #ifndef MFEM_THREAD_SAFE
1265 for (
int o = 0, j = 0; j <=
p; j++)
1266 for (
int i = 0; i + j <=
p; i++)
1282 #ifdef MFEM_THREAD_SAFE
1295 case 0: dofs[0] = 1.0;
break;
1296 case 1: dofs[
order] = 1.0;
break;
1297 case 2: dofs[
dof-1] = 1.0;
break;
1306 #ifndef MFEM_THREAD_SAFE
1316 for (
int o = 0, k = 0; k <=
p; k++)
1317 for (
int j = 0; j + k <=
p; j++)
1318 for (
int i = 0; i + j + k <=
p; i++)
1335 #ifdef MFEM_THREAD_SAFE
1348 case 0: dofs[0] = 1.0;
break;
1349 case 1: dofs[
order] = 1.0;
break;
1350 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
1351 case 3: dofs[
dof-1] = 1.0;
break;
1362 #ifndef MFEM_THREAD_SAFE
1374 for (
int k=0; k<=
p; k++)
1377 for (
int j=0; j<=
p; j++)
1379 for (
int i=0; i<=j; i++)
1391 for (
int i=0; i<
dof; i++)
1402 #ifdef MFEM_THREAD_SAFE
1412 for (
int i=0; i<
dof; i++)
1421 #ifdef MFEM_THREAD_SAFE
1435 for (
int i=0; i<
dof; i++)
Abstract class for all finite elements.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
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...
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.
Base class for vector Coefficients that optionally depend on time and space.
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 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 ...
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...
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.
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 SetSize(int s)
Resize the vector to size s.
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 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.
Data type dense matrix using column-major storage.
int Size() const
Returns the size 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...
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
double * GetData() const
Return a pointer to the beginning of the Vector data.
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...
Possible basis types. Note that not all elements can use all BasisType(s).
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)
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 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...
Class for standard nodal finite elements.
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 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)
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_WedgeElement(const int p)
Construct the H1Pos_WedgeElement 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...
void Invert()
Replaces the current matrix with its inverse.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
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)
void Set2(const double x1, const double x2)
int GetVDim()
Returns dimension of the vector.
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 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 Set3(const double x1, const double x2, const double x3)
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 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...
double * Data() const
Returns the matrix data array.
double p(const Vector &x, double t)
H1Pos_TriangleElement TriangleFE
int GetDof() const
Returns the number of degrees of freedom in the finite element.
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.
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.
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
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...
L2Pos_TriangleElement TriangleFE
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
Linear2DFiniteElement TriangleFE
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...
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement of order p.
Class for integration point with weight.
L2Pos_SegmentElement SegmentFE
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 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...
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 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...
Describes the function space on each element.
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 Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
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...
Linear1DFiniteElement SegmentFE
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...
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...
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...
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...