16 #include "../mesh/nurbs.hpp"
35 #ifndef MFEM_THREAD_SAFE
43 MFEM_ABORT(
"method is not implemented for this class");
49 MFEM_ABORT(
"method is not implemented for this class");
55 MFEM_ABORT(
"method is not implemented for this class");
62 div_shape *= (1.0 / Trans.
Weight());
68 MFEM_ABORT(
"method is not implemented for this class");
78 #ifdef MFEM_THREAD_SAFE
83 curl_shape *= (1.0 / Trans.
Weight());
89 curl_shape *= (1.0 / Trans.
Weight());
92 MFEM_ABORT(
"Invalid dimension, Dim = " <<
dim);
98 MFEM_ABORT(
"method is not overloaded");
104 MFEM_ABORT(
"method is not overloaded");
110 MFEM_ABORT(
"method is not overloaded");
116 MFEM_ABORT(
"method is not overloaded");
123 MFEM_ABORT(
"method is not overloaded");
129 MFEM_ABORT(
"method is not overloaded");
135 MFEM_ABORT(
"method is not overloaded");
141 mfem_error (
"FiniteElement::ProjectFromNodes() (vector) is not overloaded!");
147 MFEM_ABORT(
"method is not overloaded");
152 MFEM_ABORT(
"method is not implemented for this element");
158 MFEM_ABORT(
"method is not implemented for this element");
165 MFEM_ABORT(
"method is not implemented for this element");
172 MFEM_ABORT(
"method is not implemented for this element");
179 MFEM_ABORT(
"method is not implemented for this element");
196 #ifdef MFEM_THREAD_SAFE
216 int size = (
dim*(
dim+1))/2;
222 for (
int nd = 0; nd <
dof; nd++)
224 Laplacian[nd] = hess(nd,0) + hess(nd,4) + hess(nd,5);
229 for (
int nd = 0; nd <
dof; nd++)
231 Laplacian[nd] = hess(nd,0) + hess(nd,2);
236 for (
int nd = 0; nd <
dof; nd++)
238 Laplacian[nd] = hess(nd,0);
249 int size = (
dim*(
dim+1))/2;
260 scale[1] = 2*Gij(0,1);
261 scale[2] = 2*Gij(0,2);
263 scale[3] = 2*Gij(1,2);
271 scale[1] = 2*Gij(0,1);
279 for (
int nd = 0; nd <
dof; nd++)
282 for (
int ii = 0; ii < size; ii++)
284 Laplacian[nd] += hess(nd,ii)*scale[ii];
325 int size = (dim*(dim+1))/2;
343 for (
int i = 0; i <
dim; i++)
345 for (
int j = 0; j <
dim; j++)
347 for (
int k = 0; k <
dim; k++)
349 for (
int l = 0; l <
dim; l++)
351 lhm(map[i*dim+j],map[k*dim+l]) += invJ(i,k)*invJ(j,l);
359 for (
int i = 0; i < dim*
dim; i++) { mult[map[i]]++; }
364 Mult( hess, lhm, Hessian);
370 MFEM_ABORT(
"method is not implemented for this element");
391 #ifdef MFEM_THREAD_SAFE
398 for (
int i = 0; i < fine_fe.
dof; i++)
403 for (
int j = 0; j <
dof; j++)
405 if (fabs(I(i,j) =
c_shape(j)) < 1.0e-12)
431 Vector fine_shape(fs), coarse_shape(cs);
432 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
450 fine_mass_inv.
Mult(fine_coarse_mass, I);
471 Vector fine_shape(fs), coarse_shape(cs);
472 DenseMatrix coarse_mass(cs), coarse_fine_mass(cs, fs);
489 coarse_mass_inv.
Mult(coarse_fine_mass, R);
495 R *= 1.0 / Trans.
Weight();
507 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
521 #ifdef MFEM_THREAD_SAFE
525 for (
int i = 0; i < nqpt; i++)
529 for (
int j = 0; j <
dof; j++)
531 d2q->
B[i+nqpt*j] = d2q->
Bt[j+dof*i] =
c_shape(j);
534 for (
int d = 0; d <
dim; d++)
536 for (
int j = 0; j <
dof; j++)
538 d2q->
G[i+nqpt*(d+dim*j)] = d2q->
Gt[j+dof*(i+nqpt*d)] =
vshape(j,d);
556 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
561 const int ndof =
order + 1;
562 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
dim) + 0.5);
572 Vector val(ndof), grad(ndof);
573 for (
int i = 0; i < nqpt; i++)
578 for (
int j = 0; j < ndof; j++)
580 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
581 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
596 for (
int i = 0; i <
dof; i++)
606 for (
int j = 0; j < fe.
GetDof(); j++)
608 curl(i,j) = w * curl_shape(j,0);
635 #ifdef MFEM_THREAD_SAFE
641 for (
int j = 0; j <
dof; j++)
661 for (
int i = 0; i <
dof; i++)
667 dofs(i) = coeff.
Eval (Trans, ip);
670 dofs(i) *= Trans.
Weight();
681 for (
int i = 0; i <
dof; i++)
685 vc.
Eval (x, Trans, ip);
690 for (
int j = 0; j < x.Size(); j++)
692 dofs(dof*j+i) = x(j);
704 for (
int k = 0; k <
dof; k++)
709 for (
int r = 0; r < MQ.Height(); r++)
711 for (
int d = 0; d < MQ.Width(); d++)
713 dofs(k+dof*(d+MQ.Width()*r)) = MQ(r,d);
729 for (
int k = 0; k <
dof; k++)
732 for (
int j = 0; j < shape.Size(); j++)
734 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
740 for (
int k = 0; k <
dof; k++)
748 for (
int j = 0; j < shape.Size(); j++)
750 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
760 for (
int k = 0; k <
dof; k++)
771 I(k+d*dof,j) =
vshape(j,d);
787 for (
int k = 0; k <
dof; k++)
793 Mult(dshape, Jinv, grad_k);
798 for (
int j = 0; j < grad_k.Height(); j++)
799 for (
int d = 0; d <
dim; d++)
801 grad(k+d*dof,j) = grad_k(j,d);
814 for (
int k = 0; k <
dof; k++)
822 for (
int j = 0; j < div_shape.Size(); j++)
824 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j)/detJ;
829 for (
int j = 0; j < div_shape.Size(); j++)
831 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j);
841 for (
int i = 0; i <
dof; i++)
845 dofs(i) = coeff.
Eval(Trans, ip);
855 for (
int i = 0; i <
dof; i++)
859 vc.
Eval (x, Trans, ip);
860 for (
int j = 0; j < x.Size(); j++)
862 dofs(dof*j+i) = x(j);
889 pos_mass_inv.
Mult(mixed_mass, I);
894 void VectorFiniteElement::CalcShape (
897 mfem_error (
"Error: Cannot use scalar CalcShape(...) function with\n"
898 " VectorFiniteElements!");
901 void VectorFiniteElement::CalcDShape (
902 const IntegrationPoint &ip, DenseMatrix &dshape )
const
904 mfem_error (
"Error: Cannot use scalar CalcDShape(...) function with\n"
905 " VectorFiniteElements!");
937 MFEM_ABORT(
"Invalid dimension, Dim = " <<
dim);
941 MFEM_ABORT(
"Invalid MapType = " <<
map_type);
949 #ifdef MFEM_THREAD_SAFE
954 shape *= (1.0 / Trans.
Weight());
961 #ifdef MFEM_THREAD_SAFE
974 MFEM_ASSERT(vc.
GetVDim() == sdim,
"");
976 const bool square_J = (
dim == sdim);
978 for (
int k = 0; k <
dof; k++)
984 if (!square_J) { dofs(k) /= Trans.
Weight(); }
993 const bool square_J = (
dim == sdim);
995 for (
int k = 0; k <
dof; k++)
1001 if (!square_J) { dofs(k) /= Trans.
Weight(); }
1012 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
1013 const bool square_J = (
dim == sdim);
1015 Vector nk_phys(sdim), dofs_k(MQ.Height());
1016 MFEM_ASSERT(dofs.
Size() ==
dof*MQ.Height(),
"");
1018 for (
int k = 0; k <
dof; k++)
1024 if (!square_J) { nk_phys /= T.
Weight(); }
1025 MQ.Mult(nk_phys, dofs_k);
1026 for (
int r = 0; r < MQ.Height(); r++)
1028 dofs(k+dof*r) = dofs_k(r);
1044 for (
int k = 0; k <
dof; k++)
1055 double w = 1.0/Trans.
Weight();
1056 for (
int d = 0; d <
dim; d++)
1062 for (
int j = 0; j < shape.Size(); j++)
1064 double s = shape(j);
1065 if (fabs(s) < 1e-12)
1071 for (
int d = 0; d < sdim; d++)
1073 I(k,j+d*shape.Size()) = s*vk[d];
1084 const bool square_J = (
dim == sdim);
1087 for (
int k = 0; k <
dof; k++)
1099 if (!square_J) { vshapenk /= Trans.
Weight(); }
1100 for (
int j=0; j<vshapenk.Size(); j++)
1102 I(k,j) = vshapenk(j);
1114 mfem_error(
"VectorFiniteElement::ProjectGrad_RT works only in 2D!");
1122 for (
int k = 0; k <
dof; k++)
1125 tk[0] = nk[d2n[k]*
dim+1];
1126 tk[1] = -nk[d2n[k]*
dim];
1127 dshape.Mult(tk, grad_k);
1128 for (
int j = 0; j < grad_k.Size(); j++)
1130 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1139 #ifdef MFEM_THREAD_SAFE
1152 for (
int k = 0; k <
dof; k++)
1159 J *= 1.0 / Trans.
Weight();
1166 for (
int j = 0; j < curl_k.Size(); j++)
1168 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1181 for (
int k = 0; k <
dof; k++)
1184 curl_shape.Mult(nk + d2n[k]*
dim, curl_k);
1185 for (
int j = 0; j < curl_k.Size(); j++)
1187 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1199 for (
int k = 0; k <
dof; k++)
1213 for (
int k = 0; k <
dof; k++)
1229 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
1231 Vector tk_phys(sdim), dofs_k(MQ.Height());
1232 MFEM_ASSERT(dofs.
Size() ==
dof*MQ.Height(),
"");
1234 for (
int k = 0; k <
dof; k++)
1240 MQ.Mult(tk_phys, dofs_k);
1241 for (
int r = 0; r < MQ.Height(); r++)
1243 dofs(k+dof*r) = dofs_k(r);
1259 for (
int k = 0; k <
dof; k++)
1270 double w = 1.0/Trans.
Weight();
1271 for (
int d = 0; d < sdim; d++)
1277 for (
int j = 0; j < shape.Size(); j++)
1279 double s = shape(j);
1280 if (fabs(s) < 1e-12)
1286 for (
int d = 0; d < sdim; d++)
1288 I(k, j + d*shape.Size()) = s*vk[d];
1301 for (
int k = 0; k <
dof; k++)
1313 for (
int j=0; j<vshapetk.Size(); j++)
1315 I(k, j) = vshapetk(j);
1331 for (
int k = 0; k <
dof; k++)
1334 dshape.Mult(tk + d2t[k]*
dim, grad_k);
1335 for (
int j = 0; j < grad_k.Size(); j++)
1337 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1352 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
1369 for (
int k=0; k<fs; ++k)
1371 for (
int j=0; j<cs; ++j)
1374 for (
int d1=0; d1<
dim; ++d1)
1376 for (
int d2=0; d2<
dim; ++d2)
1378 Mkj += w*fine_shape(k,d1)*adjJ(d2,d1)*coarse_shape(j,d2);
1381 fine_coarse_mass(k,j) += (fabs(Mkj) < 1e-12) ? 0.0 : Mkj;
1386 fine_mass_inv.
Mult(fine_coarse_mass, I);
1400 #ifdef MFEM_THREAD_SAFE
1410 for (
int k = 0; k <
dof; k++)
1421 for (
int i = 0; i <
dim; i++)
1423 Ikj +=
vshape(j, i) * vk[i];
1425 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1440 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
1456 for (
int k=0; k<fs; ++k)
1458 for (
int j=0; j<cs; ++j)
1461 for (
int d1=0; d1<
dim; ++d1)
1463 for (
int d2=0; d2<
dim; ++d2)
1465 Mkj += ip.
weight*fine_shape(k,d1)*
J(d1,d2)*coarse_shape(j,d2);
1468 fine_coarse_mass(k,j) += (fabs(Mkj) < 1e-12) ? 0.0 : Mkj;
1473 fine_mass_inv.
Mult(fine_coarse_mass, I);
1485 #ifdef MFEM_THREAD_SAFE
1495 for (
int k = 0; k <
dof; k++)
1506 for (
int i = 0; i <
dim; i++)
1508 Ikj +=
vshape(j, i) * vk[i];
1510 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1523 #ifdef MFEM_THREAD_SAFE
1529 const double weight = Trans.
Weight();
1530 for (
int j = 0; j <
dof; j++)
1539 for (
int k = 0; k <
dof; k++)
1542 for (
int d = 0; d <
dim; d++)
1544 R_jk +=
vshape(k,d)*pt_data[d];
1566 #ifdef MFEM_THREAD_SAFE
1572 for (
int j = 0; j <
dof; j++)
1579 Jinv.
Mult(tk+
dim*d2t[j], pt_data);
1580 for (
int k = 0; k <
dof; k++)
1583 for (
int d = 0; d <
dim; d++)
1585 R_jk +=
vshape(k,d)*pt_data[d];
1630 shape(0) = 1. - ip.
x;
1655 shape(0) = 1. - ip.
x - ip.
y;
1663 dshape(0,0) = -1.; dshape(0,1) = -1.;
1664 dshape(1,0) = 1.; dshape(1,1) = 0.;
1665 dshape(2,0) = 0.; dshape(2,1) = 1.;
1684 shape(0) = (1. - ip.
x) * (1. - ip.
y) ;
1685 shape(1) = ip.
x * (1. - ip.
y) ;
1686 shape(2) = ip.
x * ip.
y ;
1687 shape(3) = (1. - ip.
x) * ip.
y ;
1693 dshape(0,0) = -1. + ip.
y; dshape(0,1) = -1. + ip.
x ;
1694 dshape(1,0) = 1. - ip.
y; dshape(1,1) = -ip.
x ;
1695 dshape(2,0) = ip.
y ; dshape(2,1) = ip.
x ;
1696 dshape(3,0) = -ip.
y ; dshape(3,1) = 1. - ip.
x ;
1702 h(0,0) = 0.; h(0,1) = 1.; h(0,2) = 0.;
1703 h(1,0) = 0.; h(1,1) = -1.; h(1,2) = 0.;
1704 h(2,0) = 0.; h(2,1) = 1.; h(2,2) = 0.;
1705 h(3,0) = 0.; h(3,1) = -1.; h(3,2) = 0.;
1723 const double x = ip.
x, y = ip.
y;
1725 shape(0) = 5./3. - 2. * (x + y);
1726 shape(1) = 2. * (x - 1./6.);
1727 shape(2) = 2. * (y - 1./6.);
1733 dshape(0,0) = -2.; dshape(0,1) = -2.;
1734 dshape(1,0) = 2.; dshape(1,1) = 0.;
1735 dshape(2,0) = 0.; dshape(2,1) = 2.;
1740 dofs(vertex) = 2./3.;
1741 dofs((vertex+1)%3) = 1./6.;
1742 dofs((vertex+2)%3) = 1./6.;
1747 const double GaussBiLinear2DFiniteElement::p[] =
1748 { 0.2113248654051871177454256, 0.7886751345948128822545744 };
1766 const double x = ip.
x, y = ip.
y;
1768 shape(0) = 3. * (p[1] - x) * (p[1] - y);
1769 shape(1) = 3. * (x - p[0]) * (p[1] - y);
1770 shape(2) = 3. * (x - p[0]) * (y - p[0]);
1771 shape(3) = 3. * (p[1] - x) * (y - p[0]);
1777 const double x = ip.
x, y = ip.
y;
1779 dshape(0,0) = 3. * (y - p[1]); dshape(0,1) = 3. * (x - p[1]);
1780 dshape(1,0) = 3. * (p[1] - y); dshape(1,1) = 3. * (p[0] - x);
1781 dshape(2,0) = 3. * (y - p[0]); dshape(2,1) = 3. * (x - p[0]);
1782 dshape(3,0) = 3. * (p[0] - y); dshape(3,1) = 3. * (p[1] - x);
1788 dofs(vertex) = p[1]*p[1];
1789 dofs((vertex+1)%4) = p[0]*p[1];
1790 dofs((vertex+2)%4) = p[0]*p[0];
1791 dofs((vertex+3)%4) = p[0]*p[1];
1812 shape(0) = 1. - ip.
x - ip.
y;
1820 dshape(0,0) = -1.; dshape(0,1) = -1.;
1821 dshape(1,0) = 1.; dshape(1,1) = 0.;
1822 dshape(2,0) = 0.; dshape(2,1) = 1.;
1838 double l1 = 1.0 - x, l2 = x, l3 = 2. * x - 1.;
1840 shape(0) = l1 * (-l3);
1842 shape(2) = 4. * l1 * l2;
1850 dshape(0,0) = 4. * x - 3.;
1851 dshape(1,0) = 4. * x - 1.;
1852 dshape(2,0) = 4. - 8. * x;
1867 const double x = ip.
x, x1 = 1. - x;
1871 shape(2) = 2. * x * x1;
1877 const double x = ip.
x;
1879 dshape(0,0) = 2. * x - 2.;
1880 dshape(1,0) = 2. * x;
1881 dshape(2,0) = 2. - 4. * x;
1904 double x = ip.
x, y = ip.
y;
1905 double l1 = 1.-x-y, l2 = x, l3 = y;
1907 shape(0) = l1 * (2. * l1 - 1.);
1908 shape(1) = l2 * (2. * l2 - 1.);
1909 shape(2) = l3 * (2. * l3 - 1.);
1910 shape(3) = 4. * l1 * l2;
1911 shape(4) = 4. * l2 * l3;
1912 shape(5) = 4. * l3 * l1;
1918 double x = ip.
x, y = ip.
y;
1921 dshape(0,1) = 4. * (x + y) - 3.;
1923 dshape(1,0) = 4. * x - 1.;
1927 dshape(2,1) = 4. * y - 1.;
1929 dshape(3,0) = -4. * (2. * x + y - 1.);
1930 dshape(3,1) = -4. * x;
1932 dshape(4,0) = 4. * y;
1933 dshape(4,1) = 4. * x;
1935 dshape(5,0) = -4. * y;
1936 dshape(5,1) = -4. * (x + 2. * y - 1.);
1976 case 0: dofs(3) = 0.25; dofs(5) = 0.25;
break;
1977 case 1: dofs(3) = 0.25; dofs(4) = 0.25;
break;
1978 case 2: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1984 const double GaussQuad2DFiniteElement::p[] =
1985 { 0.0915762135097707434595714634022015, 0.445948490915964886318329253883051 };
2003 for (
int i = 0; i < 6; i++)
2020 const double x = ip.
x, y = ip.
y;
2034 const double x = ip.
x, y = ip.
y;
2035 D(0,0) = 0.; D(0,1) = 0.;
2036 D(1,0) = 1.; D(1,1) = 0.;
2037 D(2,0) = 0.; D(2,1) = 1.;
2038 D(3,0) = 2. * x; D(3,1) = 0.;
2039 D(4,0) = y; D(4,1) = x;
2040 D(5,0) = 0.; D(5,1) = 2. * y;
2072 double x = ip.
x, y = ip.
y;
2073 double l1x, l2x, l3x, l1y, l2y, l3y;
2075 l1x = (x - 1.) * (2. * x - 1);
2076 l2x = 4. * x * (1. - x);
2077 l3x = x * (2. * x - 1.);
2078 l1y = (y - 1.) * (2. * y - 1);
2079 l2y = 4. * y * (1. - y);
2080 l3y = y * (2. * y - 1.);
2082 shape(0) = l1x * l1y;
2083 shape(4) = l2x * l1y;
2084 shape(1) = l3x * l1y;
2085 shape(7) = l1x * l2y;
2086 shape(8) = l2x * l2y;
2087 shape(5) = l3x * l2y;
2088 shape(3) = l1x * l3y;
2089 shape(6) = l2x * l3y;
2090 shape(2) = l3x * l3y;
2096 double x = ip.
x, y = ip.
y;
2097 double l1x, l2x, l3x, l1y, l2y, l3y;
2098 double d1x, d2x, d3x, d1y, d2y, d3y;
2100 l1x = (x - 1.) * (2. * x - 1);
2101 l2x = 4. * x * (1. - x);
2102 l3x = x * (2. * x - 1.);
2103 l1y = (y - 1.) * (2. * y - 1);
2104 l2y = 4. * y * (1. - y);
2105 l3y = y * (2. * y - 1.);
2114 dshape(0,0) = d1x * l1y;
2115 dshape(0,1) = l1x * d1y;
2117 dshape(4,0) = d2x * l1y;
2118 dshape(4,1) = l2x * d1y;
2120 dshape(1,0) = d3x * l1y;
2121 dshape(1,1) = l3x * d1y;
2123 dshape(7,0) = d1x * l2y;
2124 dshape(7,1) = l1x * d2y;
2126 dshape(8,0) = d2x * l2y;
2127 dshape(8,1) = l2x * d2y;
2129 dshape(5,0) = d3x * l2y;
2130 dshape(5,1) = l3x * d2y;
2132 dshape(3,0) = d1x * l3y;
2133 dshape(3,1) = l1x * d3y;
2135 dshape(6,0) = d2x * l3y;
2136 dshape(6,1) = l2x * d3y;
2138 dshape(2,0) = d3x * l3y;
2139 dshape(2,1) = l3x * d3y;
2151 case 0: dofs(4) = 0.25; dofs(7) = 0.25;
break;
2152 case 1: dofs(4) = 0.25; dofs(5) = 0.25;
break;
2153 case 2: dofs(5) = 0.25; dofs(6) = 0.25;
break;
2154 case 3: dofs(6) = 0.25; dofs(7) = 0.25;
break;
2170 TensorBasisElement::DofMapType::Sr_DOF_MAP);
2181 for (
int j = 0; j <=
p; j++)
2183 for (
int i = 0; i <=
p; i++)
2199 double x = ip.
x, y = ip.
y;
2205 edgeNodalBasis.Eval(x, nodalX);
2206 edgeNodalBasis.Eval(y, nodalY);
2210 for (
int i = 0; i < p-1; i++)
2212 shape(4 + 0*(p-1) + i) = (nodalX(i+1))*(1.-y);
2213 shape(4 + 1*(p-1) + i) = (nodalY(i+1))*x;
2214 shape(4 + 3*(p-1) - i - 1) = (nodalX(i+1)) * y;
2215 shape(4 + 4*(p-1) - i - 1) = (nodalY(i+1)) * (1. - x);
2233 for (
int i = 0; i<p-1; i++)
2235 vtx0fix += (1-edgePts[i+1])*(shape(4 + i) +
2236 shape(4 + 4*(p-1) - i - 1));
2237 vtx1fix += (1-edgePts[i+1])*(shape(4 + 1*(p-1) + i) +
2238 shape(4 + (p-2)-i));
2239 vtx2fix += (1-edgePts[i+1])*(shape(4 + 2*(p-1) + i) +
2241 vtx3fix += (1-edgePts[i+1])*(shape(4 + 3*(p-1) + i) +
2244 shape(0) = bilinearsAtIP(0) - vtx0fix;
2245 shape(1) = bilinearsAtIP(1) - vtx1fix;
2246 shape(2) = bilinearsAtIP(2) - vtx2fix;
2247 shape(3) = bilinearsAtIP(3) - vtx3fix;
2253 double *legX =
new double[p-1];
2254 double *legY =
new double[p-1];
2260 int interior_total = 0;
2261 for (
int j = 4; j < p + 1; j++)
2263 for (
int k = 0; k < j-3; k++)
2265 shape(4 + 4*(p-1) + interior_total)
2266 = legX[k] * legY[j-4-k] * x * (1. - x) * y * (1. - y);
2273 delete storeLegendre;
2281 double x = ip.
x, y = ip.
y;
2289 edgeNodalBasis.Eval(x, nodalX, DnodalX);
2290 edgeNodalBasis.Eval(y, nodalY, DnodalY);
2292 for (
int i = 0; i < p-1; i++)
2294 dshape(4 + 0*(p-1) + i,0) = DnodalX(i+1) * (1.-y);
2295 dshape(4 + 0*(p-1) + i,1) = -nodalX(i+1);
2296 dshape(4 + 1*(p-1) + i,0) = nodalY(i+1);
2297 dshape(4 + 1*(p-1) + i,1) = DnodalY(i+1)*x;
2298 dshape(4 + 3*(p-1) - i - 1,0) = DnodalX(i+1)*y;
2299 dshape(4 + 3*(p-1) - i - 1,1) = nodalX(i+1);
2300 dshape(4 + 4*(p-1) - i - 1,0) = -nodalY(i+1);
2301 dshape(4 + 4*(p-1) - i - 1,1) = DnodalY(i+1) * (1.-x);
2310 dshape(0,0) = DbilinearsAtIP(0,0);
2311 dshape(0,1) = DbilinearsAtIP(0,1);
2312 dshape(1,0) = DbilinearsAtIP(1,0);
2313 dshape(1,1) = DbilinearsAtIP(1,1);
2314 dshape(2,0) = DbilinearsAtIP(2,0);
2315 dshape(2,1) = DbilinearsAtIP(2,1);
2316 dshape(3,0) = DbilinearsAtIP(3,0);
2317 dshape(3,1) = DbilinearsAtIP(3,1);
2319 for (
int i = 0; i<p-1; i++)
2321 dshape(0,0) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 0) +
2322 dshape(4 + 4*(p-1) - i - 1,0));
2323 dshape(0,1) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 1) +
2324 dshape(4 + 4*(p-1) - i - 1,1));
2325 dshape(1,0) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 0) +
2326 dshape(4 + (p-2)-i, 0));
2327 dshape(1,1) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 1) +
2328 dshape(4 + (p-2)-i, 1));
2329 dshape(2,0) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 0) +
2330 dshape(1 + 2*p-i, 0));
2331 dshape(2,1) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 1) +
2332 dshape(1 + 2*p-i, 1));
2333 dshape(3,0) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 0) +
2334 dshape(3*p - i, 0));
2335 dshape(3,1) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 1) +
2336 dshape(3*p - i, 1));
2341 double *legX =
new double[p-1];
2342 double *legY =
new double[p-1];
2343 double *DlegX =
new double[p-1];
2344 double *DlegY =
new double[p-1];
2350 int interior_total = 0;
2351 for (
int j = 4; j < p + 1; j++)
2353 for (
int k = 0; k < j-3; k++)
2355 dshape(4 + 4*(p-1) + interior_total, 0) =
2356 legY[j-4-k]*y*(1-y) * (DlegX[k]*x*(1-x) + legX[k]*(1-2*x));
2357 dshape(4 + 4*(p-1) + interior_total, 1) =
2358 legX[k]*x*(1-x) * (DlegY[j-4-k]*y*(1-y) + legY[j-4-k]*(1-2*y));
2366 delete storeLegendre;
2413 double x = ip.
x, y = ip.
y;
2414 double l1x, l2x, l3x, l1y, l2y, l3y;
2416 l1x = (1. - x) * (1. - x);
2417 l2x = 2. * x * (1. - x);
2419 l1y = (1. - y) * (1. - y);
2420 l2y = 2. * y * (1. - y);
2423 shape(0) = l1x * l1y;
2424 shape(4) = l2x * l1y;
2425 shape(1) = l3x * l1y;
2426 shape(7) = l1x * l2y;
2427 shape(8) = l2x * l2y;
2428 shape(5) = l3x * l2y;
2429 shape(3) = l1x * l3y;
2430 shape(6) = l2x * l3y;
2431 shape(2) = l3x * l3y;
2437 double x = ip.
x, y = ip.
y;
2438 double l1x, l2x, l3x, l1y, l2y, l3y;
2439 double d1x, d2x, d3x, d1y, d2y, d3y;
2441 l1x = (1. - x) * (1. - x);
2442 l2x = 2. * x * (1. - x);
2444 l1y = (1. - y) * (1. - y);
2445 l2y = 2. * y * (1. - y);
2455 dshape(0,0) = d1x * l1y;
2456 dshape(0,1) = l1x * d1y;
2458 dshape(4,0) = d2x * l1y;
2459 dshape(4,1) = l2x * d1y;
2461 dshape(1,0) = d3x * l1y;
2462 dshape(1,1) = l3x * d1y;
2464 dshape(7,0) = d1x * l2y;
2465 dshape(7,1) = l1x * d2y;
2467 dshape(8,0) = d2x * l2y;
2468 dshape(8,1) = l2x * d2y;
2470 dshape(5,0) = d3x * l2y;
2471 dshape(5,1) = l3x * d2y;
2473 dshape(3,0) = d1x * l3y;
2474 dshape(3,1) = l1x * d3y;
2476 dshape(6,0) = d2x * l3y;
2477 dshape(6,1) = l2x * d3y;
2479 dshape(2,0) = d3x * l3y;
2480 dshape(2,1) = l3x * d3y;
2488 Vector xx(&tr_ip.
x, 2), shape(s, 9);
2490 for (
int i = 0; i < 9; i++)
2494 for (
int j = 0; j < 9; j++)
2495 if (fabs(I(i,j) = s[j]) < 1.0e-12)
2500 for (
int i = 0; i < 9; i++)
2502 double *d = &I(0,i);
2503 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2504 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2505 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2506 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2507 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2508 0.25 * (d[0] + d[1] + d[2] + d[3]);
2517 for (
int i = 0; i < 9; i++)
2521 d[i] = coeff.
Eval(Trans, ip);
2523 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2524 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2525 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2526 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2527 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2528 0.25 * (d[0] + d[1] + d[2] + d[3]);
2538 for (
int i = 0; i < 9; i++)
2542 vc.
Eval (x, Trans, ip);
2543 for (
int j = 0; j < x.Size(); j++)
2548 for (
int j = 0; j < x.Size(); j++)
2550 double *d = &dofs(9*j);
2552 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2553 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2554 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2555 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2556 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2557 0.25 * (d[0] + d[1] + d[2] + d[3]);
2565 const double p1 = 0.5*(1.-sqrt(3./5.));
2590 const double a = sqrt(5./3.);
2591 const double p1 = 0.5*(1.-sqrt(3./5.));
2593 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2594 double l1x, l2x, l3x, l1y, l2y, l3y;
2596 l1x = (x - 1.) * (2. * x - 1);
2597 l2x = 4. * x * (1. - x);
2598 l3x = x * (2. * x - 1.);
2599 l1y = (y - 1.) * (2. * y - 1);
2600 l2y = 4. * y * (1. - y);
2601 l3y = y * (2. * y - 1.);
2603 shape(0) = l1x * l1y;
2604 shape(4) = l2x * l1y;
2605 shape(1) = l3x * l1y;
2606 shape(7) = l1x * l2y;
2607 shape(8) = l2x * l2y;
2608 shape(5) = l3x * l2y;
2609 shape(3) = l1x * l3y;
2610 shape(6) = l2x * l3y;
2611 shape(2) = l3x * l3y;
2617 const double a = sqrt(5./3.);
2618 const double p1 = 0.5*(1.-sqrt(3./5.));
2620 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2621 double l1x, l2x, l3x, l1y, l2y, l3y;
2622 double d1x, d2x, d3x, d1y, d2y, d3y;
2624 l1x = (x - 1.) * (2. * x - 1);
2625 l2x = 4. * x * (1. - x);
2626 l3x = x * (2. * x - 1.);
2627 l1y = (y - 1.) * (2. * y - 1);
2628 l2y = 4. * y * (1. - y);
2629 l3y = y * (2. * y - 1.);
2631 d1x = a * (4. * x - 3.);
2632 d2x = a * (4. - 8. * x);
2633 d3x = a * (4. * x - 1.);
2634 d1y = a * (4. * y - 3.);
2635 d2y = a * (4. - 8. * y);
2636 d3y = a * (4. * y - 1.);
2638 dshape(0,0) = d1x * l1y;
2639 dshape(0,1) = l1x * d1y;
2641 dshape(4,0) = d2x * l1y;
2642 dshape(4,1) = l2x * d1y;
2644 dshape(1,0) = d3x * l1y;
2645 dshape(1,1) = l3x * d1y;
2647 dshape(7,0) = d1x * l2y;
2648 dshape(7,1) = l1x * d2y;
2650 dshape(8,0) = d2x * l2y;
2651 dshape(8,1) = l2x * d2y;
2653 dshape(5,0) = d3x * l2y;
2654 dshape(5,1) = l3x * d2y;
2656 dshape(3,0) = d1x * l3y;
2657 dshape(3,1) = l1x * d3y;
2659 dshape(6,0) = d2x * l3y;
2660 dshape(6,1) = l2x * d3y;
2662 dshape(2,0) = d3x * l3y;
2663 dshape(2,1) = l3x * d3y;
2706 double x = ip.
x, y = ip.
y;
2708 double w1x, w2x, w3x, w1y, w2y, w3y;
2709 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2711 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2712 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2714 l0x = (- 4.5) * w1x * w2x * w3x;
2715 l1x = ( 13.5) * x * w2x * w3x;
2716 l2x = (-13.5) * x * w1x * w3x;
2717 l3x = ( 4.5) * x * w1x * w2x;
2719 l0y = (- 4.5) * w1y * w2y * w3y;
2720 l1y = ( 13.5) * y * w2y * w3y;
2721 l2y = (-13.5) * y * w1y * w3y;
2722 l3y = ( 4.5) * y * w1y * w2y;
2724 shape(0) = l0x * l0y;
2725 shape(1) = l3x * l0y;
2726 shape(2) = l3x * l3y;
2727 shape(3) = l0x * l3y;
2728 shape(4) = l1x * l0y;
2729 shape(5) = l2x * l0y;
2730 shape(6) = l3x * l1y;
2731 shape(7) = l3x * l2y;
2732 shape(8) = l2x * l3y;
2733 shape(9) = l1x * l3y;
2734 shape(10) = l0x * l2y;
2735 shape(11) = l0x * l1y;
2736 shape(12) = l1x * l1y;
2737 shape(13) = l2x * l1y;
2738 shape(14) = l1x * l2y;
2739 shape(15) = l2x * l2y;
2745 double x = ip.
x, y = ip.
y;
2747 double w1x, w2x, w3x, w1y, w2y, w3y;
2748 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2749 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2751 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2752 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2754 l0x = (- 4.5) * w1x * w2x * w3x;
2755 l1x = ( 13.5) * x * w2x * w3x;
2756 l2x = (-13.5) * x * w1x * w3x;
2757 l3x = ( 4.5) * x * w1x * w2x;
2759 l0y = (- 4.5) * w1y * w2y * w3y;
2760 l1y = ( 13.5) * y * w2y * w3y;
2761 l2y = (-13.5) * y * w1y * w3y;
2762 l3y = ( 4.5) * y * w1y * w2y;
2764 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2765 d1x = 9. + (-45. + 40.5 * x) * x;
2766 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2767 d3x = 1. + (- 9. + 13.5 * x) * x;
2769 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2770 d1y = 9. + (-45. + 40.5 * y) * y;
2771 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2772 d3y = 1. + (- 9. + 13.5 * y) * y;
2774 dshape( 0,0) = d0x * l0y; dshape( 0,1) = l0x * d0y;
2775 dshape( 1,0) = d3x * l0y; dshape( 1,1) = l3x * d0y;
2776 dshape( 2,0) = d3x * l3y; dshape( 2,1) = l3x * d3y;
2777 dshape( 3,0) = d0x * l3y; dshape( 3,1) = l0x * d3y;
2778 dshape( 4,0) = d1x * l0y; dshape( 4,1) = l1x * d0y;
2779 dshape( 5,0) = d2x * l0y; dshape( 5,1) = l2x * d0y;
2780 dshape( 6,0) = d3x * l1y; dshape( 6,1) = l3x * d1y;
2781 dshape( 7,0) = d3x * l2y; dshape( 7,1) = l3x * d2y;
2782 dshape( 8,0) = d2x * l3y; dshape( 8,1) = l2x * d3y;
2783 dshape( 9,0) = d1x * l3y; dshape( 9,1) = l1x * d3y;
2784 dshape(10,0) = d0x * l2y; dshape(10,1) = l0x * d2y;
2785 dshape(11,0) = d0x * l1y; dshape(11,1) = l0x * d1y;
2786 dshape(12,0) = d1x * l1y; dshape(12,1) = l1x * d1y;
2787 dshape(13,0) = d2x * l1y; dshape(13,1) = l2x * d1y;
2788 dshape(14,0) = d1x * l2y; dshape(14,1) = l1x * d2y;
2789 dshape(15,0) = d2x * l2y; dshape(15,1) = l2x * d2y;
2795 double x = ip.
x, y = ip.
y;
2797 double w1x, w2x, w3x, w1y, w2y, w3y;
2798 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2799 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2800 double h0x, h1x, h2x, h3x, h0y, h1y, h2y, h3y;
2802 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2803 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2805 l0x = (- 4.5) * w1x * w2x * w3x;
2806 l1x = ( 13.5) * x * w2x * w3x;
2807 l2x = (-13.5) * x * w1x * w3x;
2808 l3x = ( 4.5) * x * w1x * w2x;
2810 l0y = (- 4.5) * w1y * w2y * w3y;
2811 l1y = ( 13.5) * y * w2y * w3y;
2812 l2y = (-13.5) * y * w1y * w3y;
2813 l3y = ( 4.5) * y * w1y * w2y;
2815 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2816 d1x = 9. + (-45. + 40.5 * x) * x;
2817 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2818 d3x = 1. + (- 9. + 13.5 * x) * x;
2820 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2821 d1y = 9. + (-45. + 40.5 * y) * y;
2822 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2823 d3y = 1. + (- 9. + 13.5 * y) * y;
2825 h0x = -27. * x + 18.;
2826 h1x = 81. * x - 45.;
2827 h2x = -81. * x + 36.;
2830 h0y = -27. * y + 18.;
2831 h1y = 81. * y - 45.;
2832 h2y = -81. * y + 36.;
2835 h( 0,0) = h0x * l0y; h( 0,1) = d0x * d0y; h( 0,2) = l0x * h0y;
2836 h( 1,0) = h3x * l0y; h( 1,1) = d3x * d0y; h( 1,2) = l3x * h0y;
2837 h( 2,0) = h3x * l3y; h( 2,1) = d3x * d3y; h( 2,2) = l3x * h3y;
2838 h( 3,0) = h0x * l3y; h( 3,1) = d0x * d3y; h( 3,2) = l0x * h3y;
2839 h( 4,0) = h1x * l0y; h( 4,1) = d1x * d0y; h( 4,2) = l1x * h0y;
2840 h( 5,0) = h2x * l0y; h( 5,1) = d2x * d0y; h( 5,2) = l2x * h0y;
2841 h( 6,0) = h3x * l1y; h( 6,1) = d3x * d1y; h( 6,2) = l3x * h1y;
2842 h( 7,0) = h3x * l2y; h( 7,1) = d3x * d2y; h( 7,2) = l3x * h2y;
2843 h( 8,0) = h2x * l3y; h( 8,1) = d2x * d3y; h( 8,2) = l2x * h3y;
2844 h( 9,0) = h1x * l3y; h( 9,1) = d1x * d3y; h( 9,2) = l1x * h3y;
2845 h(10,0) = h0x * l2y; h(10,1) = d0x * d2y; h(10,2) = l0x * h2y;
2846 h(11,0) = h0x * l1y; h(11,1) = d0x * d1y; h(11,2) = l0x * h1y;
2847 h(12,0) = h1x * l1y; h(12,1) = d1x * d1y; h(12,2) = l1x * h1y;
2848 h(13,0) = h2x * l1y; h(13,1) = d2x * d1y; h(13,2) = l2x * h1y;
2849 h(14,0) = h1x * l2y; h(14,1) = d1x * d2y; h(14,2) = l1x * h2y;
2850 h(15,0) = h2x * l2y; h(15,1) = d2x * d2y; h(15,2) = l2x * h2y;
2869 l3 = (0.33333333333333333333-x),
2870 l4 = (0.66666666666666666667-x);
2872 shape(0) = 4.5 * l2 * l3 * l4;
2873 shape(1) = 4.5 * l1 * l3 * l4;
2874 shape(2) = 13.5 * l1 * l2 * l4;
2875 shape(3) = -13.5 * l1 * l2 * l3;
2883 dshape(0,0) = -5.5 + x * (18. - 13.5 * x);
2884 dshape(1,0) = 1. - x * (9. - 13.5 * x);
2885 dshape(2,0) = 9. - x * (45. - 40.5 * x);
2886 dshape(3,0) = -4.5 + x * (36. - 40.5 * x);
2918 double x = ip.
x, y = ip.
y;
2919 double l1 = (-1. + x + y),
2923 shape(0) = -0.5*l1*(3.*l1 + 1.)*(3.*l1 + 2.);
2924 shape(1) = 0.5*x*(lx - 1.)*lx;
2925 shape(2) = 0.5*y*(-1. + ly)*ly;
2926 shape(3) = 4.5*x*l1*(3.*l1 + 1.);
2927 shape(4) = -4.5*x*lx*l1;
2928 shape(5) = 4.5*x*lx*y;
2929 shape(6) = 4.5*x*y*ly;
2930 shape(7) = -4.5*y*l1*ly;
2931 shape(8) = 4.5*y*l1*(1. + 3.*l1);
2932 shape(9) = -27.*x*y*l1;
2938 double x = ip.
x, y = ip.
y;
2940 dshape(0,0) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2941 dshape(1,0) = 1. + 4.5*x*(-2. + 3.*x);
2943 dshape(3,0) = 4.5*(2. + 9.*x*x - 5.*y + 3.*y*y + 2.*x*(-5. + 6.*y));
2944 dshape(4,0) = -4.5*(1. - 1.*y + x*(-8. + 9.*x + 6.*y));
2945 dshape(5,0) = 4.5*(-1. + 6.*x)*y;
2946 dshape(6,0) = 4.5*y*(-1. + 3.*y);
2947 dshape(7,0) = 4.5*(1. - 3.*y)*y;
2948 dshape(8,0) = 4.5*y*(-5. + 6.*x + 6.*y);
2949 dshape(9,0) = -27.*y*(-1. + 2.*x + y);
2951 dshape(0,1) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2953 dshape(2,1) = 1. + 4.5*y*(-2. + 3.*y);
2954 dshape(3,1) = 4.5*x*(-5. + 6.*x + 6.*y);
2955 dshape(4,1) = 4.5*(1. - 3.*x)*x;
2956 dshape(5,1) = 4.5*x*(-1. + 3.*x);
2957 dshape(6,1) = 4.5*x*(-1. + 6.*y);
2958 dshape(7,1) = -4.5*(1. + x*(-1. + 6.*y) + y*(-8. + 9.*y));
2959 dshape(8,1) = 4.5*(2. + 3.*x*x + y*(-10. + 9.*y) + x*(-5. + 12.*y));
2960 dshape(9,1) = -27.*x*(-1. + x + 2.*y);
2966 double x = ip.
x, y = ip.
y;
2968 h(0,0) = 18.-27.*(x+y);
2969 h(0,1) = 18.-27.*(x+y);
2970 h(0,2) = 18.-27.*(x+y);
2980 h(3,0) = -45.+81.*x+54.*y;
2981 h(3,1) = -22.5+54.*x+27.*y;
2984 h(4,0) = 36.-81.*x-27.*y;
2989 h(5,1) = -4.5+27.*x;
2993 h(6,1) = -4.5+27.*y;
2998 h(7,2) = 36.-27.*x-81.*y;
3001 h(8,1) = -22.5+27.*x+54.*y;
3002 h(8,2) = -45.+54.*x+81.*y;
3005 h(9,1) = 27.-54.*(x+y);
3078 double x = ip.
x, y = ip.
y, z = ip.
z;
3080 shape(0) = -((-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z)*
3081 (-1 + 3*x + 3*y + 3*z))/2.;
3082 shape(4) = (9*x*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
3083 shape(5) = (-9*x*(-1 + 3*x)*(-1 + x + y + z))/2.;
3084 shape(1) = (x*(2 + 9*(-1 + x)*x))/2.;
3085 shape(6) = (9*y*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
3086 shape(19) = -27*x*y*(-1 + x + y + z);
3087 shape(10) = (9*x*(-1 + 3*x)*y)/2.;
3088 shape(7) = (-9*y*(-1 + 3*y)*(-1 + x + y + z))/2.;
3089 shape(11) = (9*x*y*(-1 + 3*y))/2.;
3090 shape(2) = (y*(2 + 9*(-1 + y)*y))/2.;
3091 shape(8) = (9*z*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
3092 shape(18) = -27*x*z*(-1 + x + y + z);
3093 shape(12) = (9*x*(-1 + 3*x)*z)/2.;
3094 shape(17) = -27*y*z*(-1 + x + y + z);
3095 shape(16) = 27*x*y*z;
3096 shape(14) = (9*y*(-1 + 3*y)*z)/2.;
3097 shape(9) = (-9*z*(-1 + x + y + z)*(-1 + 3*z))/2.;
3098 shape(13) = (9*x*z*(-1 + 3*z))/2.;
3099 shape(15) = (9*y*z*(-1 + 3*z))/2.;
3100 shape(3) = (z*(2 + 9*(-1 + z)*z))/2.;
3106 double x = ip.
x, y = ip.
y, z = ip.
z;
3108 dshape(0,0) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
3109 x*(-4 + 6*y + 6*z)))/2.;
3110 dshape(0,1) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
3111 x*(-4 + 6*y + 6*z)))/2.;
3112 dshape(0,2) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
3113 x*(-4 + 6*y + 6*z)))/2.;
3114 dshape(4,0) = (9*(9*pow(x,2) + (-1 + y + z)*(-2 + 3*y + 3*z) +
3115 2*x*(-5 + 6*y + 6*z)))/2.;
3116 dshape(4,1) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
3117 dshape(4,2) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
3118 dshape(5,0) = (-9*(1 - y - z + x*(-8 + 9*x + 6*y + 6*z)))/2.;
3119 dshape(5,1) = (9*(1 - 3*x)*x)/2.;
3120 dshape(5,2) = (9*(1 - 3*x)*x)/2.;
3121 dshape(1,0) = 1 + (9*x*(-2 + 3*x))/2.;
3124 dshape(6,0) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
3125 dshape(6,1) = (9*(2 + 3*pow(x,2) - 10*y - 5*z + 3*(y + z)*(3*y + z) +
3126 x*(-5 + 12*y + 6*z)))/2.;
3127 dshape(6,2) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
3128 dshape(19,0) = -27*y*(-1 + 2*x + y + z);
3129 dshape(19,1) = -27*x*(-1 + x + 2*y + z);
3130 dshape(19,2) = -27*x*y;
3131 dshape(10,0) = (9*(-1 + 6*x)*y)/2.;
3132 dshape(10,1) = (9*x*(-1 + 3*x))/2.;
3134 dshape(7,0) = (9*(1 - 3*y)*y)/2.;
3135 dshape(7,1) = (-9*(1 + x*(-1 + 6*y) - z + y*(-8 + 9*y + 6*z)))/2.;
3136 dshape(7,2) = (9*(1 - 3*y)*y)/2.;
3137 dshape(11,0) = (9*y*(-1 + 3*y))/2.;
3138 dshape(11,1) = (9*x*(-1 + 6*y))/2.;
3141 dshape(2,1) = 1 + (9*y*(-2 + 3*y))/2.;
3143 dshape(8,0) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
3144 dshape(8,1) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
3145 dshape(8,2) = (9*(2 + 3*pow(x,2) - 5*y - 10*z + 3*(y + z)*(y + 3*z) +
3146 x*(-5 + 6*y + 12*z)))/2.;
3147 dshape(18,0) = -27*z*(-1 + 2*x + y + z);
3148 dshape(18,1) = -27*x*z;
3149 dshape(18,2) = -27*x*(-1 + x + y + 2*z);
3150 dshape(12,0) = (9*(-1 + 6*x)*z)/2.;
3152 dshape(12,2) = (9*x*(-1 + 3*x))/2.;
3153 dshape(17,0) = -27*y*z;
3154 dshape(17,1) = -27*z*(-1 + x + 2*y + z);
3155 dshape(17,2) = -27*y*(-1 + x + y + 2*z);
3156 dshape(16,0) = 27*y*z;
3157 dshape(16,1) = 27*x*z;
3158 dshape(16,2) = 27*x*y;
3160 dshape(14,1) = (9*(-1 + 6*y)*z)/2.;
3161 dshape(14,2) = (9*y*(-1 + 3*y))/2.;
3162 dshape(9,0) = (9*(1 - 3*z)*z)/2.;
3163 dshape(9,1) = (9*(1 - 3*z)*z)/2.;
3164 dshape(9,2) = (9*(-1 + x + y + 8*z - 6*(x + y)*z - 9*pow(z,2)))/2.;
3165 dshape(13,0) = (9*z*(-1 + 3*z))/2.;
3167 dshape(13,2) = (9*x*(-1 + 6*z))/2.;
3169 dshape(15,1) = (9*z*(-1 + 3*z))/2.;
3170 dshape(15,2) = (9*y*(-1 + 6*z))/2.;
3173 dshape(3,2) = 1 + (9*z*(-2 + 3*z))/2.;
3239 shape(0) = 1. - ip.
x - ip.
y - ip.
z;
3248 if (dshape.
Height() == 4)
3250 double *A = &dshape(0,0);
3251 A[0] = -1.; A[4] = -1.; A[8] = -1.;
3252 A[1] = 1.; A[5] = 0.; A[9] = 0.;
3253 A[2] = 0.; A[6] = 1.; A[10] = 0.;
3254 A[3] = 0.; A[7] = 0.; A[11] = 1.;
3258 dshape(0,0) = -1.; dshape(0,1) = -1.; dshape(0,2) = -1.;
3259 dshape(1,0) = 1.; dshape(1,1) = 0.; dshape(1,2) = 0.;
3260 dshape(2,0) = 0.; dshape(2,1) = 1.; dshape(2,2) = 0.;
3261 dshape(3,0) = 0.; dshape(3,1) = 0.; dshape(3,2) = 1.;
3268 static int face_dofs[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
3271 *dofs = face_dofs[face];
3313 double L0, L1, L2, L3;
3315 L0 = 1. - ip.
x - ip.
y - ip.
z;
3320 shape(0) = L0 * ( 2.0 * L0 - 1.0 );
3321 shape(1) = L1 * ( 2.0 * L1 - 1.0 );
3322 shape(2) = L2 * ( 2.0 * L2 - 1.0 );
3323 shape(3) = L3 * ( 2.0 * L3 - 1.0 );
3324 shape(4) = 4.0 * L0 * L1;
3325 shape(5) = 4.0 * L0 * L2;
3326 shape(6) = 4.0 * L0 * L3;
3327 shape(7) = 4.0 * L1 * L2;
3328 shape(8) = 4.0 * L1 * L3;
3329 shape(9) = 4.0 * L2 * L3;
3340 L0 = 1.0 - x - y - z;
3342 dshape(0,0) = dshape(0,1) = dshape(0,2) = 1.0 - 4.0 * L0;
3343 dshape(1,0) = -1.0 + 4.0 * x; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
3344 dshape(2,0) = 0.0; dshape(2,1) = -1.0 + 4.0 * y; dshape(2,2) = 0.0;
3345 dshape(3,0) = dshape(3,1) = 0.0; dshape(3,2) = -1.0 + 4.0 * z;
3346 dshape(4,0) = 4.0 * (L0 - x); dshape(4,1) = dshape(4,2) = -4.0 * x;
3347 dshape(5,0) = dshape(5,2) = -4.0 * y; dshape(5,1) = 4.0 * (L0 - y);
3348 dshape(6,0) = dshape(6,1) = -4.0 * z; dshape(6,2) = 4.0 * (L0 - z);
3349 dshape(7,0) = 4.0 * y; dshape(7,1) = 4.0 * x; dshape(7,2) = 0.0;
3350 dshape(8,0) = 4.0 * z; dshape(8,1) = 0.0; dshape(8,2) = 4.0 * x;
3351 dshape(9,0) = 0.0; dshape(9,1) = 4.0 * z; dshape(9,2) = 4.0 * y;
3393 double x = ip.
x, y = ip.
y, z = ip.
z;
3394 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3396 shape(0) = ox * oy * oz;
3397 shape(1) = x * oy * oz;
3398 shape(2) = x * y * oz;
3399 shape(3) = ox * y * oz;
3400 shape(4) = ox * oy * z;
3401 shape(5) = x * oy * z;
3402 shape(6) = x * y * z;
3403 shape(7) = ox * y * z;
3409 double x = ip.
x, y = ip.
y, z = ip.
z;
3410 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3412 dshape(0,0) = - oy * oz;
3413 dshape(0,1) = - ox * oz;
3414 dshape(0,2) = - ox * oy;
3416 dshape(1,0) = oy * oz;
3417 dshape(1,1) = - x * oz;
3418 dshape(1,2) = - x * oy;
3420 dshape(2,0) = y * oz;
3421 dshape(2,1) = x * oz;
3422 dshape(2,2) = - x * y;
3424 dshape(3,0) = - y * oz;
3425 dshape(3,1) = ox * oz;
3426 dshape(3,2) = - ox * y;
3428 dshape(4,0) = - oy * z;
3429 dshape(4,1) = - ox * z;
3430 dshape(4,2) = ox * oy;
3432 dshape(5,0) = oy * z;
3433 dshape(5,1) = - x * z;
3434 dshape(5,2) = x * oy;
3436 dshape(6,0) = y * z;
3437 dshape(6,1) = x * z;
3438 dshape(6,2) = x * y;
3440 dshape(7,0) = - y * z;
3441 dshape(7,1) = ox * z;
3442 dshape(7,2) = ox * y;
3478 shape(0) = 1.0 - 2.0 * ip.
y;
3479 shape(1) = -1.0 + 2.0 * ( ip.
x + ip.
y );
3480 shape(2) = 1.0 - 2.0 * ip.
x;
3486 dshape(0,0) = 0.0; dshape(0,1) = -2.0;
3487 dshape(1,0) = 2.0; dshape(1,1) = 2.0;
3488 dshape(2,0) = -2.0; dshape(2,1) = 0.0;
3509 const double l1 = ip.
x+ip.
y-0.5, l2 = 1.-l1, l3 = ip.
x-ip.
y+0.5, l4 = 1.-l3;
3520 const double x2 = 2.*ip.
x, y2 = 2.*ip.
y;
3522 dshape(0,0) = 1. - x2; dshape(0,1) = -2. + y2;
3523 dshape(1,0) = x2; dshape(1,1) = 1. - y2;
3524 dshape(2,0) = 1. - x2; dshape(2,1) = y2;
3525 dshape(3,0) = -2. + x2; dshape(3,1) = 1. - y2;
3543 double x = ip.
x, y = ip.
y;
3546 shape(0,1) = y - 1.;
3549 shape(2,0) = x - 1.;
3561 const double RT0TriangleFiniteElement::nk[3][2] =
3562 { {0, -1}, {1, 1}, {-1, 0} };
3568 #ifdef MFEM_THREAD_SAFE
3574 for (k = 0; k < 3; k++)
3577 for (j = 0; j < 3; j++)
3580 if (j == k) { d -= 1.0; }
3581 if (fabs(d) > 1.0e-12)
3583 mfem::err <<
"RT0TriangleFiniteElement::GetLocalInterpolation (...)\n"
3584 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3600 for (k = 0; k < 3; k++)
3603 ip.
x = vk[0]; ip.
y = vk[1];
3606 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3607 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3608 for (j = 0; j < 3; j++)
3609 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3622 #ifdef MFEM_THREAD_SAFE
3626 for (
int k = 0; k < 3; k++)
3634 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3635 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3655 double x = ip.
x, y = ip.
y;
3658 shape(0,1) = y - 1.;
3663 shape(3,0) = x - 1.;
3676 const double RT0QuadFiniteElement::nk[4][2] =
3677 { {0, -1}, {1, 0}, {0, 1}, {-1, 0} };
3683 #ifdef MFEM_THREAD_SAFE
3689 for (k = 0; k < 4; k++)
3692 for (j = 0; j < 4; j++)
3695 if (j == k) { d -= 1.0; }
3696 if (fabs(d) > 1.0e-12)
3698 mfem::err <<
"RT0QuadFiniteElement::GetLocalInterpolation (...)\n"
3699 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3715 for (k = 0; k < 4; k++)
3718 ip.
x = vk[0]; ip.
y = vk[1];
3721 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3722 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3723 for (j = 0; j < 4; j++)
3724 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3737 #ifdef MFEM_THREAD_SAFE
3741 for (
int k = 0; k < 4; k++)
3749 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3750 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3778 double x = ip.
x, y = ip.
y;
3780 shape(0,0) = -2 * x * (-1 + x + 2 * y);
3781 shape(0,1) = -2 * (-1 + y) * (-1 + x + 2 * y);
3782 shape(1,0) = 2 * x * (x - y);
3783 shape(1,1) = 2 * (x - y) * (-1 + y);
3784 shape(2,0) = 2 * x * (-1 + 2 * x + y);
3785 shape(2,1) = 2 * y * (-1 + 2 * x + y);
3786 shape(3,0) = 2 * x * (-1 + x + 2 * y);
3787 shape(3,1) = 2 * y * (-1 + x + 2 * y);
3788 shape(4,0) = -2 * (-1 + x) * (x - y);
3789 shape(4,1) = 2 * y * (-x + y);
3790 shape(5,0) = -2 * (-1 + x) * (-1 + 2 * x + y);
3791 shape(5,1) = -2 * y * (-1 + 2 * x + y);
3792 shape(6,0) = -3 * x * (-2 + 2 * x + y);
3793 shape(6,1) = -3 * y * (-1 + 2 * x + y);
3794 shape(7,0) = -3 * x * (-1 + x + 2 * y);
3795 shape(7,1) = -3 * y * (-2 + x + 2 * y);
3801 double x = ip.
x, y = ip.
y;
3803 divshape(0) = -2 * (-4 + 3 * x + 6 * y);
3804 divshape(1) = 2 + 6 * x - 6 * y;
3805 divshape(2) = -4 + 12 * x + 6 * y;
3806 divshape(3) = -4 + 6 * x + 12 * y;
3807 divshape(4) = 2 - 6 * x + 6 * y;
3808 divshape(5) = -2 * (-4 + 6 * x + 3 * y);
3809 divshape(6) = -9 * (-1 + 2 * x + y);
3810 divshape(7) = -9 * (-1 + x + 2 * y);
3813 const double RT1TriangleFiniteElement::nk[8][2] =
3825 #ifdef MFEM_THREAD_SAFE
3831 for (k = 0; k < 8; k++)
3834 for (j = 0; j < 8; j++)
3837 if (j == k) { d -= 1.0; }
3838 if (fabs(d) > 1.0e-12)
3840 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3841 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3857 for (k = 0; k < 8; k++)
3860 ip.
x = vk[0]; ip.
y = vk[1];
3863 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3864 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3865 for (j = 0; j < 8; j++)
3866 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3878 #ifdef MFEM_THREAD_SAFE
3882 for (
int k = 0; k < 8; k++)
3890 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3891 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3934 double x = ip.
x, y = ip.
y;
3938 shape(0,1) = -( 1. - 3.*y + 2.*y*y)*( 2. - 3.*x);
3940 shape(1,1) = -( 1. - 3.*y + 2.*y*y)*(-1. + 3.*x);
3942 shape(2,0) = (-x + 2.*x*x)*( 2. - 3.*y);
3944 shape(3,0) = (-x + 2.*x*x)*(-1. + 3.*y);
3948 shape(4,1) = (-y + 2.*y*y)*(-1. + 3.*x);
3950 shape(5,1) = (-y + 2.*y*y)*( 2. - 3.*x);
3952 shape(6,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y);
3954 shape(7,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y);
3957 shape(8,0) = (4.*x - 4.*x*x)*( 2. - 3.*y);
3959 shape(9,0) = (4.*x - 4.*x*x)*(-1. + 3.*y);
3963 shape(10,1) = (4.*y - 4.*y*y)*( 2. - 3.*x);
3965 shape(11,1) = (4.*y - 4.*y*y)*(-1. + 3.*x);
3971 double x = ip.
x, y = ip.
y;
3973 divshape(0) = -(-3. + 4.*y)*( 2. - 3.*x);
3974 divshape(1) = -(-3. + 4.*y)*(-1. + 3.*x);
3975 divshape(2) = (-1. + 4.*x)*( 2. - 3.*y);
3976 divshape(3) = (-1. + 4.*x)*(-1. + 3.*y);
3977 divshape(4) = (-1. + 4.*y)*(-1. + 3.*x);
3978 divshape(5) = (-1. + 4.*y)*( 2. - 3.*x);
3979 divshape(6) = -(-3. + 4.*x)*(-1. + 3.*y);
3980 divshape(7) = -(-3. + 4.*x)*( 2. - 3.*y);
3981 divshape(8) = ( 4. - 8.*x)*( 2. - 3.*y);
3982 divshape(9) = ( 4. - 8.*x)*(-1. + 3.*y);
3983 divshape(10) = ( 4. - 8.*y)*( 2. - 3.*x);
3984 divshape(11) = ( 4. - 8.*y)*(-1. + 3.*x);
3987 const double RT1QuadFiniteElement::nk[12][2] =
4007 #ifdef MFEM_THREAD_SAFE
4013 for (k = 0; k < 12; k++)
4016 for (j = 0; j < 12; j++)
4019 if (j == k) { d -= 1.0; }
4020 if (fabs(d) > 1.0e-12)
4022 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
4023 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
4039 for (k = 0; k < 12; k++)
4042 ip.
x = vk[0]; ip.
y = vk[1];
4045 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
4046 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
4047 for (j = 0; j < 12; j++)
4048 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
4060 #ifdef MFEM_THREAD_SAFE
4064 for (
int k = 0; k < 12; k++)
4072 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
4073 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
4077 const double RT2TriangleFiniteElement::M[15][15] =
4080 0, -5.3237900077244501311, 5.3237900077244501311, 16.647580015448900262,
4081 0, 24.442740046346700787, -16.647580015448900262, -12.,
4082 -19.118950038622250656, -47.237900077244501311, 0, -34.414110069520051180,
4083 12., 30.590320061795601049, 15.295160030897800524
4086 0, 1.5, -1.5, -15., 0, 2.625, 15., 15., -4.125, 30., 0, -14.625, -15.,
4090 0, -0.67620999227554986889, 0.67620999227554986889, 7.3524199845510997378,
4091 0, -3.4427400463467007866, -7.3524199845510997378, -12.,
4092 4.1189500386222506555, -0.76209992275549868892, 0, 7.4141100695200511800,
4093 12., -6.5903200617956010489, -3.2951600308978005244
4096 0, 0, 1.5, 0, 0, 1.5, -11.471370023173350393, 0, 2.4713700231733503933,
4097 -11.471370023173350393, 0, 2.4713700231733503933, 15.295160030897800524,
4098 0, -3.2951600308978005244
4101 0, 0, 4.875, 0, 0, 4.875, -16.875, 0, -16.875, -16.875, 0, -16.875, 10.5,
4105 0, 0, 1.5, 0, 0, 1.5, 2.4713700231733503933, 0, -11.471370023173350393,
4106 2.4713700231733503933, 0, -11.471370023173350393, -3.2951600308978005244,
4107 0, 15.295160030897800524
4110 -0.67620999227554986889, 0, -3.4427400463467007866, 0,
4111 7.3524199845510997378, 0.67620999227554986889, 7.4141100695200511800, 0,
4112 -0.76209992275549868892, 4.1189500386222506555, -12.,
4113 -7.3524199845510997378, -3.2951600308978005244, -6.5903200617956010489,
4117 1.5, 0, 2.625, 0, -15., -1.5, -14.625, 0, 30., -4.125, 15., 15., 10.5,
4121 -5.3237900077244501311, 0, 24.442740046346700787, 0, 16.647580015448900262,
4122 5.3237900077244501311, -34.414110069520051180, 0, -47.237900077244501311,
4123 -19.118950038622250656, -12., -16.647580015448900262, 15.295160030897800524,
4124 30.590320061795601049, 12.
4126 { 0, 0, 18., 0, 0, 6., -42., 0, -30., -26., 0, -14., 24., 32., 8.},
4127 { 0, 0, 6., 0, 0, 18., -14., 0, -26., -30., 0, -42., 8., 32., 24.},
4128 { 0, 0, -6., 0, 0, -4., 30., 0, 4., 22., 0, 4., -24., -16., 0},
4129 { 0, 0, -4., 0, 0, -8., 20., 0, 8., 36., 0, 8., -16., -32., 0},
4130 { 0, 0, -8., 0, 0, -4., 8., 0, 36., 8., 0, 20., 0, -32., -16.},
4131 { 0, 0, -4., 0, 0, -6., 4., 0, 22., 4., 0, 30., 0, -16., -24.}
4137 const double p = 0.11270166537925831148;
4174 double x = ip.
x, y = ip.
y;
4176 double Bx[15] = {1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y, 0., x*x*x,
4179 double By[15] = {0., 1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y,
4183 for (
int i = 0; i < 15; i++)
4185 double cx = 0.0, cy = 0.0;
4186 for (
int j = 0; j < 15; j++)
4188 cx += M[i][j] * Bx[j];
4189 cy += M[i][j] * By[j];
4199 double x = ip.
x, y = ip.
y;
4201 double DivB[15] = {0., 0., 1., 0., 0., 1., 2.*x, 0., y, x, 0., 2.*y,
4202 4.*x*x, 4.*x*y, 4.*y*y
4205 for (
int i = 0; i < 15; i++)
4208 for (
int j = 0; j < 15; j++)
4210 div += M[i][j] * DivB[j];
4216 const double RT2QuadFiniteElement::pt[4] = {0.,1./3.,2./3.,1.};
4218 const double RT2QuadFiniteElement::dpt[3] = {0.25,0.5,0.75};
4260 double x = ip.
x, y = ip.
y;
4262 double ax0 = pt[0] - x;
4263 double ax1 = pt[1] - x;
4264 double ax2 = pt[2] - x;
4265 double ax3 = pt[3] - x;
4267 double by0 = dpt[0] - y;
4268 double by1 = dpt[1] - y;
4269 double by2 = dpt[2] - y;
4271 double ay0 = pt[0] - y;
4272 double ay1 = pt[1] - y;
4273 double ay2 = pt[2] - y;
4274 double ay3 = pt[3] - y;
4276 double bx0 = dpt[0] - x;
4277 double bx1 = dpt[1] - x;
4278 double bx2 = dpt[2] - x;
4280 double A01 = pt[0] - pt[1];
4281 double A02 = pt[0] - pt[2];
4282 double A12 = pt[1] - pt[2];
4283 double A03 = pt[0] - pt[3];
4284 double A13 = pt[1] - pt[3];
4285 double A23 = pt[2] - pt[3];
4287 double B01 = dpt[0] - dpt[1];
4288 double B02 = dpt[0] - dpt[2];
4289 double B12 = dpt[1] - dpt[2];
4291 double tx0 = (bx1*bx2)/(B01*B02);
4292 double tx1 = -(bx0*bx2)/(B01*B12);
4293 double tx2 = (bx0*bx1)/(B02*B12);
4295 double ty0 = (by1*by2)/(B01*B02);
4296 double ty1 = -(by0*by2)/(B01*B12);
4297 double ty2 = (by0*by1)/(B02*B12);
4301 shape(0, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx0;
4303 shape(1, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx1;
4305 shape(2, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx2;
4307 shape(3, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty0;
4309 shape(4, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty1;
4311 shape(5, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty2;
4315 shape(6, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx2;
4317 shape(7, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx1;
4319 shape(8, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx0;
4321 shape(9, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty2;
4323 shape(10, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty1;
4325 shape(11, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty0;
4328 shape(12, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty0;
4330 shape(13, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty1;
4332 shape(14, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty2;
4335 shape(15, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty0;
4337 shape(16, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty1;
4339 shape(17, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty2;
4343 shape(18, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx0;
4345 shape(19, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx1;
4347 shape(20, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx2;
4350 shape(21, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx0;
4352 shape(22, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx1;
4354 shape(23, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx2;
4360 double x = ip.
x, y = ip.
y;
4362 double a01 = pt[0]*pt[1];
4363 double a02 = pt[0]*pt[2];
4364 double a12 = pt[1]*pt[2];
4365 double a03 = pt[0]*pt[3];
4366 double a13 = pt[1]*pt[3];
4367 double a23 = pt[2]*pt[3];
4369 double bx0 = dpt[0] - x;
4370 double bx1 = dpt[1] - x;
4371 double bx2 = dpt[2] - x;
4373 double by0 = dpt[0] - y;
4374 double by1 = dpt[1] - y;
4375 double by2 = dpt[2] - y;
4377 double A01 = pt[0] - pt[1];
4378 double A02 = pt[0] - pt[2];
4379 double A12 = pt[1] - pt[2];
4380 double A03 = pt[0] - pt[3];
4381 double A13 = pt[1] - pt[3];
4382 double A23 = pt[2] - pt[3];
4384 double A012 = pt[0] + pt[1] + pt[2];
4385 double A013 = pt[0] + pt[1] + pt[3];
4386 double A023 = pt[0] + pt[2] + pt[3];
4387 double A123 = pt[1] + pt[2] + pt[3];
4389 double B01 = dpt[0] - dpt[1];
4390 double B02 = dpt[0] - dpt[2];
4391 double B12 = dpt[1] - dpt[2];
4393 double tx0 = (bx1*bx2)/(B01*B02);
4394 double tx1 = -(bx0*bx2)/(B01*B12);
4395 double tx2 = (bx0*bx1)/(B02*B12);
4397 double ty0 = (by1*by2)/(B01*B02);
4398 double ty1 = -(by0*by2)/(B01*B12);
4399 double ty2 = (by0*by1)/(B02*B12);
4402 divshape(0) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx0;
4403 divshape(1) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx1;
4404 divshape(2) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx2;
4406 divshape(3) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty0;
4407 divshape(4) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty1;
4408 divshape(5) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty2;
4410 divshape(6) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx2;
4411 divshape(7) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx1;
4412 divshape(8) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx0;
4414 divshape(9) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty2;
4415 divshape(10) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty1;
4416 divshape(11) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty0;
4418 divshape(12) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty0;
4419 divshape(13) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty1;
4420 divshape(14) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty2;
4422 divshape(15) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty0;
4423 divshape(16) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty1;
4424 divshape(17) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty2;
4426 divshape(18) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx0;
4427 divshape(19) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx1;
4428 divshape(20) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx2;
4430 divshape(21) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx0;
4431 divshape(22) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx1;
4432 divshape(23) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx2;
4435 const double RT2QuadFiniteElement::nk[24][2] =
4438 {0,-1}, {0,-1}, {0,-1},
4440 {1, 0}, {1, 0}, {1, 0},
4442 {0, 1}, {0, 1}, {0, 1},
4444 {-1,0}, {-1,0}, {-1,0},
4446 {1, 0}, {1, 0}, {1, 0},
4448 {1, 0}, {1, 0}, {1, 0},
4450 {0, 1}, {0, 1}, {0, 1},
4452 {0, 1}, {0, 1}, {0, 1}
4459 #ifdef MFEM_THREAD_SAFE
4465 for (k = 0; k < 24; k++)
4468 for (j = 0; j < 24; j++)
4471 if (j == k) { d -= 1.0; }
4472 if (fabs(d) > 1.0e-12)
4474 mfem::err <<
"RT2QuadFiniteElement::GetLocalInterpolation (...)\n"
4475 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
4491 for (k = 0; k < 24; k++)
4494 ip.
x = vk[0]; ip.
y = vk[1];
4497 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
4498 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
4499 for (j = 0; j < 24; j++)
4500 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
4512 #ifdef MFEM_THREAD_SAFE
4516 for (
int k = 0; k < 24; k++)
4524 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
4525 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
4541 shape(0) = 2. - 3. * x;
4542 shape(1) = 3. * x - 1.;
4556 const double p = 0.11270166537925831148;
4566 const double p = 0.11270166537925831148;
4567 const double w = 1./((1-2*
p)*(1-2*p));
4570 shape(0) = (2*x-1)*(x-1+p)*w;
4571 shape(1) = 4*(x-1+
p)*(p-x)*w;
4572 shape(2) = (2*x-1)*(x-p)*w;
4578 const double p = 0.11270166537925831148;
4579 const double w = 1./((1-2*
p)*(1-2*p));
4582 dshape(0,0) = (-3+4*x+2*
p)*w;
4583 dshape(1,0) = (4-8*x)*w;
4584 dshape(2,0) = (-1+4*x-2*
p)*w;
4595 for (i = 1; i < m; i++)
4601 #ifndef MFEM_THREAD_SAFE
4606 for (i = 1; i <= m; i++)
4608 rwk(i) = rwk(i-1) * ( (double)(m) / (double)(i) );
4610 for (i = 0; i < m/2+1; i++)
4612 rwk(m-i) = ( rwk(i) *= rwk(m-i) );
4614 for (i = m-1; i >= 0; i -= 2)
4623 double w, wk, x = ip.
x;
4626 #ifdef MFEM_THREAD_SAFE
4630 k = (int) floor ( m * x + 0.5 );
4631 k = k > m ? m : k < 0 ? 0 : k;
4634 for (i = 0; i <= m; i++)
4637 wk *= ( rxxk(i) = x - (double)(i) / m );
4639 w = wk * ( rxxk(k) = x - (double)(k) / m );
4643 shape(0) = w * rwk(0) / rxxk(0);
4647 shape(0) = wk * rwk(0);
4651 shape(1) = w * rwk(m) / rxxk(m);
4655 shape(1) = wk * rwk(k);
4657 for (i = 1; i < m; i++)
4660 shape(i+1) = w * rwk(i) / rxxk(i);
4664 shape(k+1) = wk * rwk(k);
4671 double s, srx, w, wk, x = ip.
x;
4674 #ifdef MFEM_THREAD_SAFE
4678 k = (int) floor ( m * x + 0.5 );
4679 k = k > m ? m : k < 0 ? 0 : k;
4682 for (i = 0; i <= m; i++)
4685 wk *= ( rxxk(i) = x - (double)(i) / m );
4687 w = wk * ( rxxk(k) = x - (double)(k) / m );
4689 for (i = 0; i <= m; i++)
4691 rxxk(i) = 1.0 / rxxk(i);
4694 for (i = 0; i <= m; i++)
4703 dshape(0,0) = (s - w * rxxk(0)) * rwk(0) * rxxk(0);
4707 dshape(0,0) = wk * srx * rwk(0);
4711 dshape(1,0) = (s - w * rxxk(m)) * rwk(m) * rxxk(m);
4715 dshape(1,0) = wk * srx * rwk(k);
4717 for (i = 1; i < m; i++)
4720 dshape(i+1,0) = (s - w * rxxk(i)) * rwk(i) * rxxk(i);
4724 dshape(k+1,0) = wk * srx * rwk(k);
4753 double L0, L1, L2, L3;
4755 L1 = ip.
x; L2 = ip.
y; L3 = ip.
z; L0 = 1.0 - L1 - L2 - L3;
4756 shape(0) = 1.0 - 3.0 * L0;
4757 shape(1) = 1.0 - 3.0 * L1;
4758 shape(2) = 1.0 - 3.0 * L2;
4759 shape(3) = 1.0 - 3.0 * L3;
4765 dshape(0,0) = 3.0; dshape(0,1) = 3.0; dshape(0,2) = 3.0;
4766 dshape(1,0) = -3.0; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
4767 dshape(2,0) = 0.0; dshape(2,1) = -3.0; dshape(2,2) = 0.0;
4768 dshape(3,0) = 0.0; dshape(3,1) = 0.0; dshape(3,2) = -3.0;
4789 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4810 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4824 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4825 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4826 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4827 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4828 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4829 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4830 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4831 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4833 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4834 I[ 9] = 1; J[ 9] = 2; K[ 9] = 0;
4835 I[10] = 2; J[10] = 1; K[10] = 0;
4836 I[11] = 0; J[11] = 2; K[11] = 0;
4837 I[12] = 2; J[12] = 0; K[12] = 1;
4838 I[13] = 1; J[13] = 2; K[13] = 1;
4839 I[14] = 2; J[14] = 1; K[14] = 1;
4840 I[15] = 0; J[15] = 2; K[15] = 1;
4841 I[16] = 0; J[16] = 0; K[16] = 2;
4842 I[17] = 1; J[17] = 0; K[17] = 2;
4843 I[18] = 1; J[18] = 1; K[18] = 2;
4844 I[19] = 0; J[19] = 1; K[19] = 2;
4846 I[20] = 2; J[20] = 2; K[20] = 0;
4847 I[21] = 2; J[21] = 0; K[21] = 2;
4848 I[22] = 1; J[22] = 2; K[22] = 2;
4849 I[23] = 2; J[23] = 1; K[23] = 2;
4850 I[24] = 0; J[24] = 2; K[24] = 2;
4851 I[25] = 2; J[25] = 2; K[25] = 1;
4853 I[26] = 2; J[26] = 2; K[26] = 2;
4855 else if (degree == 3)
4861 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4862 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4863 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4864 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4865 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4866 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4867 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4868 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4870 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4871 I[ 9] = 3; J[ 9] = 0; K[ 9] = 0;
4872 I[10] = 1; J[10] = 2; K[10] = 0;
4873 I[11] = 1; J[11] = 3; K[11] = 0;
4874 I[12] = 2; J[12] = 1; K[12] = 0;
4875 I[13] = 3; J[13] = 1; K[13] = 0;
4876 I[14] = 0; J[14] = 2; K[14] = 0;
4877 I[15] = 0; J[15] = 3; K[15] = 0;
4878 I[16] = 2; J[16] = 0; K[16] = 1;
4879 I[17] = 3; J[17] = 0; K[17] = 1;
4880 I[18] = 1; J[18] = 2; K[18] = 1;
4881 I[19] = 1; J[19] = 3; K[19] = 1;
4882 I[20] = 2; J[20] = 1; K[20] = 1;
4883 I[21] = 3; J[21] = 1; K[21] = 1;
4884 I[22] = 0; J[22] = 2; K[22] = 1;
4885 I[23] = 0; J[23] = 3; K[23] = 1;
4886 I[24] = 0; J[24] = 0; K[24] = 2;
4887 I[25] = 0; J[25] = 0; K[25] = 3;
4888 I[26] = 1; J[26] = 0; K[26] = 2;
4889 I[27] = 1; J[27] = 0; K[27] = 3;
4890 I[28] = 1; J[28] = 1; K[28] = 2;
4891 I[29] = 1; J[29] = 1; K[29] = 3;
4892 I[30] = 0; J[30] = 1; K[30] = 2;
4893 I[31] = 0; J[31] = 1; K[31] = 3;
4895 I[32] = 2; J[32] = 3; K[32] = 0;
4896 I[33] = 3; J[33] = 3; K[33] = 0;
4897 I[34] = 2; J[34] = 2; K[34] = 0;
4898 I[35] = 3; J[35] = 2; K[35] = 0;
4899 I[36] = 2; J[36] = 0; K[36] = 2;
4900 I[37] = 3; J[37] = 0; K[37] = 2;
4901 I[38] = 2; J[38] = 0; K[38] = 3;
4902 I[39] = 3; J[39] = 0; K[39] = 3;
4903 I[40] = 1; J[40] = 2; K[40] = 2;
4904 I[41] = 1; J[41] = 3; K[41] = 2;
4905 I[42] = 1; J[42] = 2; K[42] = 3;
4906 I[43] = 1; J[43] = 3; K[43] = 3;
4907 I[44] = 3; J[44] = 1; K[44] = 2;
4908 I[45] = 2; J[45] = 1; K[45] = 2;
4909 I[46] = 3; J[46] = 1; K[46] = 3;
4910 I[47] = 2; J[47] = 1; K[47] = 3;
4911 I[48] = 0; J[48] = 3; K[48] = 2;
4912 I[49] = 0; J[49] = 2; K[49] = 2;
4913 I[50] = 0; J[50] = 3; K[50] = 3;
4914 I[51] = 0; J[51] = 2; K[51] = 3;
4915 I[52] = 2; J[52] = 2; K[52] = 1;
4916 I[53] = 3; J[53] = 2; K[53] = 1;
4917 I[54] = 2; J[54] = 3; K[54] = 1;
4918 I[55] = 3; J[55] = 3; K[55] = 1;
4920 I[56] = 2; J[56] = 2; K[56] = 2;
4921 I[57] = 3; J[57] = 2; K[57] = 2;
4922 I[58] = 3; J[58] = 3; K[58] = 2;
4923 I[59] = 2; J[59] = 3; K[59] = 2;
4924 I[60] = 2; J[60] = 2; K[60] = 3;
4925 I[61] = 3; J[61] = 2; K[61] = 3;
4926 I[62] = 3; J[62] = 3; K[62] = 3;
4927 I[63] = 2; J[63] = 3; K[63] = 3;
4931 mfem_error (
"LagrangeHexFiniteElement::LagrangeHexFiniteElement");
4935 dof1d = fe1d ->
GetDof();
4937 #ifndef MFEM_THREAD_SAFE
4947 for (
int n = 0; n <
dof; n++)
4962 #ifdef MFEM_THREAD_SAFE
4963 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4970 for (
int n = 0; n <
dof; n++)
4972 shape(n) = shape1dx(I[n]) * shape1dy(J[n]) * shape1dz(K[n]);
4983 #ifdef MFEM_THREAD_SAFE
4984 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4985 DenseMatrix dshape1dx(dof1d,1), dshape1dy(dof1d,1), dshape1dz(dof1d,1);
4996 for (
int n = 0; n <
dof; n++)
4998 dshape(n,0) = dshape1dx(I[n],0) * shape1dy(J[n]) * shape1dz(K[n]);
4999 dshape(n,1) = shape1dx(I[n]) * dshape1dy(J[n],0) * shape1dz(K[n]);
5000 dshape(n,2) = shape1dx(I[n]) * shape1dy(J[n]) * dshape1dz(K[n],0);
5029 shape(0) = 1.0 - 2.0 * x;
5036 shape(1) = 2.0 * x - 1.0;
5037 shape(2) = 2.0 - 2.0 * x;
5048 dshape(0,0) = - 2.0;
5056 dshape(2,0) = - 2.0;
5083 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
5084 L1 = 2.0 * ( ip.
x );
5085 L2 = 2.0 * ( ip.
y );
5094 for (i = 0; i < 6; i++)
5101 shape(0) = L0 - 1.0;
5108 shape(1) = L1 - 1.0;
5115 shape(2) = L2 - 1.0;
5119 shape(3) = 1.0 - L2;
5120 shape(4) = 1.0 - L0;
5121 shape(5) = 1.0 - L1;
5131 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
5132 L1 = 2.0 * ( ip.
x );
5133 L2 = 2.0 * ( ip.
y );
5135 double DL0[2], DL1[2], DL2[2];
5136 DL0[0] = -2.0; DL0[1] = -2.0;
5137 DL1[0] = 2.0; DL1[1] = 0.0;
5138 DL2[0] = 0.0; DL2[1] = 2.0;
5140 for (i = 0; i < 6; i++)
5141 for (j = 0; j < 2; j++)
5148 for (j = 0; j < 2; j++)
5150 dshape(0,j) = DL0[j];
5151 dshape(3,j) = DL1[j];
5152 dshape(5,j) = DL2[j];
5157 for (j = 0; j < 2; j++)
5159 dshape(3,j) = DL0[j];
5160 dshape(1,j) = DL1[j];
5161 dshape(4,j) = DL2[j];
5166 for (j = 0; j < 2; j++)
5168 dshape(5,j) = DL0[j];
5169 dshape(4,j) = DL1[j];
5170 dshape(2,j) = DL2[j];
5175 for (j = 0; j < 2; j++)
5177 dshape(3,j) = - DL2[j];
5178 dshape(4,j) = - DL0[j];
5179 dshape(5,j) = - DL1[j];
5224 double L0, L1, L2, L3, L4, L5;
5225 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5226 L1 = 2.0 * ( ip.
x );
5227 L2 = 2.0 * ( ip.
y );
5228 L3 = 2.0 * ( ip.
z );
5229 L4 = 2.0 * ( ip.
x + ip.
y );
5230 L5 = 2.0 * ( ip.
y + ip.
z );
5243 for (i = 0; i < 10; i++)
5250 shape(0) = L0 - 1.0;
5258 shape(1) = L1 - 1.0;
5266 shape(2) = L2 - 1.0;
5274 shape(3) = L3 - 1.0;
5276 else if ((L4 <= 1.0) && (L5 <= 1.0))
5278 shape(4) = 1.0 - L5;
5280 shape(6) = 1.0 - L4;
5281 shape(8) = 1.0 - L0;
5283 else if ((L4 >= 1.0) && (L5 <= 1.0))
5285 shape(4) = 1.0 - L5;
5286 shape(5) = 1.0 - L1;
5287 shape(7) = L4 - 1.0;
5290 else if ((L4 <= 1.0) && (L5 >= 1.0))
5292 shape(5) = 1.0 - L3;
5293 shape(6) = 1.0 - L4;
5295 shape(9) = L5 - 1.0;
5297 else if ((L4 >= 1.0) && (L5 >= 1.0))
5300 shape(7) = L4 - 1.0;
5301 shape(8) = 1.0 - L2;
5302 shape(9) = L5 - 1.0;
5311 double L0, L1, L2, L3, L4, L5;
5312 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5313 L1 = 2.0 * ( ip.
x );
5314 L2 = 2.0 * ( ip.
y );
5315 L3 = 2.0 * ( ip.
z );
5316 L4 = 2.0 * ( ip.
x + ip.
y );
5317 L5 = 2.0 * ( ip.
y + ip.
z );
5319 double DL0[3], DL1[3], DL2[3], DL3[3], DL4[3], DL5[3];
5320 DL0[0] = -2.0; DL0[1] = -2.0; DL0[2] = -2.0;
5321 DL1[0] = 2.0; DL1[1] = 0.0; DL1[2] = 0.0;
5322 DL2[0] = 0.0; DL2[1] = 2.0; DL2[2] = 0.0;
5323 DL3[0] = 0.0; DL3[1] = 0.0; DL3[2] = 2.0;
5324 DL4[0] = 2.0; DL4[1] = 2.0; DL4[2] = 0.0;
5325 DL5[0] = 0.0; DL5[1] = 2.0; DL5[2] = 2.0;
5327 for (i = 0; i < 10; i++)
5328 for (j = 0; j < 3; j++)
5335 for (j = 0; j < 3; j++)
5337 dshape(0,j) = DL0[j];
5338 dshape(4,j) = DL1[j];
5339 dshape(5,j) = DL2[j];
5340 dshape(6,j) = DL3[j];
5345 for (j = 0; j < 3; j++)
5347 dshape(4,j) = DL0[j];
5348 dshape(1,j) = DL1[j];
5349 dshape(7,j) = DL2[j];
5350 dshape(8,j) = DL3[j];
5355 for (j = 0; j < 3; j++)
5357 dshape(5,j) = DL0[j];
5358 dshape(7,j) = DL1[j];
5359 dshape(2,j) = DL2[j];
5360 dshape(9,j) = DL3[j];
5365 for (j = 0; j < 3; j++)
5367 dshape(6,j) = DL0[j];
5368 dshape(8,j) = DL1[j];
5369 dshape(9,j) = DL2[j];
5370 dshape(3,j) = DL3[j];
5373 else if ((L4 <= 1.0) && (L5 <= 1.0))
5375 for (j = 0; j < 3; j++)
5377 dshape(4,j) = - DL5[j];
5378 dshape(5,j) = DL2[j];
5379 dshape(6,j) = - DL4[j];
5380 dshape(8,j) = - DL0[j];
5383 else if ((L4 >= 1.0) && (L5 <= 1.0))
5385 for (j = 0; j < 3; j++)
5387 dshape(4,j) = - DL5[j];
5388 dshape(5,j) = - DL1[j];
5389 dshape(7,j) = DL4[j];
5390 dshape(8,j) = DL3[j];
5393 else if ((L4 <= 1.0) && (L5 >= 1.0))
5395 for (j = 0; j < 3; j++)
5397 dshape(5,j) = - DL3[j];
5398 dshape(6,j) = - DL4[j];
5399 dshape(8,j) = DL1[j];
5400 dshape(9,j) = DL5[j];
5403 else if ((L4 >= 1.0) && (L5 >= 1.0))
5405 for (j = 0; j < 3; j++)
5407 dshape(5,j) = DL0[j];
5408 dshape(7,j) = DL4[j];
5409 dshape(8,j) = - DL2[j];
5410 dshape(9,j) = DL5[j];
5443 double x = ip.
x, y = ip.
y;
5445 Lx = 2.0 * ( 1. - x );
5446 Ly = 2.0 * ( 1. - y );
5455 for (i = 0; i < 9; i++)
5460 if ((x <= 0.5) && (y <= 0.5))
5462 shape(0) = (Lx - 1.0) * (Ly - 1.0);
5463 shape(4) = (2.0 - Lx) * (Ly - 1.0);
5464 shape(8) = (2.0 - Lx) * (2.0 - Ly);
5465 shape(7) = (Lx - 1.0) * (2.0 - Ly);
5467 else if ((x >= 0.5) && (y <= 0.5))
5469 shape(4) = Lx * (Ly - 1.0);
5470 shape(1) = (1.0 - Lx) * (Ly - 1.0);
5471 shape(5) = (1.0 - Lx) * (2.0 - Ly);
5472 shape(8) = Lx * (2.0 - Ly);
5474 else if ((x >= 0.5) && (y >= 0.5))
5476 shape(8) = Lx * Ly ;
5477 shape(5) = (1.0 - Lx) * Ly ;
5478 shape(2) = (1.0 - Lx) * (1.0 - Ly);
5479 shape(6) = Lx * (1.0 - Ly);
5481 else if ((x <= 0.5) && (y >= 0.5))
5483 shape(7) = (Lx - 1.0) * Ly ;
5484 shape(8) = (2.0 - Lx) * Ly ;
5485 shape(6) = (2.0 - Lx) * (1.0 - Ly);
5486 shape(3) = (Lx - 1.0) * (1.0 - Ly);
5494 double x = ip.
x, y = ip.
y;
5496 Lx = 2.0 * ( 1. - x );
5497 Ly = 2.0 * ( 1. - y );
5499 for (i = 0; i < 9; i++)
5500 for (j = 0; j < 2; j++)
5505 if ((x <= 0.5) && (y <= 0.5))
5507 dshape(0,0) = 2.0 * (1.0 - Ly);
5508 dshape(0,1) = 2.0 * (1.0 - Lx);
5510 dshape(4,0) = 2.0 * (Ly - 1.0);
5511 dshape(4,1) = -2.0 * (2.0 - Lx);
5513 dshape(8,0) = 2.0 * (2.0 - Ly);
5514 dshape(8,1) = 2.0 * (2.0 - Lx);
5516 dshape(7,0) = -2.0 * (2.0 - Ly);
5517 dshape(7,0) = 2.0 * (Lx - 1.0);
5519 else if ((x >= 0.5) && (y <= 0.5))
5521 dshape(4,0) = -2.0 * (Ly - 1.0);
5522 dshape(4,1) = -2.0 * Lx;
5524 dshape(1,0) = 2.0 * (Ly - 1.0);
5525 dshape(1,1) = -2.0 * (1.0 - Lx);
5527 dshape(5,0) = 2.0 * (2.0 - Ly);
5528 dshape(5,1) = 2.0 * (1.0 - Lx);
5530 dshape(8,0) = -2.0 * (2.0 - Ly);
5531 dshape(8,1) = 2.0 * Lx;
5533 else if ((x >= 0.5) && (y >= 0.5))
5535 dshape(8,0) = -2.0 * Ly;
5536 dshape(8,1) = -2.0 * Lx;
5538 dshape(5,0) = 2.0 * Ly;
5539 dshape(5,1) = -2.0 * (1.0 - Lx);
5541 dshape(2,0) = 2.0 * (1.0 - Ly);
5542 dshape(2,1) = 2.0 * (1.0 - Lx);
5544 dshape(6,0) = -2.0 * (1.0 - Ly);
5545 dshape(6,1) = 2.0 * Lx;
5547 else if ((x <= 0.5) && (y >= 0.5))
5549 dshape(7,0) = -2.0 * Ly;
5550 dshape(7,1) = -2.0 * (Lx - 1.0);
5552 dshape(8,0) = 2.0 * Ly ;
5553 dshape(8,1) = -2.0 * (2.0 - Lx);
5555 dshape(6,0) = 2.0 * (1.0 - Ly);
5556 dshape(6,1) = 2.0 * (2.0 - Lx);
5558 dshape(3,0) = -2.0 * (1.0 - Ly);
5559 dshape(3,1) = 2.0 * (Lx - 1.0);
5570 I[ 0] = 0.0; J[ 0] = 0.0; K[ 0] = 0.0;
5571 I[ 1] = 1.0; J[ 1] = 0.0; K[ 1] = 0.0;
5572 I[ 2] = 1.0; J[ 2] = 1.0; K[ 2] = 0.0;
5573 I[ 3] = 0.0; J[ 3] = 1.0; K[ 3] = 0.0;
5574 I[ 4] = 0.0; J[ 4] = 0.0; K[ 4] = 1.0;
5575 I[ 5] = 1.0; J[ 5] = 0.0; K[ 5] = 1.0;
5576 I[ 6] = 1.0; J[ 6] = 1.0; K[ 6] = 1.0;
5577 I[ 7] = 0.0; J[ 7] = 1.0; K[ 7] = 1.0;
5579 I[ 8] = 0.5; J[ 8] = 0.0; K[ 8] = 0.0;
5580 I[ 9] = 1.0; J[ 9] = 0.5; K[ 9] = 0.0;
5581 I[10] = 0.5; J[10] = 1.0; K[10] = 0.0;
5582 I[11] = 0.0; J[11] = 0.5; K[11] = 0.0;
5583 I[12] = 0.5; J[12] = 0.0; K[12] = 1.0;
5584 I[13] = 1.0; J[13] = 0.5; K[13] = 1.0;
5585 I[14] = 0.5; J[14] = 1.0; K[14] = 1.0;
5586 I[15] = 0.0; J[15] = 0.5; K[15] = 1.0;
5587 I[16] = 0.0; J[16] = 0.0; K[16] = 0.5;
5588 I[17] = 1.0; J[17] = 0.0; K[17] = 0.5;
5589 I[18] = 1.0; J[18] = 1.0; K[18] = 0.5;
5590 I[19] = 0.0; J[19] = 1.0; K[19] = 0.5;
5592 I[20] = 0.5; J[20] = 0.5; K[20] = 0.0;
5593 I[21] = 0.5; J[21] = 0.0; K[21] = 0.5;
5594 I[22] = 1.0; J[22] = 0.5; K[22] = 0.5;
5595 I[23] = 0.5; J[23] = 1.0; K[23] = 0.5;
5596 I[24] = 0.0; J[24] = 0.5; K[24] = 0.5;
5597 I[25] = 0.5; J[25] = 0.5; K[25] = 1.0;
5599 I[26] = 0.5; J[26] = 0.5; K[26] = 0.5;
5601 for (
int n = 0; n < 27; n++)
5614 double x = ip.
x, y = ip.
y, z = ip.
z;
5616 for (i = 0; i < 27; i++)
5621 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5636 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5651 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5666 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5681 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5696 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5711 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5742 shape(N[0]) = Lx * Ly * Lz;
5743 shape(N[1]) = (1 - Lx) * Ly * Lz;
5744 shape(N[2]) = (1 - Lx) * (1 - Ly) * Lz;
5745 shape(N[3]) = Lx * (1 - Ly) * Lz;
5746 shape(N[4]) = Lx * Ly * (1 - Lz);
5747 shape(N[5]) = (1 - Lx) * Ly * (1 - Lz);
5748 shape(N[6]) = (1 - Lx) * (1 - Ly) * (1 - Lz);
5749 shape(N[7]) = Lx * (1 - Ly) * (1 - Lz);
5757 double x = ip.
x, y = ip.
y, z = ip.
z;
5759 for (i = 0; i < 27; i++)
5760 for (j = 0; j < 3; j++)
5765 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5780 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5795 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5810 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5825 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5840 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5855 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5886 dshape(N[0],0) = -2.0 * Ly * Lz ;
5887 dshape(N[0],1) = -2.0 * Lx * Lz ;
5888 dshape(N[0],2) = -2.0 * Lx * Ly ;
5890 dshape(N[1],0) = 2.0 * Ly * Lz ;
5891 dshape(N[1],1) = -2.0 * (1 - Lx) * Lz ;
5892 dshape(N[1],2) = -2.0 * (1 - Lx) * Ly ;
5894 dshape(N[2],0) = 2.0 * (1 - Ly) * Lz ;
5895 dshape(N[2],1) = 2.0 * (1 - Lx) * Lz ;
5896 dshape(N[2],2) = -2.0 * (1 - Lx) * (1 - Ly);
5898 dshape(N[3],0) = -2.0 * (1 - Ly) * Lz ;
5899 dshape(N[3],1) = 2.0 * Lx * Lz ;
5900 dshape(N[3],2) = -2.0 * Lx * (1 - Ly);
5902 dshape(N[4],0) = -2.0 * Ly * (1 - Lz);
5903 dshape(N[4],1) = -2.0 * Lx * (1 - Lz);
5904 dshape(N[4],2) = 2.0 * Lx * Ly ;
5906 dshape(N[5],0) = 2.0 * Ly * (1 - Lz);
5907 dshape(N[5],1) = -2.0 * (1 - Lx) * (1 - Lz);
5908 dshape(N[5],2) = 2.0 * (1 - Lx) * Ly ;
5910 dshape(N[6],0) = 2.0 * (1 - Ly) * (1 - Lz);
5911 dshape(N[6],1) = 2.0 * (1 - Lx) * (1 - Lz);
5912 dshape(N[6],2) = 2.0 * (1 - Lx) * (1 - Ly);
5914 dshape(N[7],0) = -2.0 * (1 - Ly) * (1 - Lz);
5915 dshape(N[7],1) = 2.0 * Lx * (1 - Lz);
5916 dshape(N[7],2) = 2.0 * Lx * (1 - Ly);
5976 double x = ip.
x, y = ip.
y, z = ip.
z;
5978 shape(0,0) = (1. - y) * (1. - z);
5982 shape(2,0) = y * (1. - z);
5986 shape(4,0) = z * (1. - y);
5995 shape(1,1) = x * (1. - z);
5999 shape(3,1) = (1. - x) * (1. - z);
6007 shape(7,1) = (1. - x) * z;
6012 shape(8,2) = (1. - x) * (1. - y);
6016 shape(9,2) = x * (1. - y);
6020 shape(10,2) = x * y;
6024 shape(11,2) = y * (1. - x);
6032 double x = ip.
x, y = ip.
y, z = ip.
z;
6034 curl_shape(0,0) = 0.;
6035 curl_shape(0,1) = y - 1.;
6036 curl_shape(0,2) = 1. - z;
6038 curl_shape(2,0) = 0.;
6039 curl_shape(2,1) = -y;
6040 curl_shape(2,2) = z - 1.;
6042 curl_shape(4,0) = 0;
6043 curl_shape(4,1) = 1. - y;
6044 curl_shape(4,2) = z;
6046 curl_shape(6,0) = 0.;
6047 curl_shape(6,1) = y;
6048 curl_shape(6,2) = -z;
6050 curl_shape(1,0) = x;
6051 curl_shape(1,1) = 0.;
6052 curl_shape(1,2) = 1. - z;
6054 curl_shape(3,0) = 1. - x;
6055 curl_shape(3,1) = 0.;
6056 curl_shape(3,2) = z - 1.;
6058 curl_shape(5,0) = -x;
6059 curl_shape(5,1) = 0.;
6060 curl_shape(5,2) = z;
6062 curl_shape(7,0) = x - 1.;
6063 curl_shape(7,1) = 0.;
6064 curl_shape(7,2) = -z;
6066 curl_shape(8,0) = x - 1.;
6067 curl_shape(8,1) = 1. - y;
6068 curl_shape(8,2) = 0.;
6070 curl_shape(9,0) = -x;
6071 curl_shape(9,1) = y - 1.;
6072 curl_shape(9,2) = 0;
6074 curl_shape(10,0) = x;
6075 curl_shape(10,1) = -y;
6076 curl_shape(10,2) = 0.;
6078 curl_shape(11,0) = 1. - x;
6079 curl_shape(11,1) = y;
6080 curl_shape(11,2) = 0.;
6083 const double Nedelec1HexFiniteElement::tk[12][3] =
6085 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
6086 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
6087 {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}
6094 #ifdef MFEM_THREAD_SAFE
6099 for (k = 0; k < 12; k++)
6102 for (j = 0; j < 12; j++)
6104 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
6106 if (j == k) { d -= 1.0; }
6107 if (fabs(d) > 1.0e-12)
6109 mfem::err <<
"Nedelec1HexFiniteElement::GetLocalInterpolation (...)\n"
6110 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6118 ip.
x = ip.
y = ip.
z = 0.0;
6125 for (k = 0; k < 12; k++)
6128 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6131 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
6132 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
6133 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
6134 for (j = 0; j < 12; j++)
6135 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6136 vshape(j,2)*vk[2])) < 1.0e-12)
6150 for (
int k = 0; k < 12; k++)
6158 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
6159 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
6160 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
6197 double x = ip.
x, y = ip.
y, z = ip.
z;
6199 shape(0,0) = 1. - y - z;
6204 shape(1,1) = 1. - x - z;
6209 shape(2,2) = 1. - x - y;
6228 curl_shape(0,0) = 0.;
6229 curl_shape(0,1) = -2.;
6230 curl_shape(0,2) = 2.;
6232 curl_shape(1,0) = 2.;
6233 curl_shape(1,1) = 0.;
6234 curl_shape(1,2) = -2.;
6236 curl_shape(2,0) = -2.;
6237 curl_shape(2,1) = 2.;
6238 curl_shape(2,2) = 0.;
6240 curl_shape(3,0) = 0.;
6241 curl_shape(3,1) = 0.;
6242 curl_shape(3,2) = 2.;
6244 curl_shape(4,0) = 0.;
6245 curl_shape(4,1) = -2.;
6246 curl_shape(4,2) = 0.;
6248 curl_shape(5,0) = 2.;
6249 curl_shape(5,1) = 0.;
6250 curl_shape(5,2) = 0.;
6253 const double Nedelec1TetFiniteElement::tk[6][3] =
6254 {{1,0,0}, {0,1,0}, {0,0,1}, {-1,1,0}, {-1,0,1}, {0,-1,1}};
6260 #ifdef MFEM_THREAD_SAFE
6265 for (k = 0; k < 6; k++)
6268 for (j = 0; j < 6; j++)
6270 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
6272 if (j == k) { d -= 1.0; }
6273 if (fabs(d) > 1.0e-12)
6275 mfem::err <<
"Nedelec1TetFiniteElement::GetLocalInterpolation (...)\n"
6276 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6284 ip.
x = ip.
y = ip.
z = 0.0;
6291 for (k = 0; k < 6; k++)
6294 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6297 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
6298 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
6299 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
6300 for (j = 0; j < 6; j++)
6301 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6302 vshape(j,2)*vk[2])) < 1.0e-12)
6316 for (
int k = 0; k < 6; k++)
6324 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
6325 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
6326 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
6363 double x = ip.
x, y = ip.
y, z = ip.
z;
6367 shape(0,2) = z - 1.;
6370 shape(1,1) = y - 1.;
6381 shape(4,0) = x - 1.;
6401 const double RT0HexFiniteElement::nk[6][3] =
6402 {{0,0,-1}, {0,-1,0}, {1,0,0}, {0,1,0}, {-1,0,0}, {0,0,1}};
6408 #ifdef MFEM_THREAD_SAFE
6414 for (k = 0; k < 6; k++)
6417 for (j = 0; j < 6; j++)
6419 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6421 if (j == k) { d -= 1.0; }
6422 if (fabs(d) > 1.0e-12)
6424 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6425 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6433 ip.
x = ip.
y = ip.
z = 0.0;
6441 for (k = 0; k < 6; k++)
6444 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6447 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6448 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6449 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6450 for (j = 0; j < 6; j++)
6451 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6452 vshape(j,2)*vk[2])) < 1.0e-12)
6465 #ifdef MFEM_THREAD_SAFE
6469 for (
int k = 0; k < 6; k++)
6478 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6479 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6480 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6609 double x = ip.
x, y = ip.
y, z = ip.
z;
6613 shape(2,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6616 shape(3,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6619 shape(0,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6622 shape(1,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6625 shape(4,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6628 shape(5,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6631 shape(6,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6634 shape(7,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6637 shape(8,0) = (-x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6640 shape(9,0) = (-x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6643 shape(10,0) = (-x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6646 shape(11,0) = (-x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6651 shape(13,1) = (-y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6654 shape(12,1) = (-y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6657 shape(15,1) = (-y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6660 shape(14,1) = (-y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6663 shape(17,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6666 shape(16,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6669 shape(19,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6672 shape(18,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6678 shape(20,2) = (-z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6681 shape(21,2) = (-z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6684 shape(22,2) = (-z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6687 shape(23,2) = (-z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6689 shape(24,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6692 shape(25,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6695 shape(26,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6698 shape(27,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6703 shape(28,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6706 shape(29,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6709 shape(30,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6712 shape(31,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6717 shape(32,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6720 shape(33,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6723 shape(34,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6726 shape(35,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6732 double x = ip.
x, y = ip.
y, z = ip.
z;
6734 divshape(2) = -(-3. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6735 divshape(3) = -(-3. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6736 divshape(0) = -(-3. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6737 divshape(1) = -(-3. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6739 divshape(4) = -(-3. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6740 divshape(5) = -(-3. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6741 divshape(6) = -(-3. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6742 divshape(7) = -(-3. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6744 divshape(8) = (-1. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6745 divshape(9) = (-1. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6746 divshape(10) = (-1. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6747 divshape(11) = (-1. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6749 divshape(13) = (-1. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6750 divshape(12) = (-1. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6751 divshape(15) = (-1. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6752 divshape(14) = (-1. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6754 divshape(17) = -(-3. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6755 divshape(16) = -(-3. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6756 divshape(19) = -(-3. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6757 divshape(18) = -(-3. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6759 divshape(20) = (-1. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6760 divshape(21) = (-1. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6761 divshape(22) = (-1. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6762 divshape(23) = (-1. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6764 divshape(24) = ( 4. - 8.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6765 divshape(25) = ( 4. - 8.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6766 divshape(26) = ( 4. - 8.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6767 divshape(27) = ( 4. - 8.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6769 divshape(28) = ( 4. - 8.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6770 divshape(29) = ( 4. - 8.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6771 divshape(30) = ( 4. - 8.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6772 divshape(31) = ( 4. - 8.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6774 divshape(32) = ( 4. - 8.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6775 divshape(33) = ( 4. - 8.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6776 divshape(34) = ( 4. - 8.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6777 divshape(35) = ( 4. - 8.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6780 const double RT1HexFiniteElement::nk[36][3] =
6782 {0, 0,-1}, {0, 0,-1}, {0, 0,-1}, {0, 0,-1},
6783 {0,-1, 0}, {0,-1, 0}, {0,-1, 0}, {0,-1, 0},
6784 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6785 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6786 {-1,0, 0}, {-1,0, 0}, {-1,0, 0}, {-1,0, 0},
6787 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
6788 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6789 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6790 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}
6797 #ifdef MFEM_THREAD_SAFE
6803 for (k = 0; k < 36; k++)
6806 for (j = 0; j < 36; j++)
6808 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6810 if (j == k) { d -= 1.0; }
6811 if (fabs(d) > 1.0e-12)
6813 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6814 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6822 ip.
x = ip.
y = ip.
z = 0.0;
6830 for (k = 0; k < 36; k++)
6833 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6836 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6837 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6838 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6839 for (j = 0; j < 36; j++)
6840 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6841 vshape(j,2)*vk[2])) < 1.0e-12)
6854 #ifdef MFEM_THREAD_SAFE
6858 for (
int k = 0; k < 36; k++)
6867 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6868 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6869 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6897 double x2 = 2.0*ip.
x, y2 = 2.0*ip.
y, z2 = 2.0*ip.
z;
6903 shape(1,0) = x2 - 2.0;
6908 shape(2,1) = y2 - 2.0;
6913 shape(3,2) = z2 - 2.0;
6925 const double RT0TetFiniteElement::nk[4][3] =
6926 {{.5,.5,.5}, {-.5,0,0}, {0,-.5,0}, {0,0,-.5}};
6932 #ifdef MFEM_THREAD_SAFE
6938 for (k = 0; k < 4; k++)
6941 for (j = 0; j < 4; j++)
6943 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6945 if (j == k) { d -= 1.0; }
6946 if (fabs(d) > 1.0e-12)
6948 mfem::err <<
"RT0TetFiniteElement::GetLocalInterpolation (...)\n"
6949 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6957 ip.
x = ip.
y = ip.
z = 0.0;
6965 for (k = 0; k < 4; k++)
6968 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6971 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6972 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6973 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6974 for (j = 0; j < 4; j++)
6975 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6976 vshape(j,2)*vk[2])) < 1.0e-12)
6989 #ifdef MFEM_THREAD_SAFE
6993 for (
int k = 0; k < 4; k++)
7002 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
7003 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
7004 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
7039 double x = 2. * ip.
x - 1.;
7040 double y = 2. * ip.
y - 1.;
7041 double z = 2. * ip.
z - 1.;
7042 double f5 = x * x - y * y;
7043 double f6 = y * y - z * z;
7045 shape(0) = (1./6.) * (1. - 3. * z - f5 - 2. * f6);
7046 shape(1) = (1./6.) * (1. - 3. * y - f5 + f6);
7047 shape(2) = (1./6.) * (1. + 3. * x + 2. * f5 + f6);
7048 shape(3) = (1./6.) * (1. + 3. * y - f5 + f6);
7049 shape(4) = (1./6.) * (1. - 3. * x + 2. * f5 + f6);
7050 shape(5) = (1./6.) * (1. + 3. * z - f5 - 2. * f6);
7056 const double a = 2./3.;
7058 double xt = a * (1. - 2. * ip.
x);
7059 double yt = a * (1. - 2. * ip.
y);
7060 double zt = a * (1. - 2. * ip.
z);
7064 dshape(0,2) = -1. - 2. * zt;
7067 dshape(1,1) = -1. - 2. * yt;
7070 dshape(2,0) = 1. - 2. * xt;
7075 dshape(3,1) = 1. - 2. * yt;
7078 dshape(4,0) = -1. - 2. * xt;
7084 dshape(5,2) = 1. - 2. * zt;
7089 : etype(etype), auxiliary_basis(NULL)
7098 for (
int i = 0; i <=
p; i++)
7112 for (
int i = 0; i <=
p; i++)
7114 for (
int j = 0; j < i; j++)
7116 double xij = x(i) - x(j);
7121 for (
int i = 0; i <=
p; i++)
7128 for (
int i = 0; i <
p; i++)
7132 mfem_error(
"Poly_1D::Basis::Basis : nodes are not increasing!");
7142 auxiliary_basis =
new Basis(
7164 int i, k,
p = x.Size() - 1;
7174 for (k = 0; k <
p; k++)
7176 if (y >= (x(k) + x(k+1))/2)
7182 for (i = k+1; i <=
p; i++)
7189 l = lk * (y - x(k));
7191 for (i = 0; i < k; i++)
7193 u(i) = l * w(i) / (y - x(i));
7196 for (i++; i <=
p; i++)
7198 u(i) = l * w(i) / (y - x(i));
7206 auxiliary_basis->Eval(y, u_aux, d_aux);
7207 EvalIntegrated(d_aux, u);
7226 int i, k,
p = x.Size() - 1;
7227 double l, lp, lk, sk, si;
7237 for (k = 0; k <
p; k++)
7239 if (y >= (x(k) + x(k+1))/2)
7245 for (i = k+1; i <=
p; i++)
7252 l = lk * (y - x(k));
7255 for (i = 0; i < k; i++)
7257 si = 1.0/(y - x(i));
7259 u(i) = l * si * w(i);
7262 for (i++; i <=
p; i++)
7264 si = 1.0/(y - x(i));
7266 u(i) = l * si * w(i);
7270 for (i = 0; i < k; i++)
7272 d(i) = (lp * w(i) -
u(i))/(y - x(i));
7275 for (i++; i <=
p; i++)
7277 d(i) = (lp * w(i) -
u(i))/(y - x(i));
7285 auxiliary_basis->Eval(y, u_aux, d_aux, d2_aux);
7286 EvalIntegrated(d_aux,u);
7287 EvalIntegrated(d2_aux,d);
7297 "Basis::Eval with second order derivatives not implemented for"
7298 " etype = " << etype);
7311 int i, k,
p = x.Size() - 1;
7312 double l, lp, lp2, lk, sk, si, sk2;
7323 for (k = 0; k <
p; k++)
7325 if (y >= (x(k) + x(k+1))/2)
7331 for (i = k+1; i <=
p; i++)
7338 l = lk * (y - x(k));
7342 for (i = 0; i < k; i++)
7344 si = 1.0/(y - x(i));
7347 u(i) = l * si * w(i);
7350 for (i++; i <=
p; i++)
7352 si = 1.0/(y - x(i));
7355 u(i) = l * si * w(i);
7358 lp2 = lp * sk + l * sk2 + sk * lk;
7360 for (i = 0; i < k; i++)
7362 d(i) = (lp * w(i) -
u(i))/(y - x(i));
7363 d2(i) = (lp2 * w(i) - 2 * d(i))/(y - x(i));
7366 d2(k) = sk2 *
u(k) + sk * d(k);
7367 for (i++; i <=
p; i++)
7369 d(i) = (lp * w(i) -
u(i))/(y - x(i));
7370 d2(i) = (lp2 * w(i) - 2 * d(i))/(y - x(i));
7378 MFEM_ABORT(
"Integrated basis must be evaluated with EvalIntegrated");
7387 "EvalIntegrated is only valid for Integrated basis type");
7388 int p = d_aux.
Size() - 1;
7390 for (
int j=1; j<
p; ++j)
7392 u[j] = u[j-1] - d_aux[j];
7398 delete auxiliary_basis;
7406 for (
int i = 0; i <=
p; i++)
7408 binom(i,0) = binom(i,i) = 1;
7409 for (
int j = 1; j < i; j++)
7411 binom(i,j) = binom(i-1,j) + binom(i-1,j-1);
7420 for (
int i = 0; i <=
p; i++)
7423 double s = sin(M_PI_2*(i + 0.5)/(p + 1));
7428 void Poly_1D::CalcMono(
const int p,
const double x,
double *
u)
7432 for (
int n = 1; n <=
p; n++)
7438 void Poly_1D::CalcMono(
const int p,
const double x,
double *u,
double *d)
7443 for (
int n = 1; n <=
p; n++)
7463 for (i = 1; i <
p; i++)
7470 for (i--; i > 0; i--)
7480 double *u,
double *d)
7491 const double xpy = x + y, ptx = p*x;
7494 for (i = 1; i <
p; i++)
7496 d[i] = b[i]*z*(i*xpy - ptx);
7503 for (i--; i > 0; i--)
7525 const double xpy = x + y, ptx = p*x;
7528 for (i = 1; i <
p; i++)
7530 d[i] = b[i]*z*(i*xpy - ptx);
7535 for (i--; i > 0; i--)
7550 if (p == 0) {
return; }
7551 u[1] = z = 2.*x - 1.;
7552 for (
int n = 1; n <
p; n++)
7554 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7567 if (p == 0) {
return; }
7568 u[1] = z = 2.*x - 1.;
7570 for (
int n = 1; n <
p; n++)
7572 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7573 d[n+1] = (4*n + 2)*u[n] + d[n-1];
7577 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u)
7584 if (p == 0) {
return; }
7585 u[1] = z = 2.*x - 1.;
7586 for (
int n = 1; n <
p; n++)
7588 u[n+1] = 2*z*u[n] - u[n-1];
7592 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d)
7605 if (p == 0) {
return; }
7606 u[1] = z = 2.*x - 1.;
7608 for (
int n = 1; n <
p; n++)
7610 u[n+1] = 2*z*u[n] - u[n-1];
7611 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7615 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d,
7631 if (p == 0) {
return; }
7632 u[1] = z = 2.*x - 1.;
7635 for (
int n = 1; n <
p; n++)
7637 u[n+1] = 2*z*u[n] - u[n-1];
7638 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7639 dd[n+1] = (n + 1)*(2.*(n + 1)*d[n] + z*dd[n])/n;
7650 if (points_container.find(btype) == points_container.end())
7655 if (pts.
Size() <=
p)
7661 pts[
p] =
new double[p + 1];
7671 if ( bases_container.find(btype) == bases_container.end() )
7677 if (bases.
Size() <=
p)
7681 if (bases[p] == NULL)
7694 for (PointsMap::iterator it = points_container.begin();
7695 it != points_container.end() ; ++it)
7698 for (
int i = 0 ; i < pts.
Size() ; ++i )
7705 for (BasisMap::iterator it = bases_container.begin();
7706 it != bases_container.end() ; ++it)
7709 for (
int i = 0 ; i < bases.
Size() ; ++i )
7735 for (
int i = 1; i <
p; i++)
7743 const int p1 = p + 1;
7754 for (
int i = 1; i <
p; i++)
7758 for (
int i = 1; i <
p; i++)
7762 for (
int i = 1; i <
p; i++)
7766 for (
int i = 1; i <
p; i++)
7772 for (
int j = 1; j <
p; j++)
7774 for (
int i = 1; i <
p; i++)
7783 const int p1 = p + 1;
7787 dof_map[0 + (0 + 0*p1)*p1] = 0;
7788 dof_map[p + (0 + 0*p1)*p1] = 1;
7789 dof_map[p + (p + 0*p1)*p1] = 2;
7790 dof_map[0 + (p + 0*p1)*p1] = 3;
7791 dof_map[0 + (0 + p*p1)*p1] = 4;
7792 dof_map[p + (0 + p*p1)*p1] = 5;
7793 dof_map[p + (p + p*p1)*p1] = 6;
7794 dof_map[0 + (p + p*p1)*p1] = 7;
7799 for (
int i = 1; i <
p; i++)
7801 dof_map[i + (0 + 0*p1)*p1] = o++;
7803 for (
int i = 1; i <
p; i++)
7805 dof_map[p + (i + 0*p1)*p1] = o++;
7807 for (
int i = 1; i <
p; i++)
7809 dof_map[i + (p + 0*p1)*p1] = o++;
7811 for (
int i = 1; i <
p; i++)
7813 dof_map[0 + (i + 0*p1)*p1] = o++;
7815 for (
int i = 1; i <
p; i++)
7817 dof_map[i + (0 + p*p1)*p1] = o++;
7819 for (
int i = 1; i <
p; i++)
7821 dof_map[p + (i + p*p1)*p1] = o++;
7823 for (
int i = 1; i <
p; i++)
7825 dof_map[i + (p + p*p1)*p1] = o++;
7827 for (
int i = 1; i <
p; i++)
7829 dof_map[0 + (i + p*p1)*p1] = o++;
7831 for (
int i = 1; i <
p; i++)
7833 dof_map[0 + (0 + i*p1)*p1] = o++;
7835 for (
int i = 1; i <
p; i++)
7837 dof_map[p + (0 + i*p1)*p1] = o++;
7839 for (
int i = 1; i <
p; i++)
7841 dof_map[p + (p + i*p1)*p1] = o++;
7843 for (
int i = 1; i <
p; i++)
7845 dof_map[0 + (p + i*p1)*p1] = o++;
7849 for (
int j = 1; j <
p; j++)
7851 for (
int i = 1; i <
p; i++)
7853 dof_map[i + ((p-j) + 0*p1)*p1] = o++;
7856 for (
int j = 1; j <
p; j++)
7858 for (
int i = 1; i <
p; i++)
7860 dof_map[i + (0 + j*p1)*p1] = o++;
7863 for (
int j = 1; j <
p; j++)
7865 for (
int i = 1; i <
p; i++)
7867 dof_map[p + (i + j*p1)*p1] = o++;
7870 for (
int j = 1; j <
p; j++)
7872 for (
int i = 1; i <
p; i++)
7874 dof_map[(p-i) + (p + j*p1)*p1] = o++;
7877 for (
int j = 1; j <
p; j++)
7879 for (
int i = 1; i <
p; i++)
7881 dof_map[0 + ((p-i) + j*p1)*p1] = o++;
7884 for (
int j = 1; j <
p; j++)
7886 for (
int i = 1; i <
p; i++)
7888 dof_map[i + (j + p*p1)*p1] = o++;
7893 for (
int k = 1; k <
p; k++)
7895 for (
int j = 1; j <
p; j++)
7897 for (
int i = 1; i <
p; i++)
7899 dof_map[i + (j + k*p1)*p1] = o++;
7906 MFEM_ABORT(
"invalid dimension: " << dims);
7917 MFEM_ABORT(
"invalid DofMapType: " << dmtype);
7935 const int dims,
const int p,
const DofMapType dmtype)
7937 Pow(p + 1, dims), p,
7951 cbasis1d(
poly1d.GetBasis(p, VerifyClosed(cbtype))),
7952 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(obtype)))
7954 MFEM_VERIFY(dims > 1,
"Constructor for VectorTensorFiniteElement with both "
7955 "open and closed bases is not valid for 1D elements.");
7967 cbasis1d(
poly1d.GetBasis(p, VerifyOpen(obtype))),
7968 obasis1d(
poly1d.GetBasis(p, VerifyOpen(obtype)))
7970 MFEM_VERIFY(dims == 1,
"Constructor for VectorTensorFiniteElement without "
7971 "closed basis is only valid for 1D elements.");
7979 #ifndef MFEM_THREAD_SAFE
7987 for (
int i = 1; i <
p; i++)
7996 const int p =
order;
7998 #ifdef MFEM_THREAD_SAFE
8004 shape(0) = shape_x(0);
8005 shape(1) = shape_x(p);
8006 for (
int i = 1; i <
p; i++)
8008 shape(i+1) = shape_x(i);
8015 const int p =
order;
8017 #ifdef MFEM_THREAD_SAFE
8018 Vector shape_x(p+1), dshape_x(p+1);
8023 dshape(0,0) = dshape_x(0);
8024 dshape(1,0) = dshape_x(p);
8025 for (
int i = 1; i <
p; i++)
8027 dshape(i+1,0) = dshape_x(i);
8034 const int p =
order;
8036 #ifdef MFEM_THREAD_SAFE
8037 Vector shape_x(p+1), dshape_x(p+1), d2shape_x(p+1);
8042 Hessian(0,0) = d2shape_x(0);
8043 Hessian(1,0) = d2shape_x(p);
8044 for (
int i = 1; i <
p; i++)
8046 Hessian(i+1,0) = d2shape_x(i);
8052 const int p =
order;
8060 for (
int i = 1; i <
p; i++)
8069 for (
int i = 1; i <
p; i++)
8083 #ifndef MFEM_THREAD_SAFE
8084 const int p1 = p + 1;
8095 for (
int j = 0; j <=
p; j++)
8097 for (
int i = 0; i <=
p; i++)
8107 const int p =
order;
8109 #ifdef MFEM_THREAD_SAFE
8110 Vector shape_x(p+1), shape_y(p+1);
8116 for (
int o = 0, j = 0; j <=
p; j++)
8117 for (
int i = 0; i <=
p; i++)
8119 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
8126 const int p =
order;
8128 #ifdef MFEM_THREAD_SAFE
8129 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
8135 for (
int o = 0, j = 0; j <=
p; j++)
8137 for (
int i = 0; i <=
p; i++)
8139 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
8140 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
8148 const int p =
order;
8150 #ifdef MFEM_THREAD_SAFE
8151 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1),
8152 d2shape_x(p+1), d2shape_y(p+1);
8158 for (
int o = 0, j = 0; j <=
p; j++)
8160 for (
int i = 0; i <=
p; i++)
8162 Hessian(
dof_map[o],0) = d2shape_x(i)* shape_y(j);
8163 Hessian(
dof_map[o],1) = dshape_x(i)* dshape_y(j);
8164 Hessian(
dof_map[o],2) = shape_x(i)*d2shape_y(j); o++;
8171 const int p =
order;
8174 #ifdef MFEM_THREAD_SAFE
8175 Vector shape_x(p+1), shape_y(p+1);
8178 for (
int i = 0; i <=
p; i++)
8187 for (
int o = 0, j = 0; j <=
p; j++)
8188 for (
int i = 0; i <=
p; i++)
8190 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j);
8194 for (
int o = 0, j = 0; j <=
p; j++)
8195 for (
int i = 0; i <=
p; i++)
8197 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j);
8201 for (
int o = 0, j = 0; j <=
p; j++)
8202 for (
int i = 0; i <=
p; i++)
8204 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j);
8208 for (
int o = 0, j = 0; j <=
p; j++)
8209 for (
int i = 0; i <=
p; i++)
8211 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j);
8223 #ifndef MFEM_THREAD_SAFE
8224 const int p1 = p + 1;
8238 for (
int k = 0; k <=
p; k++)
8239 for (
int j = 0; j <=
p; j++)
8240 for (
int i = 0; i <=
p; i++)
8249 const int p =
order;
8251 #ifdef MFEM_THREAD_SAFE
8252 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8259 for (
int o = 0, k = 0; k <=
p; k++)
8260 for (
int j = 0; j <=
p; j++)
8261 for (
int i = 0; i <=
p; i++)
8263 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
8270 const int p =
order;
8272 #ifdef MFEM_THREAD_SAFE
8273 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8274 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8281 for (
int o = 0, k = 0; k <=
p; k++)
8282 for (
int j = 0; j <=
p; j++)
8283 for (
int i = 0; i <=
p; i++)
8285 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
8286 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
8287 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
8294 const int p =
order;
8296 #ifdef MFEM_THREAD_SAFE
8297 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8298 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8299 Vector d2shape_x(p+1), d2shape_y(p+1), d2shape_z(p+1);
8306 for (
int o = 0, k = 0; k <=
p; k++)
8307 for (
int j = 0; j <=
p; j++)
8308 for (
int i = 0; i <=
p; i++)
8310 Hessian(
dof_map[o],0) = d2shape_x(i)* shape_y(j)* shape_z(k);
8311 Hessian(
dof_map[o],1) = dshape_x(i)* dshape_y(j)* shape_z(k);
8312 Hessian(
dof_map[o],2) = dshape_x(i)* shape_y(j)* dshape_z(k);
8313 Hessian(
dof_map[o],3) = shape_x(i)*d2shape_y(j)* shape_z(k);
8314 Hessian(
dof_map[o],4) = shape_x(i)* dshape_y(j)* dshape_z(k);
8315 Hessian(
dof_map[o],5) = shape_x(i)* shape_y(j)*d2shape_z(k);
8322 const int p =
order;
8325 #ifdef MFEM_THREAD_SAFE
8326 Vector shape_x(p+1), shape_y(p+1);
8329 for (
int i = 0; i <=
p; i++)
8338 for (
int o = 0, k = 0; k <=
p; k++)
8339 for (
int j = 0; j <=
p; j++)
8340 for (
int i = 0; i <=
p; i++)
8342 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_x(k);
8346 for (
int o = 0, k = 0; k <=
p; k++)
8347 for (
int j = 0; j <=
p; j++)
8348 for (
int i = 0; i <=
p; i++)
8350 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_x(k);
8354 for (
int o = 0, k = 0; k <=
p; k++)
8355 for (
int j = 0; j <=
p; j++)
8356 for (
int i = 0; i <=
p; i++)
8358 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_x(k);
8362 for (
int o = 0, k = 0; k <=
p; k++)
8363 for (
int j = 0; j <=
p; j++)
8364 for (
int i = 0; i <=
p; i++)
8366 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_x(k);
8370 for (
int o = 0, k = 0; k <=
p; k++)
8371 for (
int j = 0; j <=
p; j++)
8372 for (
int i = 0; i <=
p; i++)
8374 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_y(k);
8378 for (
int o = 0, k = 0; k <=
p; k++)
8379 for (
int j = 0; j <=
p; j++)
8380 for (
int i = 0; i <=
p; i++)
8382 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_y(k);
8386 for (
int o = 0, k = 0; k <=
p; k++)
8387 for (
int j = 0; j <=
p; j++)
8388 for (
int i = 0; i <=
p; i++)
8390 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_y(k);
8394 for (
int o = 0, k = 0; k <=
p; k++)
8395 for (
int j = 0; j <=
p; j++)
8396 for (
int i = 0; i <=
p; i++)
8398 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_y(k);
8408 #ifndef MFEM_THREAD_SAFE
8417 for (
int i = 1; i <
p; i++)
8426 const int p =
order;
8428 #ifdef MFEM_THREAD_SAFE
8435 shape(0) = shape_x(0);
8436 shape(1) = shape_x(p);
8437 for (
int i = 1; i <
p; i++)
8439 shape(i+1) = shape_x(i);
8446 const int p =
order;
8448 #ifdef MFEM_THREAD_SAFE
8449 Vector shape_x(p+1), dshape_x(p+1);
8455 dshape(0,0) = dshape_x(0);
8456 dshape(1,0) = dshape_x(p);
8457 for (
int i = 1; i <
p; i++)
8459 dshape(i+1,0) = dshape_x(i);
8473 #ifndef MFEM_THREAD_SAFE
8474 const int p1 = p + 1;
8483 for (
int j = 0; j <=
p; j++)
8484 for (
int i = 0; i <=
p; i++)
8493 const int p =
order;
8495 #ifdef MFEM_THREAD_SAFE
8496 Vector shape_x(p+1), shape_y(p+1);
8503 for (
int o = 0, j = 0; j <=
p; j++)
8504 for (
int i = 0; i <=
p; i++)
8506 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
8513 const int p =
order;
8515 #ifdef MFEM_THREAD_SAFE
8516 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
8523 for (
int o = 0, j = 0; j <=
p; j++)
8524 for (
int i = 0; i <=
p; i++)
8526 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
8527 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
8541 #ifndef MFEM_THREAD_SAFE
8542 const int p1 = p + 1;
8553 for (
int k = 0; k <=
p; k++)
8554 for (
int j = 0; j <=
p; j++)
8555 for (
int i = 0; i <=
p; i++)
8563 const int p =
order;
8565 #ifdef MFEM_THREAD_SAFE
8566 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8573 for (
int o = 0, k = 0; k <=
p; k++)
8574 for (
int j = 0; j <=
p; j++)
8575 for (
int i = 0; i <=
p; i++)
8577 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
8584 const int p =
order;
8586 #ifdef MFEM_THREAD_SAFE
8587 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8588 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8595 for (
int o = 0, k = 0; k <=
p; k++)
8596 for (
int j = 0; j <=
p; j++)
8597 for (
int i = 0; i <=
p; i++)
8599 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
8600 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
8601 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
8618 #ifndef MFEM_THREAD_SAFE
8632 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8636 auto idx = [p2p3](
int i,
int j) {
return ((p2p3-j)*j)/2+i; };
8649 for (
int i = 1; i <
p; i++)
8654 for (
int i = 1; i <
p; i++)
8659 for (
int i = 1; i <
p; i++)
8666 for (
int j = 1; j <
p; j++)
8667 for (
int i = 1; i + j <
p; i++)
8669 const double w = cp[i] + cp[j] + cp[p-i-j];
8675 for (
int k = 0; k <
dof; k++)
8683 for (
int j = 0; j <=
p; j++)
8684 for (
int i = 0; i + j <=
p; i++)
8686 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8697 const int p =
order;
8699 #ifdef MFEM_THREAD_SAFE
8700 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
dof);
8707 for (
int o = 0, j = 0; j <=
p; j++)
8708 for (
int i = 0; i + j <=
p; i++)
8710 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8719 const int p =
order;
8721 #ifdef MFEM_THREAD_SAFE
8722 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8723 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8731 for (
int o = 0, j = 0; j <=
p; j++)
8732 for (
int i = 0; i + j <=
p; i++)
8735 du(o,0) = ((dshape_x(i)* shape_l(k)) -
8736 ( shape_x(i)*dshape_l(k)))*shape_y(j);
8737 du(o,1) = ((dshape_y(j)* shape_l(k)) -
8738 ( shape_y(j)*dshape_l(k)))*shape_x(i);
8742 Ti.
Mult(du, dshape);
8748 const int p =
order;
8749 #ifdef MFEM_THREAD_SAFE
8750 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8751 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8752 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_l(p + 1);
8760 for (
int o = 0, j = 0; j <=
p; j++)
8761 for (
int i = 0; i + j <=
p; i++)
8765 ddu(o,0) = ((ddshape_x(i) * shape_l(k)) - 2. * (dshape_x(i) * dshape_l(k)) +
8766 (shape_x(i) * ddshape_l(k))) * shape_y(j);
8767 ddu(o,1) = (((shape_x(i) * ddshape_l(k)) - dshape_x(i) * dshape_l(k)) * shape_y(
8768 j)) + (((dshape_x(i) * shape_l(k)) - (shape_x(i) * dshape_l(k))) * dshape_y(j));
8769 ddu(o,2) = ((ddshape_y(j) * shape_l(k)) - 2. * (dshape_y(j) * dshape_l(k)) +
8770 (shape_y(j) * ddshape_l(k))) * shape_x(i);
8774 Ti.
Mult(ddu, ddshape);
8784 #ifndef MFEM_THREAD_SAFE
8801 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8804 auto tri = [](
int k) {
return (k*(k + 1))/2; };
8805 auto tet = [](
int k) {
return (k*(k + 1)*(k + 2))/6; };
8806 int ndof = tet(p+1);
8807 auto idx = [tri, tet,
p, ndof](
int i,
int j,
int k)
8809 return ndof - tet(p - k) - tri(p + 1 - k - j) + i;
8826 for (
int i = 1; i <
p; i++)
8831 for (
int i = 1; i <
p; i++)
8836 for (
int i = 1; i <
p; i++)
8841 for (
int i = 1; i <
p; i++)
8846 for (
int i = 1; i <
p; i++)
8851 for (
int i = 1; i <
p; i++)
8858 for (
int j = 1; j <
p; j++)
8859 for (
int i = 1; i + j <
p; i++)
8862 double w = cp[i] + cp[j] + cp[p-i-j];
8865 for (
int j = 1; j <
p; j++)
8866 for (
int i = 1; i + j <
p; i++)
8869 double w = cp[i] + cp[j] + cp[p-i-j];
8872 for (
int j = 1; j <
p; j++)
8873 for (
int i = 1; i + j <
p; i++)
8876 double w = cp[i] + cp[j] + cp[p-i-j];
8879 for (
int j = 1; j <
p; j++)
8880 for (
int i = 1; i + j <
p; i++)
8883 double w = cp[i] + cp[j] + cp[p-i-j];
8888 for (
int k = 1; k <
p; k++)
8889 for (
int j = 1; j + k <
p; j++)
8890 for (
int i = 1; i + j + k <
p; i++)
8893 double w = cp[i] + cp[j] + cp[k] + cp[p-i-j-k];
8898 for (
int m = 0; m <
dof; m++)
8907 for (
int k = 0; k <=
p; k++)
8908 for (
int j = 0; j + k <=
p; j++)
8909 for (
int i = 0; i + j + k <=
p; i++)
8911 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8922 const int p =
order;
8924 #ifdef MFEM_THREAD_SAFE
8925 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8934 for (
int o = 0, k = 0; k <=
p; k++)
8935 for (
int j = 0; j + k <=
p; j++)
8936 for (
int i = 0; i + j + k <=
p; i++)
8938 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8947 const int p =
order;
8949 #ifdef MFEM_THREAD_SAFE
8950 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8951 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8960 for (
int o = 0, k = 0; k <=
p; k++)
8961 for (
int j = 0; j + k <=
p; j++)
8962 for (
int i = 0; i + j + k <=
p; i++)
8964 int l = p - i - j - k;
8965 du(o,0) = ((dshape_x(i)* shape_l(l)) -
8966 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
8967 du(o,1) = ((dshape_y(j)* shape_l(l)) -
8968 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
8969 du(o,2) = ((dshape_z(k)* shape_l(l)) -
8970 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
8974 Ti.
Mult(du, dshape);
8980 const int p =
order;
8982 #ifdef MFEM_THREAD_SAFE
8983 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8984 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8985 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_z(p + 1), ddshape_l(p + 1);
8994 for (
int o = 0, k = 0; k <=
p; k++)
8995 for (
int j = 0; j + k <=
p; j++)
8996 for (
int i = 0; i + j + k <=
p; i++)
8999 int l = p - i - j - k;
9000 ddu(o,0) = ((ddshape_x(i) * shape_l(l)) - 2. * (dshape_x(i) * dshape_l(l)) +
9001 (shape_x(i) * ddshape_l(l))) * shape_y(j) * shape_z(k);
9002 ddu(o,1) = ((dshape_y(j) * ((dshape_x(i) * shape_l(l)) -
9003 (shape_x(i) * dshape_l(l)))) +
9004 (shape_y(j) * ((ddshape_l(l) * shape_x(i)) -
9005 (dshape_x(i) * dshape_l(l)))))* shape_z(k);
9006 ddu(o,2) = ((dshape_z(k) * ((dshape_x(i) * shape_l(l)) -
9007 (shape_x(i) * dshape_l(l)))) +
9008 (shape_z(k) * ((ddshape_l(l) * shape_x(i)) -
9009 (dshape_x(i) * dshape_l(l)))))* shape_y(j);
9010 ddu(o,3) = ((ddshape_y(j) * shape_l(l)) - 2. * (dshape_y(j) * dshape_l(l)) +
9011 (shape_y(j) * ddshape_l(l))) * shape_x(i) * shape_z(k);
9012 ddu(o,4) = ((dshape_z(k) * ((dshape_y(j) * shape_l(l)) -
9013 (shape_y(j)*dshape_l(l))) ) +
9014 (shape_z(k)* ((ddshape_l(l)*shape_y(j)) -
9015 (dshape_y(j) * dshape_l(l)) ) ) )* shape_x(i);
9016 ddu(o,5) = ((ddshape_z(k) * shape_l(l)) - 2. * (dshape_z(k) * dshape_l(l)) +
9017 (shape_z(k) * ddshape_l(l))) * shape_y(j) * shape_x(i);
9020 Ti.
Mult(ddu, ddshape);
9027 #ifndef MFEM_THREAD_SAFE
9037 Index(
int p) { p2p3 = 2*p + 3; }
9038 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
9052 for (
int i = 1; i <
p; i++)
9057 for (
int i = 1; i <
p; i++)
9062 for (
int i = 1; i <
p; i++)
9069 for (
int j = 1; j <
p; j++)
9070 for (
int i = 1; i + j <
p; i++)
9079 const int p,
const double l1,
const double l2,
double *shape)
9081 const double l3 = 1. - l1 - l2;
9091 for (
int o = 0, j = 0; j <=
p; j++)
9095 for (
int i = 0; i <= p - j; i++)
9105 const int p,
const double l1,
const double l2,
9106 double *dshape_1d,
double *dshape)
9108 const int dof = ((p + 1)*(p + 2))/2;
9109 const double l3 = 1. - l1 - l2;
9113 for (
int o = 0, j = 0; j <=
p; j++)
9117 for (
int i = 0; i <= p - j; i++)
9119 dshape[o++] = s*dshape_1d[i];
9124 for (
int i = 0; i <=
p; i++)
9128 for (
int o = i, j = 0; j <= p - i; j++)
9130 dshape[dof + o] = s*dshape_1d[j];
9140 #ifdef MFEM_THREAD_SAFE
9144 for (
int i = 0; i <
dof; i++)
9153 #ifdef MFEM_THREAD_SAFE
9158 for (
int d = 0; d < 2; d++)
9160 for (
int i = 0; i <
dof; i++)
9172 #ifndef MFEM_THREAD_SAFE
9182 int tri(
int k) {
return (k*(k + 1))/2; }
9183 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
9184 Index(
int p_) { p = p_;
dof = tet(p + 1); }
9185 int operator()(
int i,
int j,
int k)
9186 {
return dof - tet(p - k) - tri(p + 1 - k - j) + i; }
9202 for (
int i = 1; i <
p; i++)
9207 for (
int i = 1; i <
p; i++)
9212 for (
int i = 1; i <
p; i++)
9217 for (
int i = 1; i <
p; i++)
9222 for (
int i = 1; i <
p; i++)
9227 for (
int i = 1; i <
p; i++)
9234 for (
int j = 1; j <
p; j++)
9235 for (
int i = 1; i + j <
p; i++)
9240 for (
int j = 1; j <
p; j++)
9241 for (
int i = 1; i + j <
p; i++)
9246 for (
int j = 1; j <
p; j++)
9247 for (
int i = 1; i + j <
p; i++)
9252 for (
int j = 1; j <
p; j++)
9253 for (
int i = 1; i + j <
p; i++)
9260 for (
int k = 1; k <
p; k++)
9261 for (
int j = 1; j + k <
p; j++)
9262 for (
int i = 1; i + j + k <
p; i++)
9271 const int p,
const double l1,
const double l2,
const double l3,
9274 const double l4 = 1. - l1 - l2 - l3;
9283 for (
int o = 0, k = 0; k <=
p; k++)
9286 const double ek = bp[k]*l3k;
9288 for (
int j = 0; j <= p - k; j++)
9291 double ekj = ek*bpk[j]*l2j;
9292 for (
int i = 0; i <= p - k - j; i++)
9304 const int p,
const double l1,
const double l2,
const double l3,
9305 double *dshape_1d,
double *dshape)
9307 const int dof = ((p + 1)*(p + 2)*(p + 3))/6;
9308 const double l4 = 1. - l1 - l2 - l3;
9316 for (
int o = 0, k = 0; k <=
p; k++)
9319 const double ek = bp[k]*l3k;
9321 for (
int j = 0; j <= p - k; j++)
9324 double ekj = ek*bpk[j]*l2j;
9325 for (
int i = 0; i <= p - k - j; i++)
9327 dshape[o++] = dshape_1d[i]*ekj;
9338 for (
int ok = 0, k = 0; k <=
p; k++)
9341 const double ek = bp[k]*l3k;
9343 for (
int i = 0; i <= p - k; i++)
9346 double eki = ek*bpk[i]*l1i;
9348 for (
int j = 0; j <= p - k - i; j++)
9350 dshape[dof + o] = dshape_1d[j]*eki;
9356 ok += ((p - k + 2)*(p - k + 1))/2;
9363 for (
int j = 0; j <=
p; j++)
9366 const double ej = bp[j]*l2j;
9368 for (
int i = 0; i <= p - j; i++)
9371 double eji = ej*bpj[i]*l1i;
9372 int m = ((p + 2)*(p + 1))/2;
9373 int n = ((p - j + 2)*(p - j + 1))/2;
9374 for (
int o = i, k = 0; k <= p - j - i; k++)
9379 dshape[2*dof + o - n] = dshape_1d[k]*eji;
9392 #ifdef MFEM_THREAD_SAFE
9396 for (
int i = 0; i <
dof; i++)
9405 #ifdef MFEM_THREAD_SAFE
9410 for (
int d = 0; d < 3; d++)
9412 for (
int i = 0; i <
dof; i++)
9427 #ifndef MFEM_THREAD_SAFE
9437 int p2p3 = 2*p + 3, ntri = ((p + 1)*(p + 2))/2;
9438 auto idx = [p2p3,ntri](
int i,
int j,
int k)
9440 return k*ntri + ((p2p3-j)*j)/2+i;
9453 t_dof[0] = 0; s_dof[0] = 0;
9454 t_dof[1] = 1; s_dof[1] = 0;
9455 t_dof[2] = 2; s_dof[2] = 0;
9456 t_dof[3] = 0; s_dof[3] = 1;
9457 t_dof[4] = 1; s_dof[4] = 1;
9458 t_dof[5] = 2; s_dof[5] = 1;
9463 for (
int i=1; i<
p; i++)
9474 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 0 * ne + i] = 0;
9475 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 1 * ne + i] = 0;
9476 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 2 * ne + i] = 0;
9477 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 3 * ne + i] = 1;
9478 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 4 * ne + i] = 1;
9479 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 5 * ne + i] = 1;
9480 t_dof[5 + 6 * ne + i] = 0; s_dof[5 + 6 * ne + i] = i + 1;
9481 t_dof[5 + 7 * ne + i] = 1; s_dof[5 + 7 * ne + i] = i + 1;
9482 t_dof[5 + 8 * ne + i] = 2; s_dof[5 + 8 * ne + i] = i + 1;
9489 int nt = (p-1)*(p-2)/2;
9490 for (
int j=1; j<
p; j++)
9492 for (
int i=1; i<p-j; i++)
9494 int l = j - p + (((2 * p - 1) - i) * i) / 2;
9496 lex_ordering[idx(i,j,p)] = o+nt+k;
9497 t_dof[6 + 9 * ne + k] = 3 * p + l; s_dof[6 + 9 * ne + k] = 0;
9498 t_dof[6 + 9 * ne + nt + k] = 3 * p + k; s_dof[6 + 9 * ne + nt + k] = 1;
9506 int nq = (p-1)*(p-1);
9507 for (
int j=1; j<
p; j++)
9509 for (
int i=1; i<
p; i++)
9515 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
9516 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
9517 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
9519 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
9520 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
9521 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
9530 for (
int k=1; k<
p; k++)
9533 for (
int j=1; j<
p; j++)
9535 for (
int i=1; i+j<
p; i++)
9538 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
9539 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9548 for (
int i=0; i<
dof; i++)
9559 #ifdef MFEM_THREAD_SAFE
9569 for (
int i=0; i<
dof; i++)
9571 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
9578 #ifdef MFEM_THREAD_SAFE
9592 for (
int i=0; i<
dof; i++)
9594 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
9595 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
9596 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
9607 #ifndef MFEM_THREAD_SAFE
9627 for (
int i=1; i<
p; i++)
9629 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
9630 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
9631 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
9632 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
9633 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
9634 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
9635 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
9636 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
9637 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
9642 int nt = (p-1)*(p-2)/2;
9643 for (
int j=1; j<
p; j++)
9645 for (
int i=1; i<j; i++)
9647 t_dof[6 + 9 * ne + k] = 3 * p + k;
s_dof[6 + 9 * ne + k] = 0;
9648 t_dof[6 + 9 * ne + nt + k] = 3 * p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
9655 int nq = (p-1)*(p-1);
9656 for (
int j=1; j<
p; j++)
9658 for (
int i=1; i<
p; i++)
9660 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
9661 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
9662 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
9664 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
9665 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
9666 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
9674 for (
int k=1; k<
p; k++)
9677 for (
int j=1; j<
p; j++)
9679 for (
int i=1; i<j; i++)
9681 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
9682 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9691 for (
int i=0; i<
dof; i++)
9702 #ifdef MFEM_THREAD_SAFE
9712 for (
int i=0; i<
dof; i++)
9721 #ifdef MFEM_THREAD_SAFE
9735 for (
int i=0; i<
dof; i++)
9749 #ifndef MFEM_THREAD_SAFE
9754 for (
int i = 0; i <=
p; i++)
9769 #ifdef MFEM_THREAD_SAFE
9779 const int p =
order;
9785 for (
int i = 0; i <=
p; i++)
9792 for (
int i = 0; i <=
p; i++)
9804 #ifndef MFEM_THREAD_SAFE
9815 for (
int i = 0; i <=
p; i++)
9831 #ifdef MFEM_THREAD_SAFE
9842 dofs[vertex*
order] = 1.0;
9851 #ifndef MFEM_THREAD_SAFE
9858 for (
int o = 0, j = 0; j <=
p; j++)
9859 for (
int i = 0; i <=
p; i++)
9868 const int p =
order;
9870 #ifdef MFEM_THREAD_SAFE
9871 Vector shape_x(p+1), shape_y(p+1);
9877 for (
int o = 0, j = 0; j <=
p; j++)
9878 for (
int i = 0; i <=
p; i++)
9880 shape(o++) = shape_x(i)*shape_y(j);
9887 const int p =
order;
9889 #ifdef MFEM_THREAD_SAFE
9890 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9896 for (
int o = 0, j = 0; j <=
p; j++)
9897 for (
int i = 0; i <=
p; i++)
9899 dshape(o,0) = dshape_x(i)* shape_y(j);
9900 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9906 const int p =
order;
9909 #ifdef MFEM_THREAD_SAFE
9910 Vector shape_x(p+1), shape_y(p+1);
9913 for (
int i = 0; i <=
p; i++)
9922 for (
int o = 0, j = 0; j <=
p; j++)
9923 for (
int i = 0; i <=
p; i++)
9925 dofs[o++] = shape_x(i)*shape_x(j);
9929 for (
int o = 0, j = 0; j <=
p; j++)
9930 for (
int i = 0; i <=
p; i++)
9932 dofs[o++] = shape_y(i)*shape_x(j);
9936 for (
int o = 0, j = 0; j <=
p; j++)
9937 for (
int i = 0; i <=
p; i++)
9939 dofs[o++] = shape_y(i)*shape_y(j);
9943 for (
int o = 0, j = 0; j <=
p; j++)
9944 for (
int i = 0; i <=
p; i++)
9946 dofs[o++] = shape_x(i)*shape_y(j);
9956 #ifndef MFEM_THREAD_SAFE
9969 for (
int o = 0, j = 0; j <=
p; j++)
9970 for (
int i = 0; i <=
p; i++)
9980 const int p =
order;
9982 #ifdef MFEM_THREAD_SAFE
9983 Vector shape_x(p+1), shape_y(p+1);
9989 for (
int o = 0, j = 0; j <=
p; j++)
9990 for (
int i = 0; i <=
p; i++)
9992 shape(o++) = shape_x(i)*shape_y(j);
9999 const int p =
order;
10001 #ifdef MFEM_THREAD_SAFE
10002 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
10008 for (
int o = 0, j = 0; j <=
p; j++)
10009 for (
int i = 0; i <=
p; i++)
10011 dshape(o,0) = dshape_x(i)* shape_y(j);
10012 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
10018 const int p =
order;
10023 case 0: dofs[0] = 1.0;
break;
10024 case 1: dofs[
p] = 1.0;
break;
10025 case 2: dofs[p*(p + 2)] = 1.0;
break;
10026 case 3: dofs[p*(p + 1)] = 1.0;
break;
10036 #ifndef MFEM_THREAD_SAFE
10045 for (
int o = 0, k = 0; k <=
p; k++)
10046 for (
int j = 0; j <=
p; j++)
10047 for (
int i = 0; i <=
p; i++)
10056 const int p =
order;
10058 #ifdef MFEM_THREAD_SAFE
10059 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
10066 for (
int o = 0, k = 0; k <=
p; k++)
10067 for (
int j = 0; j <=
p; j++)
10068 for (
int i = 0; i <=
p; i++)
10070 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
10077 const int p =
order;
10079 #ifdef MFEM_THREAD_SAFE
10080 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
10081 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
10088 for (
int o = 0, k = 0; k <=
p; k++)
10089 for (
int j = 0; j <=
p; j++)
10090 for (
int i = 0; i <=
p; i++)
10092 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
10093 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
10094 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
10100 const int p =
order;
10103 #ifdef MFEM_THREAD_SAFE
10104 Vector shape_x(p+1), shape_y(p+1);
10107 for (
int i = 0; i <=
p; i++)
10116 for (
int o = 0, k = 0; k <=
p; k++)
10117 for (
int j = 0; j <=
p; j++)
10118 for (
int i = 0; i <=
p; i++)
10120 dofs[o++] = shape_x(i)*shape_x(j)*shape_x(k);
10124 for (
int o = 0, k = 0; k <=
p; k++)
10125 for (
int j = 0; j <=
p; j++)
10126 for (
int i = 0; i <=
p; i++)
10128 dofs[o++] = shape_y(i)*shape_x(j)*shape_x(k);
10132 for (
int o = 0, k = 0; k <=
p; k++)
10133 for (
int j = 0; j <=
p; j++)
10134 for (
int i = 0; i <=
p; i++)
10136 dofs[o++] = shape_y(i)*shape_y(j)*shape_x(k);
10140 for (
int o = 0, k = 0; k <=
p; k++)
10141 for (
int j = 0; j <=
p; j++)
10142 for (
int i = 0; i <=
p; i++)
10144 dofs[o++] = shape_x(i)*shape_y(j)*shape_x(k);
10148 for (
int o = 0, k = 0; k <=
p; k++)
10149 for (
int j = 0; j <=
p; j++)
10150 for (
int i = 0; i <=
p; i++)
10152 dofs[o++] = shape_x(i)*shape_x(j)*shape_y(k);
10156 for (
int o = 0, k = 0; k <=
p; k++)
10157 for (
int j = 0; j <=
p; j++)
10158 for (
int i = 0; i <=
p; i++)
10160 dofs[o++] = shape_y(i)*shape_x(j)*shape_y(k);
10164 for (
int o = 0, k = 0; k <=
p; k++)
10165 for (
int j = 0; j <=
p; j++)
10166 for (
int i = 0; i <=
p; i++)
10168 dofs[o++] = shape_y(i)*shape_y(j)*shape_y(k);
10172 for (
int o = 0, k = 0; k <=
p; k++)
10173 for (
int j = 0; j <=
p; j++)
10174 for (
int i = 0; i <=
p; i++)
10176 dofs[o++] = shape_x(i)*shape_y(j)*shape_y(k);
10186 #ifndef MFEM_THREAD_SAFE
10201 for (
int o = 0, k = 0; k <=
p; k++)
10202 for (
int j = 0; j <=
p; j++)
10203 for (
int i = 0; i <=
p; i++)
10213 const int p =
order;
10215 #ifdef MFEM_THREAD_SAFE
10216 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
10223 for (
int o = 0, k = 0; k <=
p; k++)
10224 for (
int j = 0; j <=
p; j++)
10225 for (
int i = 0; i <=
p; i++)
10227 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
10234 const int p =
order;
10236 #ifdef MFEM_THREAD_SAFE
10237 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
10238 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
10245 for (
int o = 0, k = 0; k <=
p; k++)
10246 for (
int j = 0; j <=
p; j++)
10247 for (
int i = 0; i <=
p; i++)
10249 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
10250 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
10251 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
10257 const int p =
order;
10262 case 0: dofs[0] = 1.0;
break;
10263 case 1: dofs[
p] = 1.0;
break;
10264 case 2: dofs[p*(p + 2)] = 1.0;
break;
10265 case 3: dofs[p*(p + 1)] = 1.0;
break;
10266 case 4: dofs[p*(p + 1)*(p + 1)] = 1.0;
break;
10267 case 5: dofs[p + p*(p + 1)*(p + 1)] = 1.0;
break;
10268 case 6: dofs[
dof - 1] = 1.0;
break;
10269 case 7: dofs[
dof - p - 1] = 1.0;
break;
10280 #ifndef MFEM_THREAD_SAFE
10290 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10293 for (
int o = 0, j = 0; j <=
p; j++)
10294 for (
int i = 0; i + j <=
p; i++)
10296 double w = op[i] + op[j] + op[p-i-j];
10301 for (
int k = 0; k <
dof; k++)
10308 for (
int o = 0, j = 0; j <=
p; j++)
10309 for (
int i = 0; i + j <=
p; i++)
10311 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10322 const int p =
order;
10324 #ifdef MFEM_THREAD_SAFE
10325 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
dof);
10332 for (
int o = 0, j = 0; j <=
p; j++)
10333 for (
int i = 0; i + j <=
p; i++)
10335 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10344 const int p =
order;
10346 #ifdef MFEM_THREAD_SAFE
10347 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10348 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
10356 for (
int o = 0, j = 0; j <=
p; j++)
10357 for (
int i = 0; i + j <=
p; i++)
10360 du(o,0) = ((dshape_x(i)* shape_l(k)) -
10361 ( shape_x(i)*dshape_l(k)))*shape_y(j);
10362 du(o,1) = ((dshape_y(j)* shape_l(k)) -
10363 ( shape_y(j)*dshape_l(k)))*shape_x(i);
10367 Ti.
Mult(du, dshape);
10375 for (
int i = 0; i <
dof; i++)
10378 dofs[i] = pow(1.0 - ip.
x - ip.
y,
order);
10382 for (
int i = 0; i <
dof; i++)
10385 dofs[i] = pow(ip.
x,
order);
10389 for (
int i = 0; i <
dof; i++)
10392 dofs[i] = pow(ip.
y,
order);
10403 #ifndef MFEM_THREAD_SAFE
10413 for (
int o = 0, j = 0; j <=
p; j++)
10414 for (
int i = 0; i + j <=
p; i++)
10430 #ifdef MFEM_THREAD_SAFE
10443 case 0: dofs[0] = 1.0;
break;
10444 case 1: dofs[
order] = 1.0;
break;
10445 case 2: dofs[
dof-1] = 1.0;
break;
10456 #ifndef MFEM_THREAD_SAFE
10468 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10471 for (
int o = 0, k = 0; k <=
p; k++)
10472 for (
int j = 0; j + k <=
p; j++)
10473 for (
int i = 0; i + j + k <=
p; i++)
10475 double w = op[i] + op[j] + op[k] + op[p-i-j-k];
10480 for (
int m = 0; m <
dof; m++)
10488 for (
int o = 0, k = 0; k <=
p; k++)
10489 for (
int j = 0; j + k <=
p; j++)
10490 for (
int i = 0; i + j + k <=
p; i++)
10492 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10503 const int p =
order;
10505 #ifdef MFEM_THREAD_SAFE
10506 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10515 for (
int o = 0, k = 0; k <=
p; k++)
10516 for (
int j = 0; j + k <=
p; j++)
10517 for (
int i = 0; i + j + k <=
p; i++)
10519 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10528 const int p =
order;
10530 #ifdef MFEM_THREAD_SAFE
10531 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10532 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
10541 for (
int o = 0, k = 0; k <=
p; k++)
10542 for (
int j = 0; j + k <=
p; j++)
10543 for (
int i = 0; i + j + k <=
p; i++)
10545 int l = p - i - j - k;
10546 du(o,0) = ((dshape_x(i)* shape_l(l)) -
10547 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
10548 du(o,1) = ((dshape_y(j)* shape_l(l)) -
10549 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
10550 du(o,2) = ((dshape_z(k)* shape_l(l)) -
10551 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
10555 Ti.
Mult(du, dshape);
10563 for (
int i = 0; i <
dof; i++)
10566 dofs[i] = pow(1.0 - ip.
x - ip.
y - ip.
z,
order);
10570 for (
int i = 0; i <
dof; i++)
10573 dofs[i] = pow(ip.
x,
order);
10577 for (
int i = 0; i <
dof; i++)
10580 dofs[i] = pow(ip.
y,
order);
10584 for (
int i = 0; i <
dof; i++)
10587 dofs[i] = pow(ip.
z,
order);
10598 #ifndef MFEM_THREAD_SAFE
10608 for (
int o = 0, k = 0; k <=
p; k++)
10609 for (
int j = 0; j + k <=
p; j++)
10610 for (
int i = 0; i + j + k <=
p; i++)
10627 #ifdef MFEM_THREAD_SAFE
10640 case 0: dofs[0] = 1.0;
break;
10641 case 1: dofs[
order] = 1.0;
break;
10642 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
10643 case 3: dofs[
dof-1] = 1.0;
break;
10654 #ifndef MFEM_THREAD_SAFE
10666 for (
int k=0; k<=
p; k++)
10669 for (
int j=0; j<=
p; j++)
10671 for (
int i=0; i<=j; i++)
10683 for (
int i=0; i<
dof; i++)
10694 #ifdef MFEM_THREAD_SAFE
10704 for (
int i=0; i<
dof; i++)
10706 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
10713 #ifdef MFEM_THREAD_SAFE
10727 for (
int i=0; i<
dof; i++)
10729 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
10730 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
10731 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
10742 #ifndef MFEM_THREAD_SAFE
10754 for (
int k=0; k<=
p; k++)
10757 for (
int j=0; j<=
p; j++)
10759 for (
int i=0; i<=j; i++)
10771 for (
int i=0; i<
dof; i++)
10782 #ifdef MFEM_THREAD_SAFE
10792 for (
int i=0; i<
dof; i++)
10801 #ifdef MFEM_THREAD_SAFE
10815 for (
int i=0; i<
dof; i++)
10824 const double RT_QuadrilateralElement::nk[8] =
10825 { 0., -1., 1., 0., 0., 1., -1., 0. };
10833 cp(
poly1d.ClosedPoints(p + 1, cb_type))
10840 const int dof2 =
dof/2;
10842 #ifndef MFEM_THREAD_SAFE
10853 for (
int i = 0; i <=
p; i++)
10855 dof_map[1*dof2 + i + 0*(p + 1)] = o++;
10857 for (
int i = 0; i <=
p; i++)
10859 dof_map[0*dof2 + (p + 1) + i*(p + 2)] = o++;
10861 for (
int i = 0; i <=
p; i++)
10863 dof_map[1*dof2 + (p - i) + (p + 1)*(p + 1)] = o++;
10865 for (
int i = 0; i <=
p; i++)
10867 dof_map[0*dof2 + 0 + (p - i)*(p + 2)] = o++;
10871 for (
int j = 0; j <=
p; j++)
10872 for (
int i = 1; i <=
p; i++)
10874 dof_map[0*dof2 + i + j*(p + 2)] = o++;
10876 for (
int j = 1; j <=
p; j++)
10877 for (
int i = 0; i <=
p; i++)
10879 dof_map[1*dof2 + i + j*(p + 1)] = o++;
10884 for (
int j = 0; j <=
p; j++)
10885 for (
int i = 0; i <= p/2; i++)
10887 int idx = 0*dof2 + i + j*(p + 2);
10888 dof_map[idx] = -1 - dof_map[idx];
10891 for (
int j = p/2 + 1; j <=
p; j++)
10893 int idx = 0*dof2 + (p/2 + 1) + j*(p + 2);
10897 for (
int j = 0; j <= p/2; j++)
10898 for (
int i = 0; i <=
p; i++)
10900 int idx = 1*dof2 + i + j*(p + 1);
10901 dof_map[idx] = -1 - dof_map[idx];
10904 for (
int i = 0; i <= p/2; i++)
10906 int idx = 1*dof2 + i + (p/2 + 1)*(p + 1);
10911 for (
int j = 0; j <=
p; j++)
10912 for (
int i = 0; i <= p + 1; i++)
10915 if ((idx =
dof_map[o++]) < 0)
10926 for (
int j = 0; j <= p + 1; j++)
10927 for (
int i = 0; i <=
p; i++)
10930 if ((idx =
dof_map[o++]) < 0)
10946 const int pp1 =
order;
10948 #ifdef MFEM_THREAD_SAFE
10949 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10968 for (
int j = 0; j < pp1; j++)
10969 for (
int i = 0; i <= pp1; i++)
10972 if ((idx =
dof_map[o++]) < 0)
10974 idx = -1 - idx, s = -1;
10980 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
10983 for (
int j = 0; j <= pp1; j++)
10984 for (
int i = 0; i < pp1; i++)
10987 if ((idx =
dof_map[o++]) < 0)
10989 idx = -1 - idx, s = -1;
10996 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
11003 const int pp1 =
order;
11005 #ifdef MFEM_THREAD_SAFE
11006 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
11007 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
11024 for (
int j = 0; j < pp1; j++)
11025 for (
int i = 0; i <= pp1; i++)
11028 if ((idx =
dof_map[o++]) < 0)
11030 idx = -1 - idx, s = -1;
11036 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
11038 for (
int j = 0; j <= pp1; j++)
11039 for (
int i = 0; i < pp1; i++)
11042 if ((idx =
dof_map[o++]) < 0)
11044 idx = -1 - idx, s = -1;
11050 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
11068 for (
int c = 0; c < 2; c++)
11072 for (
int j = 0; j < jm; j++)
11073 for (
int i = 0; i < im; i++)
11076 if (idx < 0) { idx = -1 - idx; }
11077 int ic = (c == 0) ? j : i;
11078 const double h = cp[ic+1] - cp[ic];
11080 for (
int k = 0; k < nqpt; k++)
11083 if (c == 0) { ip2d.
Set2(cp[i], cp[j] + (h*ip1d.
x)); }
11084 else { ip2d.
Set2(cp[i] + (h*ip1d.
x), cp[j]); }
11086 vc.
Eval(xk, Trans, ip2d);
11089 nk + dof2nk[idx]*
dim);
11090 val += ip1d.
weight*ipval;
11098 const double RT_HexahedronElement::nk[18] =
11099 { 0.,0.,-1., 0.,-1.,0., 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,0.,1. };
11107 cp(
poly1d.ClosedPoints(p + 1, cb_type))
11114 const int dof3 =
dof/3;
11116 #ifndef MFEM_THREAD_SAFE
11130 for (
int j = 0; j <=
p; j++)
11131 for (
int i = 0; i <=
p; i++)
11133 dof_map[2*dof3 + i + ((p - j) + 0*(p + 1))*(p + 1)] = o++;
11135 for (
int j = 0; j <=
p; j++)
11136 for (
int i = 0; i <=
p; i++)
11138 dof_map[1*dof3 + i + (0 + j*(p + 2))*(p + 1)] = o++;
11140 for (
int j = 0; j <=
p; j++)
11141 for (
int i = 0; i <=
p; i++)
11143 dof_map[0*dof3 + (p + 1) + (i + j*(p + 1))*(p + 2)] = o++;
11145 for (
int j = 0; j <=
p; j++)
11146 for (
int i = 0; i <=
p; i++)
11148 dof_map[1*dof3 + (p - i) + ((p + 1) + j*(p + 2))*(p + 1)] = o++;
11150 for (
int j = 0; j <=
p; j++)
11151 for (
int i = 0; i <=
p; i++)
11153 dof_map[0*dof3 + 0 + ((p - i) + j*(p + 1))*(p + 2)] = o++;
11155 for (
int j = 0; j <=
p; j++)
11156 for (
int i = 0; i <=
p; i++)
11158 dof_map[2*dof3 + i + (j + (p + 1)*(p + 1))*(p + 1)] = o++;
11163 for (
int k = 0; k <=
p; k++)
11164 for (
int j = 0; j <=
p; j++)
11165 for (
int i = 1; i <=
p; i++)
11167 dof_map[0*dof3 + i + (j + k*(p + 1))*(p + 2)] = o++;
11170 for (
int k = 0; k <=
p; k++)
11171 for (
int j = 1; j <=
p; j++)
11172 for (
int i = 0; i <=
p; i++)
11174 dof_map[1*dof3 + i + (j + k*(p + 2))*(p + 1)] = o++;
11177 for (
int k = 1; k <=
p; k++)
11178 for (
int j = 0; j <=
p; j++)
11179 for (
int i = 0; i <=
p; i++)
11181 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
11189 for (
int k = 0; k <=
p; k++)
11190 for (
int j = 0; j <=
p; j++)
11191 for (
int i = 0; i <= p/2; i++)
11193 int idx = 0*dof3 + i + (j + k*(p + 1))*(p + 2);
11194 dof_map[idx] = -1 - dof_map[idx];
11197 for (
int k = 0; k <=
p; k++)
11198 for (
int j = 0; j <= p/2; j++)
11199 for (
int i = 0; i <=
p; i++)
11201 int idx = 1*dof3 + i + (j + k*(p + 2))*(p + 1);
11202 dof_map[idx] = -1 - dof_map[idx];
11205 for (
int k = 0; k <= p/2; k++)
11206 for (
int j = 0; j <=
p; j++)
11207 for (
int i = 0; i <=
p; i++)
11209 int idx = 2*dof3 + i + (j + k*(p + 1))*(p + 1);
11210 dof_map[idx] = -1 - dof_map[idx];
11215 for (
int k = 0; k <=
p; k++)
11216 for (
int j = 0; j <=
p; j++)
11217 for (
int i = 0; i <= p + 1; i++)
11220 if ((idx =
dof_map[o++]) < 0)
11232 for (
int k = 0; k <=
p; k++)
11233 for (
int j = 0; j <= p + 1; j++)
11234 for (
int i = 0; i <=
p; i++)
11237 if ((idx =
dof_map[o++]) < 0)
11249 for (
int k = 0; k <= p + 1; k++)
11250 for (
int j = 0; j <=
p; j++)
11251 for (
int i = 0; i <=
p; i++)
11254 if ((idx =
dof_map[o++]) < 0)
11270 const int pp1 =
order;
11272 #ifdef MFEM_THREAD_SAFE
11273 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
11274 Vector shape_cz(pp1 + 1), shape_oz(pp1);
11298 for (
int k = 0; k < pp1; k++)
11299 for (
int j = 0; j < pp1; j++)
11300 for (
int i = 0; i <= pp1; i++)
11303 if ((idx =
dof_map[o++]) < 0)
11305 idx = -1 - idx, s = -1;
11311 shape(idx,0) = s*shape_cx(i)*shape_oy(j)*shape_oz(k);
11316 for (
int k = 0; k < pp1; k++)
11317 for (
int j = 0; j <= pp1; j++)
11318 for (
int i = 0; i < pp1; i++)
11321 if ((idx =
dof_map[o++]) < 0)
11323 idx = -1 - idx, s = -1;
11330 shape(idx,1) = s*shape_ox(i)*shape_cy(j)*shape_oz(k);
11334 for (
int k = 0; k <= pp1; k++)
11335 for (
int j = 0; j < pp1; j++)
11336 for (
int i = 0; i < pp1; i++)
11339 if ((idx =
dof_map[o++]) < 0)
11341 idx = -1 - idx, s = -1;
11349 shape(idx,2) = s*shape_ox(i)*shape_oy(j)*shape_cz(k);
11356 const int pp1 =
order;
11358 #ifdef MFEM_THREAD_SAFE
11359 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
11360 Vector shape_cz(pp1 + 1), shape_oz(pp1);
11361 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
11382 for (
int k = 0; k < pp1; k++)
11383 for (
int j = 0; j < pp1; j++)
11384 for (
int i = 0; i <= pp1; i++)
11387 if ((idx =
dof_map[o++]) < 0)
11389 idx = -1 - idx, s = -1;
11395 divshape(idx) = s*dshape_cx(i)*shape_oy(j)*shape_oz(k);
11398 for (
int k = 0; k < pp1; k++)
11399 for (
int j = 0; j <= pp1; j++)
11400 for (
int i = 0; i < pp1; i++)
11403 if ((idx =
dof_map[o++]) < 0)
11405 idx = -1 - idx, s = -1;
11411 divshape(idx) = s*shape_ox(i)*dshape_cy(j)*shape_oz(k);
11414 for (
int k = 0; k <= pp1; k++)
11415 for (
int j = 0; j < pp1; j++)
11416 for (
int i = 0; i < pp1; i++)
11419 if ((idx =
dof_map[o++]) < 0)
11421 idx = -1 - idx, s = -1;
11427 divshape(idx) = s*shape_ox(i)*shape_oy(j)*dshape_cz(k);
11445 for (
int c = 0; c < 3; c++)
11450 for (
int k = 0; k < km; k++)
11451 for (
int j = 0; j < jm; j++)
11452 for (
int i = 0; i < im; i++)
11455 if (idx < 0) { idx = -1 - idx; }
11457 if (c == 0) { ic1 = j; ic2 = k; }
11458 else if (c == 1) { ic1 = i; ic2 = k; }
11459 else { ic1 = i; ic2 = j; }
11460 const double h1 = cp[ic1+1] - cp[ic1];
11461 const double h2 = cp[ic2+1] - cp[ic2];
11463 for (
int q = 0; q < nqpt; q++)
11466 if (c == 0) { ip3d.
Set3(cp[i], cp[j] + h1*ip2d.
x, cp[k] + h2*ip2d.
y); }
11467 else if (c == 1) { ip3d.
Set3(cp[i] + h1*ip2d.
x, cp[j], cp[k] + h2*ip2d.
y); }
11468 else { ip3d.
Set3(cp[i] + h1*ip2d.
x, cp[j] + h2*ip2d.
y, cp[k]); }
11470 vc.
Eval(xq, Trans, ip3d);
11474 val += ip2d.
weight*ipval;
11476 dofs(idx) = val*h1*h2;
11482 const double RT_TriangleElement::nk[6] =
11483 { 0., -1., 1., 1., -1., 0. };
11485 const double RT_TriangleElement::c = 1./3.;
11495 #ifndef MFEM_THREAD_SAFE
11505 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11510 for (
int i = 0; i <=
p; i++)
11515 for (
int i = 0; i <=
p; i++)
11520 for (
int i = 0; i <=
p; i++)
11527 for (
int j = 0; j <
p; j++)
11528 for (
int i = 0; i + j <
p; i++)
11530 double w = iop[i] + iop[j] + iop[p-1-i-j];
11538 for (
int k = 0; k <
dof; k++)
11544 const double *n_k = nk + 2*dof2nk[k];
11547 for (
int j = 0; j <=
p; j++)
11548 for (
int i = 0; i + j <=
p; i++)
11550 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
11551 T(o++, k) = s*n_k[0];
11552 T(o++, k) = s*n_k[1];
11554 for (
int i = 0; i <=
p; i++)
11556 double s = shape_x(i)*shape_y(p-i);
11557 T(o++, k) = s*((ip.
x - c)*n_k[0] + (ip.
y - c)*n_k[1]);
11568 const int p =
order - 1;
11570 #ifdef MFEM_THREAD_SAFE
11571 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11580 for (
int j = 0; j <=
p; j++)
11581 for (
int i = 0; i + j <=
p; i++)
11583 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
11584 u(o,0) =
s; u(o,1) = 0; o++;
11585 u(o,0) = 0; u(o,1) =
s; o++;
11587 for (
int i = 0; i <=
p; i++)
11589 double s = shape_x(i)*shape_y(p-i);
11590 u(o,0) = (ip.
x - c)*s;
11591 u(o,1) = (ip.
y - c)*s;
11601 const int p =
order - 1;
11603 #ifdef MFEM_THREAD_SAFE
11604 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11605 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
11614 for (
int j = 0; j <=
p; j++)
11615 for (
int i = 0; i + j <=
p; i++)
11618 divu(o++) = (dshape_x(i)*shape_l(k) -
11619 shape_x(i)*dshape_l(k))*shape_y(j);
11620 divu(o++) = (dshape_y(j)*shape_l(k) -
11621 shape_y(j)*dshape_l(k))*shape_x(i);
11623 for (
int i = 0; i <=
p; i++)
11626 divu(o++) = ((shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j) +
11627 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i));
11630 Ti.
Mult(divu, divshape);
11634 const double RT_TetrahedronElement::nk[12] =
11635 { 1,1,1, -1,0,0, 0,-1,0, 0,0,-1 };
11638 const double RT_TetrahedronElement::c = 1./4.;
11648 #ifndef MFEM_THREAD_SAFE
11660 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11666 for (
int j = 0; j <=
p; j++)
11667 for (
int i = 0; i + j <=
p; i++)
11669 double w = bop[i] + bop[j] + bop[p-i-j];
11673 for (
int j = 0; j <=
p; j++)
11674 for (
int i = 0; i + j <=
p; i++)
11676 double w = bop[i] + bop[j] + bop[p-i-j];
11680 for (
int j = 0; j <=
p; j++)
11681 for (
int i = 0; i + j <=
p; i++)
11683 double w = bop[i] + bop[j] + bop[p-i-j];
11687 for (
int j = 0; j <=
p; j++)
11688 for (
int i = 0; i + j <=
p; i++)
11690 double w = bop[i] + bop[j] + bop[p-i-j];
11696 for (
int k = 0; k <
p; k++)
11697 for (
int j = 0; j + k <
p; j++)
11698 for (
int i = 0; i + j + k <
p; i++)
11700 double w = iop[i] + iop[j] + iop[k] + iop[p-1-i-j-k];
11710 for (
int m = 0; m <
dof; m++)
11717 const double *nm = nk + 3*dof2nk[m];
11720 for (
int k = 0; k <=
p; k++)
11721 for (
int j = 0; j + k <=
p; j++)
11722 for (
int i = 0; i + j + k <=
p; i++)
11724 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11725 T(o++, m) = s * nm[0];
11726 T(o++, m) = s * nm[1];
11727 T(o++, m) = s * nm[2];
11729 for (
int j = 0; j <=
p; j++)
11730 for (
int i = 0; i + j <=
p; i++)
11732 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11733 T(o++, m) = s*((ip.
x - c)*nm[0] + (ip.
y - c)*nm[1] +
11745 const int p =
order - 1;
11747 #ifdef MFEM_THREAD_SAFE
11748 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11758 for (
int k = 0; k <=
p; k++)
11759 for (
int j = 0; j + k <=
p; j++)
11760 for (
int i = 0; i + j + k <=
p; i++)
11762 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11763 u(o,0) =
s; u(o,1) = 0; u(o,2) = 0; o++;
11764 u(o,0) = 0; u(o,1) =
s; u(o,2) = 0; o++;
11765 u(o,0) = 0; u(o,1) = 0; u(o,2) =
s; o++;
11767 for (
int j = 0; j <=
p; j++)
11768 for (
int i = 0; i + j <=
p; i++)
11770 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11771 u(o,0) = (ip.
x - c)*s; u(o,1) = (ip.
y - c)*s; u(o,2) = (ip.
z - c)*s;
11781 const int p =
order - 1;
11783 #ifdef MFEM_THREAD_SAFE
11784 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11785 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
11795 for (
int k = 0; k <=
p; k++)
11796 for (
int j = 0; j + k <=
p; j++)
11797 for (
int i = 0; i + j + k <=
p; i++)
11799 int l = p - i - j - k;
11800 divu(o++) = (dshape_x(i)*shape_l(l) -
11801 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
11802 divu(o++) = (dshape_y(j)*shape_l(l) -
11803 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
11804 divu(o++) = (dshape_z(k)*shape_l(l) -
11805 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
11807 for (
int j = 0; j <=
p; j++)
11808 for (
int i = 0; i + j <=
p; i++)
11812 (shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j)*shape_z(k) +
11813 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i)*shape_z(k) +
11814 (shape_z(k) + (ip.
z - c)*dshape_z(k))*shape_x(i)*shape_y(j);
11817 Ti.
Mult(divu, divshape);
11821 const double ND_HexahedronElement::tk[18] =
11822 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,0.,0., 0.,-1.,0., 0.,0.,-1. };
11825 const int cb_type,
const int ob_type)
11828 dof2tk(dof), cp(
poly1d.ClosedPoints(p, cb_type))
11835 const int dof3 =
dof/3;
11837 #ifndef MFEM_THREAD_SAFE
11851 for (
int i = 0; i <
p; i++)
11853 dof_map[0*dof3 + i + (0 + 0*(p + 1))*
p] = o++;
11855 for (
int i = 0; i <
p; i++)
11857 dof_map[1*dof3 + p + (i + 0*
p)*(p + 1)] = o++;
11859 for (
int i = 0; i <
p; i++)
11861 dof_map[0*dof3 + i + (p + 0*(p + 1))*
p] = o++;
11863 for (
int i = 0; i <
p; i++)
11865 dof_map[1*dof3 + 0 + (i + 0*
p)*(p + 1)] = o++;
11867 for (
int i = 0; i <
p; i++)
11869 dof_map[0*dof3 + i + (0 + p*(p + 1))*
p] = o++;
11871 for (
int i = 0; i <
p; i++)
11873 dof_map[1*dof3 + p + (i + p*
p)*(p + 1)] = o++;
11875 for (
int i = 0; i <
p; i++)
11877 dof_map[0*dof3 + i + (p + p*(p + 1))*
p] = o++;
11879 for (
int i = 0; i <
p; i++)
11881 dof_map[1*dof3 + 0 + (i + p*
p)*(p + 1)] = o++;
11883 for (
int i = 0; i <
p; i++)
11885 dof_map[2*dof3 + 0 + (0 + i*(p + 1))*(p + 1)] = o++;
11887 for (
int i = 0; i <
p; i++)
11889 dof_map[2*dof3 + p + (0 + i*(p + 1))*(p + 1)] = o++;
11891 for (
int i = 0; i <
p; i++)
11893 dof_map[2*dof3 + p + (p + i*(p + 1))*(p + 1)] = o++;
11895 for (
int i = 0; i <
p; i++)
11897 dof_map[2*dof3 + 0 + (p + i*(p + 1))*(p + 1)] = o++;
11902 for (
int j = 1; j <
p; j++)
11903 for (
int i = 0; i <
p; i++)
11905 dof_map[0*dof3 + i + ((p - j) + 0*(p + 1))*p] = o++;
11907 for (
int j = 0; j <
p; j++)
11908 for (
int i = 1; i <
p; i++)
11910 dof_map[1*dof3 + i + ((p - 1 - j) + 0*p)*(p + 1)] = -1 - (o++);
11913 for (
int k = 1; k <
p; k++)
11914 for (
int i = 0; i <
p; i++)
11916 dof_map[0*dof3 + i + (0 + k*(p + 1))*
p] = o++;
11918 for (
int k = 0; k <
p; k++)
11919 for (
int i = 1; i <
p; i++ )
11921 dof_map[2*dof3 + i + (0 + k*(p + 1))*(p + 1)] = o++;
11924 for (
int k = 1; k <
p; k++)
11925 for (
int j = 0; j <
p; j++)
11927 dof_map[1*dof3 + p + (j + k*
p)*(p + 1)] = o++;
11929 for (
int k = 0; k <
p; k++)
11930 for (
int j = 1; j <
p; j++)
11932 dof_map[2*dof3 + p + (j + k*(p + 1))*(p + 1)] = o++;
11935 for (
int k = 1; k <
p; k++)
11936 for (
int i = 0; i <
p; i++)
11938 dof_map[0*dof3 + (p - 1 - i) + (p + k*(p + 1))*p] = -1 - (o++);
11940 for (
int k = 0; k <
p; k++)
11941 for (
int i = 1; i <
p; i++)
11943 dof_map[2*dof3 + (p - i) + (p + k*(p + 1))*(p + 1)] = o++;
11946 for (
int k = 1; k <
p; k++)
11947 for (
int j = 0; j <
p; j++)
11949 dof_map[1*dof3 + 0 + ((p - 1 - j) + k*p)*(p + 1)] = -1 - (o++);
11951 for (
int k = 0; k <
p; k++)
11952 for (
int j = 1; j <
p; j++)
11954 dof_map[2*dof3 + 0 + ((p - j) + k*(p + 1))*(p + 1)] = o++;
11957 for (
int j = 1; j <
p; j++)
11958 for (
int i = 0; i <
p; i++)
11960 dof_map[0*dof3 + i + (j + p*(p + 1))*
p] = o++;
11962 for (
int j = 0; j <
p; j++)
11963 for (
int i = 1; i <
p; i++)
11965 dof_map[1*dof3 + i + (j + p*
p)*(p + 1)] = o++;
11970 for (
int k = 1; k <
p; k++)
11971 for (
int j = 1; j <
p; j++)
11972 for (
int i = 0; i <
p; i++)
11974 dof_map[0*dof3 + i + (j + k*(p + 1))*
p] = o++;
11977 for (
int k = 1; k <
p; k++)
11978 for (
int j = 0; j <
p; j++)
11979 for (
int i = 1; i <
p; i++)
11981 dof_map[1*dof3 + i + (j + k*
p)*(p + 1)] = o++;
11984 for (
int k = 0; k <
p; k++)
11985 for (
int j = 1; j <
p; j++)
11986 for (
int i = 1; i <
p; i++)
11988 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
11994 for (
int k = 0; k <=
p; k++)
11995 for (
int j = 0; j <=
p; j++)
11996 for (
int i = 0; i <
p; i++)
11999 if ((idx =
dof_map[o++]) < 0)
12001 dof2tk[idx = -1 - idx] = 3;
12010 for (
int k = 0; k <=
p; k++)
12011 for (
int j = 0; j <
p; j++)
12012 for (
int i = 0; i <=
p; i++)
12015 if ((idx =
dof_map[o++]) < 0)
12017 dof2tk[idx = -1 - idx] = 4;
12026 for (
int k = 0; k <
p; k++)
12027 for (
int j = 0; j <=
p; j++)
12028 for (
int i = 0; i <=
p; i++)
12031 if ((idx =
dof_map[o++]) < 0)
12033 dof2tk[idx = -1 - idx] = 5;
12057 for (
int c = 0; c < 3; ++c)
12063 for (
int k = 0; k <= km; k++)
12064 for (
int j = 0; j <= jm; j++)
12065 for (
int i = 0; i <= im; i++)
12068 if ((idx =
dof_map[o++]) < 0)
12073 const int id1 = c == 0 ? i : (c == 1 ? j : k);
12074 const double h = cp[id1+1] - cp[id1];
12078 for (
int q = 0; q < nqpt; q++)
12084 ip3d.
Set3(cp[i] + (h*ip1d.
x), cp[j], cp[k]);
12088 ip3d.
Set3(cp[i], cp[j] + (h*ip1d.
x), cp[k]);
12092 ip3d.
Set3(cp[i], cp[j], cp[k] + (h*ip1d.
x));
12096 vc.
Eval(xk, Trans, ip3d);
12100 val += ip1d.
weight * ipval;
12111 const int p =
order;
12113 #ifdef MFEM_THREAD_SAFE
12114 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
12115 Vector shape_cz(p + 1), shape_oz(p);
12139 for (
int k = 0; k <=
p; k++)
12140 for (
int j = 0; j <=
p; j++)
12141 for (
int i = 0; i <
p; i++)
12144 if ((idx =
dof_map[o++]) < 0)
12146 idx = -1 - idx, s = -1;
12152 shape(idx,0) = s*shape_ox(i)*shape_cy(j)*shape_cz(k);
12157 for (
int k = 0; k <=
p; k++)
12158 for (
int j = 0; j <
p; j++)
12159 for (
int i = 0; i <=
p; i++)
12162 if ((idx =
dof_map[o++]) < 0)
12164 idx = -1 - idx, s = -1;
12171 shape(idx,1) = s*shape_cx(i)*shape_oy(j)*shape_cz(k);
12175 for (
int k = 0; k <
p; k++)
12176 for (
int j = 0; j <=
p; j++)
12177 for (
int i = 0; i <=
p; i++)
12180 if ((idx =
dof_map[o++]) < 0)
12182 idx = -1 - idx, s = -1;
12190 shape(idx,2) = s*shape_cx(i)*shape_cy(j)*shape_oz(k);
12197 const int p =
order;
12199 #ifdef MFEM_THREAD_SAFE
12200 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
12201 Vector shape_cz(p + 1), shape_oz(p);
12202 Vector dshape_cx(p + 1), dshape_cy(p + 1), dshape_cz(p + 1);
12223 for (
int k = 0; k <=
p; k++)
12224 for (
int j = 0; j <=
p; j++)
12225 for (
int i = 0; i <
p; i++)
12228 if ((idx =
dof_map[o++]) < 0)
12230 idx = -1 - idx, s = -1;
12236 curl_shape(idx,0) = 0.;
12237 curl_shape(idx,1) = s*shape_ox(i)* shape_cy(j)*dshape_cz(k);
12238 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j)* shape_cz(k);
12241 for (
int k = 0; k <=
p; k++)
12242 for (
int j = 0; j <
p; j++)
12243 for (
int i = 0; i <=
p; i++)
12246 if ((idx =
dof_map[o++]) < 0)
12248 idx = -1 - idx, s = -1;
12254 curl_shape(idx,0) = -s* shape_cx(i)*shape_oy(j)*dshape_cz(k);
12255 curl_shape(idx,1) = 0.;
12256 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j)* shape_cz(k);
12259 for (
int k = 0; k <
p; k++)
12260 for (
int j = 0; j <=
p; j++)
12261 for (
int i = 0; i <=
p; i++)
12264 if ((idx =
dof_map[o++]) < 0)
12266 idx = -1 - idx, s = -1;
12272 curl_shape(idx,0) = s* shape_cx(i)*dshape_cy(j)*shape_oz(k);
12273 curl_shape(idx,1) = -s*dshape_cx(i)* shape_cy(j)*shape_oz(k);
12274 curl_shape(idx,2) = 0.;
12299 const bool closed)
const
12304 i < (closed ?
dof2quad_array.Size() : dof2quad_array_open.Size());
12308 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
12312 const int ndof = closed ?
order + 1 :
order;
12313 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
dim) + 0.5);
12323 Vector val(ndof), grad(ndof);
12324 for (
int i = 0; i < nqpt; i++)
12338 for (
int j = 0; j < ndof; j++)
12340 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
12341 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
12351 dof2quad_array_open.Append(d2q);
12359 for (
int i = 0; i < dof2quad_array_open.Size(); i++)
12361 delete dof2quad_array_open[i];
12365 const double ND_QuadrilateralElement::tk[8] =
12366 { 1.,0., 0.,1., -1.,0., 0.,-1. };
12374 cp(
poly1d.ClosedPoints(p, cb_type))
12381 const int dof2 =
dof/2;
12383 #ifndef MFEM_THREAD_SAFE
12394 for (
int i = 0; i <
p; i++)
12398 for (
int j = 0; j <
p; j++)
12400 dof_map[1*dof2 + p + j*(p + 1)] = o++;
12402 for (
int i = 0; i <
p; i++)
12404 dof_map[0*dof2 + (p - 1 - i) + p*p] = -1 - (o++);
12406 for (
int j = 0; j <
p; j++)
12408 dof_map[1*dof2 + 0 + (p - 1 - j)*(p + 1)] = -1 - (o++);
12413 for (
int j = 1; j <
p; j++)
12414 for (
int i = 0; i <
p; i++)
12419 for (
int j = 0; j <
p; j++)
12420 for (
int i = 1; i <
p; i++)
12422 dof_map[1*dof2 + i + j*(p + 1)] = o++;
12428 for (
int j = 0; j <=
p; j++)
12429 for (
int i = 0; i <
p; i++)
12432 if ((idx =
dof_map[o++]) < 0)
12434 dof2tk[idx = -1 - idx] = 2;
12443 for (
int j = 0; j <
p; j++)
12444 for (
int i = 0; i <=
p; i++)
12447 if ((idx =
dof_map[o++]) < 0)
12449 dof2tk[idx = -1 - idx] = 3;
12474 for (
int j = 0; j <=
order; j++)
12475 for (
int i = 0; i <
order; i++)
12478 if ((idx =
dof_map[o++]) < 0)
12483 const double h = cp[i+1] - cp[i];
12487 for (
int k = 0; k < nqpt; k++)
12491 ip2d.
Set2(cp[i] + (h*ip1d.
x), cp[j]);
12494 vc.
Eval(xk, Trans, ip2d);
12498 val += ip1d.
weight * ipval;
12504 for (
int j = 0; j <
order; j++)
12505 for (
int i = 0; i <=
order; i++)
12508 if ((idx =
dof_map[o++]) < 0)
12513 const double h = cp[j+1] - cp[j];
12517 for (
int k = 0; k < nqpt; k++)
12521 ip2d.
Set2(cp[i], cp[j] + (h*ip1d.
x));
12524 vc.
Eval(xk, Trans, ip2d);
12528 val += ip1d.
weight * ipval;
12538 const int p =
order;
12540 #ifdef MFEM_THREAD_SAFE
12541 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
12561 for (
int j = 0; j <=
p; j++)
12562 for (
int i = 0; i <
p; i++)
12565 if ((idx =
dof_map[o++]) < 0)
12567 idx = -1 - idx, s = -1;
12573 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
12577 for (
int j = 0; j <
p; j++)
12578 for (
int i = 0; i <=
p; i++)
12581 if ((idx =
dof_map[o++]) < 0)
12583 idx = -1 - idx, s = -1;
12590 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
12597 const int p =
order;
12599 #ifdef MFEM_THREAD_SAFE
12600 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
12601 Vector dshape_cx(p + 1), dshape_cy(p + 1);
12619 for (
int j = 0; j <=
p; j++)
12620 for (
int i = 0; i <
p; i++)
12623 if ((idx =
dof_map[o++]) < 0)
12625 idx = -1 - idx, s = -1;
12631 curl_shape(idx,0) = -s*shape_ox(i)*dshape_cy(j);
12634 for (
int j = 0; j <
p; j++)
12635 for (
int i = 0; i <=
p; i++)
12638 if ((idx =
dof_map[o++]) < 0)
12640 idx = -1 - idx, s = -1;
12646 curl_shape(idx,0) = s*dshape_cx(i)*shape_oy(j);
12651 const double ND_TetrahedronElement::tk[18] =
12652 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,1.,0., -1.,0.,1., 0.,-1.,1. };
12654 const double ND_TetrahedronElement::c = 1./4.;
12664 const int pm1 = p - 1, pm2 = p - 2, pm3 = p - 3;
12666 #ifndef MFEM_THREAD_SAFE
12677 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12682 for (
int i = 0; i <
p; i++)
12687 for (
int i = 0; i <
p; i++)
12692 for (
int i = 0; i <
p; i++)
12697 for (
int i = 0; i <
p; i++)
12702 for (
int i = 0; i <
p; i++)
12707 for (
int i = 0; i <
p; i++)
12714 for (
int j = 0; j <= pm2; j++)
12715 for (
int i = 0; i + j <= pm2; i++)
12717 double w = fop[i] + fop[j] + fop[pm2-i-j];
12723 for (
int j = 0; j <= pm2; j++)
12724 for (
int i = 0; i + j <= pm2; i++)
12726 double w = fop[i] + fop[j] + fop[pm2-i-j];
12732 for (
int j = 0; j <= pm2; j++)
12733 for (
int i = 0; i + j <= pm2; i++)
12735 double w = fop[i] + fop[j] + fop[pm2-i-j];
12741 for (
int j = 0; j <= pm2; j++)
12742 for (
int i = 0; i + j <= pm2; i++)
12744 double w = fop[i] + fop[j] + fop[pm2-i-j];
12752 for (
int k = 0; k <= pm3; k++)
12753 for (
int j = 0; j + k <= pm3; j++)
12754 for (
int i = 0; i + j + k <= pm3; i++)
12756 double w = iop[i] + iop[j] + iop[k] + iop[pm3-i-j-k];
12766 for (
int m = 0; m <
dof; m++)
12769 const double *tm = tk + 3*dof2tk[m];
12777 for (
int k = 0; k <= pm1; k++)
12778 for (
int j = 0; j + k <= pm1; j++)
12779 for (
int i = 0; i + j + k <= pm1; i++)
12781 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
12782 T(o++, m) = s * tm[0];
12783 T(o++, m) = s * tm[1];
12784 T(o++, m) = s * tm[2];
12786 for (
int k = 0; k <= pm1; k++)
12787 for (
int j = 0; j + k <= pm1; j++)
12789 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
12790 T(o++, m) = s*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
12791 T(o++, m) = s*((ip.
z - c)*tm[0] - (ip.
x - c)*tm[2]);
12793 for (
int k = 0; k <= pm1; k++)
12796 shape_y(pm1-k)*shape_z(k)*((ip.
z - c)*tm[1] - (ip.
y - c)*tm[2]);
12807 const int pm1 =
order - 1;
12809 #ifdef MFEM_THREAD_SAFE
12810 const int p =
order;
12811 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12821 for (
int k = 0; k <= pm1; k++)
12822 for (
int j = 0; j + k <= pm1; j++)
12823 for (
int i = 0; i + j + k <= pm1; i++)
12825 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
12826 u(n,0) =
s; u(n,1) = 0.; u(n,2) = 0.; n++;
12827 u(n,0) = 0.; u(n,1) =
s; u(n,2) = 0.; n++;
12828 u(n,0) = 0.; u(n,1) = 0.; u(n,2) =
s; n++;
12830 for (
int k = 0; k <= pm1; k++)
12831 for (
int j = 0; j + k <= pm1; j++)
12833 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
12834 u(n,0) = s*(ip.
y - c); u(n,1) = -s*(ip.
x - c); u(n,2) = 0.; n++;
12835 u(n,0) = s*(ip.
z - c); u(n,1) = 0.; u(n,2) = -s*(ip.
x - c); n++;
12837 for (
int k = 0; k <= pm1; k++)
12839 double s = shape_y(pm1-k)*shape_z(k);
12840 u(n,0) = 0.; u(n,1) = s*(ip.
z - c); u(n,2) = -s*(ip.
y - c); n++;
12849 const int pm1 =
order - 1;
12851 #ifdef MFEM_THREAD_SAFE
12852 const int p =
order;
12853 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12854 Vector dshape_x(p), dshape_y(p), dshape_z(p), dshape_l(p);
12864 for (
int k = 0; k <= pm1; k++)
12865 for (
int j = 0; j + k <= pm1; j++)
12866 for (
int i = 0; i + j + k <= pm1; i++)
12869 const double dx = (dshape_x(i)*shape_l(l) -
12870 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
12871 const double dy = (dshape_y(j)*shape_l(l) -
12872 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
12873 const double dz = (dshape_z(k)*shape_l(l) -
12874 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
12876 u(n,0) = 0.; u(n,1) = dz; u(n,2) = -dy; n++;
12877 u(n,0) = -dz; u(n,1) = 0.; u(n,2) = dx; n++;
12878 u(n,0) = dy; u(n,1) = -dx; u(n,2) = 0.; n++;
12880 for (
int k = 0; k <= pm1; k++)
12881 for (
int j = 0; j + k <= pm1; j++)
12883 int i = pm1 - j - k;
12886 u(n,0) = shape_x(i)*(ip.
x - c)*shape_y(j)*dshape_z(k);
12887 u(n,1) = shape_x(i)*shape_y(j)*(ip.
y - c)*dshape_z(k);
12889 -((dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k) +
12890 (dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_x(i)*shape_z(k));
12893 u(n,0) = -shape_x(i)*(ip.
x - c)*dshape_y(j)*shape_z(k);
12894 u(n,1) = (shape_x(i)*shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)) +
12895 (dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k));
12896 u(n,2) = -shape_x(i)*dshape_y(j)*shape_z(k)*(ip.
z - c);
12899 for (
int k = 0; k <= pm1; k++)
12903 u(n,0) = -((dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_z(k) +
12904 shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)));
12909 Ti.
Mult(u, curl_shape);
12913 const double ND_TriangleElement::tk[8] =
12914 { 1.,0., -1.,1., 0.,-1., 0.,1. };
12916 const double ND_TriangleElement::c = 1./3.;
12926 const int pm1 = p - 1, pm2 = p - 2;
12928 #ifndef MFEM_THREAD_SAFE
12938 Vector shape_x(p), shape_y(p), shape_l(p);
12943 for (
int i = 0; i <
p; i++)
12948 for (
int i = 0; i <
p; i++)
12953 for (
int i = 0; i <
p; i++)
12960 for (
int j = 0; j <= pm2; j++)
12961 for (
int i = 0; i + j <= pm2; i++)
12963 double w = iop[i] + iop[j] + iop[pm2-i-j];
12971 for (
int m = 0; m <
dof; m++)
12974 const double *tm = tk + 2*dof2tk[m];
12981 for (
int j = 0; j <= pm1; j++)
12982 for (
int i = 0; i + j <= pm1; i++)
12984 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
12985 T(n++, m) = s * tm[0];
12986 T(n++, m) = s * tm[1];
12988 for (
int j = 0; j <= pm1; j++)
12991 shape_x(pm1-j)*shape_y(j)*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
13002 const int pm1 =
order - 1;
13004 #ifdef MFEM_THREAD_SAFE
13005 const int p =
order;
13006 Vector shape_x(p), shape_y(p), shape_l(p);
13015 for (
int j = 0; j <= pm1; j++)
13016 for (
int i = 0; i + j <= pm1; i++)
13018 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
13019 u(n,0) =
s; u(n,1) = 0; n++;
13020 u(n,0) = 0; u(n,1) =
s; n++;
13022 for (
int j = 0; j <= pm1; j++)
13024 double s = shape_x(pm1-j)*shape_y(j);
13025 u(n,0) = s*(ip.
y - c);
13026 u(n,1) = -s*(ip.
x - c);
13036 const int pm1 =
order - 1;
13038 #ifdef MFEM_THREAD_SAFE
13039 const int p =
order;
13040 Vector shape_x(p), shape_y(p), shape_l(p);
13041 Vector dshape_x(p), dshape_y(p), dshape_l(p);
13050 for (
int j = 0; j <= pm1; j++)
13051 for (
int i = 0; i + j <= pm1; i++)
13054 const double dx = (dshape_x(i)*shape_l(l) -
13055 shape_x(i)*dshape_l(l)) * shape_y(j);
13056 const double dy = (dshape_y(j)*shape_l(l) -
13057 shape_y(j)*dshape_l(l)) * shape_x(i);
13063 for (
int j = 0; j <= pm1; j++)
13067 curlu(n++) = -((dshape_x(i)*(ip.
x - c) + shape_x(i)) * shape_y(j) +
13068 (dshape_y(j)*(ip.
y - c) + shape_y(j)) * shape_x(i));
13072 Ti.
Mult(curlu, curl2d);
13076 const double ND_SegmentElement::tk[1] = { 1. };
13088 for (
int i = 0; i <
p; i++)
13115 kv[0]->CalcShape(shape,
ijk[0], ip.
x);
13118 for (
int i = 0; i <=
order; i++)
13120 sum += (shape(i) *=
weights(i));
13132 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
13134 double sum = 0.0, dsum = 0.0;
13135 for (
int i = 0; i <=
order; i++)
13138 dsum += ( grad(i) *=
weights(i));
13142 add(sum, grad, -dsum*sum*sum,
shape_x, grad);
13152 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
13153 kv[0]->CalcD2Shape(hess,
ijk[0], ip.
x);
13155 double sum = 0.0, dsum = 0.0, d2sum = 0.0;
13156 for (
int i = 0; i <=
order; i++)
13159 dsum += ( grad(i) *=
weights(i));
13160 d2sum += ( hess(i) *=
weights(i));
13164 add(sum, hess, -2*dsum*sum*sum, grad, hess);
13165 add(1.0, hess, (-d2sum + 2*dsum*dsum*sum)*sum*sum,
shape_x, hess);
13194 for (
int o = 0, j = 0; j <=
orders[1]; j++)
13196 const double sy =
shape_y(j);
13197 for (
int i = 0; i <=
orders[0]; i++, o++)
13209 double sum, dsum[2];
13217 sum = dsum[0] = dsum[1] = 0.0;
13218 for (
int o = 0, j = 0; j <=
orders[1]; j++)
13221 for (
int i = 0; i <=
orders[0]; i++, o++)
13231 dsum[0] *= sum*sum;
13232 dsum[1] *= sum*sum;
13234 for (
int o = 0; o <
dof; o++)
13236 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
13237 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
13244 double sum, dsum[2], d2sum[3];
13255 sum = dsum[0] = dsum[1] = 0.0;
13256 d2sum[0] = d2sum[1] = d2sum[2] = 0.0;
13257 for (
int o = 0, j = 0; j <=
orders[1]; j++)
13260 for (
int i = 0; i <=
orders[0]; i++, o++)
13263 sum += (
u(o) = sx*sy*
weights(o) );
13265 dsum[0] += (
du(o,0) = dsx*sy*
weights(o) );
13266 dsum[1] += (
du(o,1) = sx*dsy*
weights(o) );
13268 d2sum[0] += ( hessian(o,0) = d2sx*sy*
weights(o) );
13269 d2sum[1] += ( hessian(o,1) = dsx*dsy*
weights(o) );
13270 d2sum[2] += ( hessian(o,2) = sx*d2sy*
weights(o) );
13282 for (
int o = 0; o <
dof; o++)
13284 hessian(o,0) = hessian(o,0)*sum
13285 - 2*
du(o,0)*sum*dsum[0]
13286 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
13288 hessian(o,1) = hessian(o,1)*sum
13289 -
du(o,0)*sum*dsum[1]
13290 -
du(o,1)*sum*dsum[0]
13291 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
13293 hessian(o,2) = hessian(o,2)*sum
13294 - 2*
du(o,1)*sum*dsum[1]
13295 + u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[2]);
13332 for (
int o = 0, k = 0; k <=
orders[2]; k++)
13334 const double sz =
shape_z(k);
13335 for (
int j = 0; j <=
orders[1]; j++)
13337 const double sy_sz =
shape_y(j)*sz;
13338 for (
int i = 0; i <=
orders[0]; i++, o++)
13351 double sum, dsum[3];
13361 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
13362 for (
int o = 0, k = 0; k <=
orders[2]; k++)
13365 for (
int j = 0; j <=
orders[1]; j++)
13367 const double sy_sz =
shape_y(j)* sz;
13368 const double dsy_sz =
dshape_y(j)* sz;
13369 const double sy_dsz =
shape_y(j)*dsz;
13370 for (
int i = 0; i <=
orders[0]; i++, o++)
13382 dsum[0] *= sum*sum;
13383 dsum[1] *= sum*sum;
13384 dsum[2] *= sum*sum;
13386 for (
int o = 0; o <
dof; o++)
13388 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
13389 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
13390 dshape(o,2) = dshape(o,2)*sum -
u(o)*dsum[2];
13397 double sum, dsum[3], d2sum[6];
13411 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
13412 d2sum[0] = d2sum[1] = d2sum[2] = d2sum[3] = d2sum[4] = d2sum[5] = 0.0;
13414 for (
int o = 0, k = 0; k <=
orders[2]; k++)
13417 for (
int j = 0; j <=
orders[1]; j++)
13420 for (
int i = 0; i <=
orders[0]; i++, o++)
13423 sum += (
u(o) = sx*sy*sz*
weights(o) );
13425 dsum[0] += (
du(o,0) = dsx*sy*sz*
weights(o) );
13426 dsum[1] += (
du(o,1) = sx*dsy*sz*
weights(o) );
13427 dsum[2] += (
du(o,2) = sx*sy*dsz*
weights(o) );
13429 d2sum[0] += ( hessian(o,0) = d2sx*sy*sz*
weights(o) );
13430 d2sum[1] += ( hessian(o,1) = dsx*dsy*sz*
weights(o) );
13431 d2sum[2] += ( hessian(o,2) = dsx*sy*dsz*
weights(o) );
13433 d2sum[3] += ( hessian(o,3) = sx*dsy*dsz*
weights(o) );
13435 d2sum[4] += ( hessian(o,4) = sx*sy*d2sz*
weights(o) );
13436 d2sum[5] += ( hessian(o,5) = sx*d2sy*sz*
weights(o) );
13454 for (
int o = 0; o <
dof; o++)
13456 hessian(o,0) = hessian(o,0)*sum
13457 - 2*
du(o,0)*sum*dsum[0]
13458 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
13460 hessian(o,1) = hessian(o,1)*sum
13461 -
du(o,0)*sum*dsum[1]
13462 -
du(o,1)*sum*dsum[0]
13463 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
13465 hessian(o,2) = hessian(o,2)*sum
13466 -
du(o,0)*sum*dsum[2]
13467 -
du(o,2)*sum*dsum[0]
13468 + u[o]*sum*(2*dsum[0]*dsum[2] - d2sum[2]);
13470 hessian(o,3) = hessian(o,3)*sum
13471 -
du(o,1)*sum*dsum[2]
13472 -
du(o,2)*sum*dsum[1]
13473 + u[o]*sum*(2*dsum[1]*dsum[2] - d2sum[3]);
13475 hessian(o,4) = hessian(o,4)*sum
13476 - 2*
du(o,2)*sum*dsum[2]
13477 + u[o]*sum*(2*dsum[2]*dsum[2] - d2sum[4]);
13479 hessian(o,5) = hessian(o,5)*sum
13480 - 2*
du(o,1)*sum*dsum[1]
13481 + u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[5]);
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for all finite elements.
RefinedLinear3DFiniteElement()
Construct the RefinedLinear3DFiniteElement.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
void Set(const double *p, const int dim)
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 MultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
Multiply a matrix A with the transpose of a matrix B: A*Bt.
RT0TriangleFiniteElement()
Construct the RT0TriangleFiniteElement.
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the ND_SegmentElement of order p and open BasisType ob_type.
int Size() const
Return the logical size of the array.
void Get(double *p, const int dim) const
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
RT2TriangleFiniteElement()
Construct the RT2TriangleFiniteElement.
int GetDim() const
Returns the reference space dimension for the finite element.
GaussQuad2DFiniteElement()
Construct the GaussQuad2DFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
void trans(const Vector &u, Vector &x)
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...
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...
Array< int > lex_ordering
Class for an integration rule - an Array of IntegrationPoint.
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...
L2Pos_WedgeElement(const int p)
Construct the L2Pos_WedgeElement of order p.
CrouzeixRaviartQuadFiniteElement()
Construct the CrouzeixRaviartQuadFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
P2SegmentFiniteElement()
Construct the P2SegmentFiniteElement.
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...
Linear3DFiniteElement()
Construct the Linear3DFiniteElement.
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
virtual void CalcPhysLinLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
static double CalcDelta(const int p, const double x)
Evaluate a representation of a Delta function at point x.
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...
RT1TriangleFiniteElement()
Construct the RT1TriangleFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Project the rows of the matrix coefficient in an RT space.
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Project the rows of the matrix coefficient in an ND space.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
RefinedBiLinear2DFiniteElement()
Construct the RefinedBiLinear2DFiniteElement.
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
NodalTensorFiniteElement(const int dims, const int p, const int btype, const DofMapType dmtype)
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 LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
L2Pos_TriangleElement(const int p)
Construct the L2Pos_TriangleElement of order p.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
H1Pos_SegmentElement(const int p)
Construct the H1Pos_SegmentElement of order p.
Basis(const int p, const double *nodes, EvalType etype=Barycentric)
Create a nodal or positive (Bernstein) basis.
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
bool IsIntegratedType() const
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Base class for vector Coefficients that optionally depend on time and space.
void SetRow(int r, const double *row)
void InvRightScaling(const Vector &s)
InvRightScaling: this = this * diag(1./s);.
virtual void CalcPhysHessian(ElementTransformation &Trans, DenseMatrix &Hessian) const
Evaluate the Hessian of all shape functions of a scalar finite element in reference space at the give...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given 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 ...
Array< const KnotVector * > kv
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 CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in physical space at the po...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual function which evaluates the values of all shape functions at a given point ip and stores the...
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
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 Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
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)
static void GivePolyPoints(const int np, double *pts, const int type)
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...
PointFiniteElement()
Construct the PointFiniteElement.
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Integrated GLL indicator functions.
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
void SetSize(int s)
Resize the vector to size s.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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...
virtual void CalcPhysLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
Evaluate the Laplacian 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 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 ...
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 CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Compute the Hessian of second order partial derivatives at ip.
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
FiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Construct FiniteElement with given.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
H1Pos_SegmentElement SegmentFE
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
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(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
H1Pos_TetrahedronElement(const int p)
Construct the H1Pos_TetrahedronElement of order p.
int dim
Dimension of reference space.
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...
double InnerProduct(const double *x, const double *y) const
Compute y^t A x.
LagrangeHexFiniteElement(int degree)
Construct the LagrangeHexFiniteElement with the provided degree.
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_SegmentElement of order p and BasisType btype.
BiQuadPos2DFiniteElement()
Construct the BiQuadPos2DFiniteElement.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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 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 nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
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...
GaussBiQuad2DFiniteElement()
Construct the GaussBiQuad2DFiniteElement.
int Size() const
Returns the size of the vector.
Array< double > Gt
Transpose of G.
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
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 ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number...
~VectorTensorFiniteElement()
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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 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...
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
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 SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
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 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...
RefinedTriLinear3DFiniteElement()
Construct the RefinedTriLinear3DFiniteElement.
P0QuadFiniteElement()
Construct the P0QuadFiniteElement.
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...
Quadratic3DFiniteElement()
Construct the Quadratic3DFiniteElement.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
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...
void Factor()
Factor the current DenseMatrix, *a.
Geometry::Type geom_type
Geometry::Type of the reference element.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector 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...
Intermediate class for finite elements whose basis functions return vector values.
static void CalcLegendre(const int p, const double x, double *u)
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get the matrix I that defines nodal interpolation between this element and the refined element fine_f...
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 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...
const IntegrationPoint & GetCenter(int GeomType)
Return the center of the given Geometry::Type, GeomType.
RT1HexFiniteElement()
Construct the RT1HexFiniteElement.
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 ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
RT0QuadFiniteElement()
Construct the RT0QuadFiniteElement.
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
double * GetData() const
Return a pointer to the beginning of the Vector data.
RT1QuadFiniteElement()
Construct the RT1QuadFiniteElement.
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
const DofToQuad & GetTensorDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode, const bool closed) const
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 CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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...
Linear2DFiniteElement()
Construct the Linear2DFiniteElement.
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Get coordinates of a closed (GaussLegendre) set of points if degree 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...
Possible basis types. Note that not all elements can use all BasisType(s).
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...
void add(const Vector &v1, const Vector &v2, Vector &v)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Cubic2DFiniteElement()
Construct the Cubic2DFiniteElement.
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_HexahedronElement of order p and BasisType btype.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector 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 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 CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
L2Pos_HexahedronElement(const int p)
Construct the L2Pos_HexahedronElement of order p.
ND_TriangleElement(const int p)
Construct the ND_TriangleElement of order p.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
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...
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
int GetHeight() const
Get the height of the matrix.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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...
const double * GetPoints(const int p, const int btype)
Get the coordinates of the points of the given BasisType, btype.
H1Pos_TriangleElement(const int p)
Construct the H1Pos_TriangleElement of order p.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Poly_1D::Basis & obasis1d
Cubic3DFiniteElement()
Construct the Cubic3DFiniteElement.
Linear1DFiniteElement()
Construct the Linear1DFiniteElement.
A 1D element with uniform nodes.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT0HexFiniteElement()
Construct the RT0HexFiniteElement.
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...
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Class for standard nodal finite elements.
void ScalarLocalRestriction(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...
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference 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...
CrouzeixRaviartFiniteElement()
Construct the CrouzeixRaviartFiniteElement.
static void CalcShape(const int p, const double x, const double y, double *shape)
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...
VectorTensorFiniteElement(const int dims, const int d, const int p, const int cbtype, const int obtype, const int M, const DofMapType dmtype)
Class for finite elements with basis functions that return scalar values.
void SetSize(int m, int n)
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...
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
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 AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat)
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void CalcAdjugateTranspose(const DenseMatrix &a, DenseMatrix &adjat)
Calculate the transposed adjugate of a matrix (for NxN matrices, N=1,2,3)
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
Poly_1D::Basis & cbasis1d
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
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...
RefinedLinear1DFiniteElement()
Construct the RefinedLinear1DFiniteElement.
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...
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_HexahedronElement of order p and closed and open BasisType cb_type and ob_type...
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 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
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
static void ChebyshevPoints(const int p, double *x)
Compute the points for the Chebyshev polynomials of order p and place them in the already allocated x...
void AddMult_a_VWt(const double a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
Cubic1DFiniteElement()
Construct the Cubic1DFiniteElement.
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_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...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
ND_TetrahedronElement(const int p)
Construct the ND_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...
Nedelec1TetFiniteElement()
Construct the Nedelec1TetFiniteElement.
RT2QuadFiniteElement()
Construct the RT2QuadFiniteElement.
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
H1_QuadrilateralElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_QuadrilateralElement of order p and BasisType btype.
GaussLinear2DFiniteElement()
Construct the GaussLinear2DFiniteElement.
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...
void Invert()
Replaces the current matrix with its inverse.
class FiniteElement * FE
The FiniteElement that created and owns this object.
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 Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
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...
L2Pos_QuadrilateralElement(const int p)
Construct the L2Pos_QuadrilateralElement of order p.
P1TetNonConfFiniteElement()
Construct the P1TetNonConfFiniteElement.
P0SegmentFiniteElement(int Ord=0)
Construct the P0SegmentFiniteElement with dummy order Ord.
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...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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 AddMult_a_VVt(const double a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
void EvalIntegrated(const Vector &d, Vector &i) const
A 3D linear element on a tetrahedron with nodes at the vertices of the tetrahedron.
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_SegmentElement of order p and BasisType btype.
Nedelec1HexFiniteElement()
Construct the Nedelec1HexFiniteElement.
int orders[Geometry::MaxDim]
Anisotropic orders.
void Set2(const double x1, const double x2)
virtual ~FiniteElement()
Deconstruct the FiniteElement.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
A 2D linear element on triangle with nodes at the vertices of the triangle.
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector 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...
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_QuadrilateralElement of order p and BasisType btype.
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...
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void GetColumn(int c, Vector &col) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual function which evaluates the values of all partial derivatives of all shape functions at a gi...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Get coordinates of an open (GaussLegendre) set of points if degree p.
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 CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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 H1_WedgeElement WedgeFE
L2_WedgeElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_WedgeElement of order p and BasisType btype.
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...
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 ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_TetrahedronElement of order p and BasisType btype.
RT0TetFiniteElement()
Construct the RT0TetFiniteElement.
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 Threshold(double eps)
Replace small entries, abs(a_ij) <= eps, with zero.
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
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 CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
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
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...
Array< double > Bt
Transpose of B.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
P0HexFiniteElement()
Construct the P0HexFiniteElement.
double * Data() const
Returns the matrix data array.
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
P1SegmentFiniteElement()
Construct the P1SegmentFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
void LocalInterpolation_ND(const VectorFiniteElement &cfe, const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
double p(const Vector &x, double t)
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
H1Pos_TriangleElement TriangleFE
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
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...
BiCubic2DFiniteElement()
Construct the BiCubic2DFiniteElement.
~LagrangeHexFiniteElement()
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
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.
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...
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
P0TetFiniteElement()
Construct the P0TetFiniteElement.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
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 CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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 CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Base class for Matrix Coefficients that optionally depend on time and 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...
void MultAAt(const DenseMatrix &a, DenseMatrix &aat)
Calculate the matrix A.At.
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.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
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...
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TetrahedronElement of order p and BasisType btype.
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
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 Linear3DFiniteElement TetrahedronFE
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
L2Pos_TriangleElement TriangleFE
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
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
Linear2DFiniteElement TriangleFE
A 2D bi-linear element on a square with nodes at the vertices of the square.
Array< double > B
Basis functions evaluated at quadrature points.
const Array< int > & GetDofMap() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
Quad1DFiniteElement()
Construct the Quad1DFiniteElement.
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 GetFaceDofs(int face, int **dofs, int *ndofs) const
Get the dofs associated with the given face. *dofs is set to an internal array of the local dofc on t...
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...
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
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement 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 LocalRestriction_ND(const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &R) const
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TriangleElement of order p and BasisType btype.
Class for integration point with weight.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
Full multidimensional representation which does not use tensor product structure. The ordering of the...
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
L2Pos_SegmentElement SegmentFE
const Poly_1D::Basis & GetBasis1D() const
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...
const DofToQuad & GetDofToQuadOpen(const IntegrationRule &ir, DofToQuad::Mode mode) const
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 Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Project a vector coefficient onto the RT basis functions.
int dof
Number of degrees of freedom.
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...
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
H1_WedgeElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_WedgeElement 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...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
static int VerifyClosed(int b_type)
Ensure that the BasisType of b_type is closed (has Quadrature1D points on the boundary).
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
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...
Implements CalcDivShape methods.
virtual void AssembleElementMatrix2(const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans, DenseMatrix &elmat)
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
RefinedLinear2DFiniteElement()
Construct the RefinedLinear2DFiniteElement.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
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...
Array< double > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
RT_TetrahedronElement(const int p)
Construct the RT_TetrahedronElement 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...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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...
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
BiQuad2DFiniteElement()
Construct the BiQuad2DFiniteElement.
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Get the dofs associated with the given face. *dofs is set to an internal array of the local dofc on t...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
P0TriangleFiniteElement()
Construct the P0TriangleFiniteElement.
static int VerifyNodal(int b_type)
Ensure that the BasisType of b_type nodal (satisfies the interpolation property). ...
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 double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
H1Ser_QuadrilateralElement(const int p)
Construct the H1Ser_QuadrilateralElement of order p.
RT_TriangleElement(const int p)
Construct the RT_TriangleElement of order p.
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
void Eval(const double x, Vector &u) const
void LocalL2Projection_ND(const VectorFiniteElement &cfe, ElementTransformation &Trans, DenseMatrix &I) const
L2Pos_SegmentElement(const int p)
Construct the L2Pos_SegmentElement of order p.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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 Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
void MultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
Multiply the transpose of a matrix A with a matrix B: At*B.
void InvertLinearTrans(ElementTransformation &trans, const IntegrationPoint &pt, Vector &x)
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void Mult(const double *x, double *y) const
Matrix vector multiplication.
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 SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
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 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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Quad2DFiniteElement()
Construct the Quad2DFiniteElement.
int GetWidth() const
Get the width of the matrix.
void LocalRestriction_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &R) const
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
Describes the function space on each element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void pts(int iphi, int t, double x[])
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
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...
GaussBiLinear2DFiniteElement()
Construct the FiniteElement.
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_HexahedronElement of order p and closed and open BasisType cb_type and ob_type...
double u(const Vector &xvec)
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given 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...
Arbitrary order H1 elements in 3D on a wedge.
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
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 CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
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)
Change the size of the DenseMatrix to s x 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...
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector 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...
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
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...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
P1OnQuadFiniteElement()
Construct the P1OnQuadFiniteElement.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
RotTriLinearHexFiniteElement()
Construct the RotTriLinearHexFiniteElement.
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_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Project a vector coefficient onto the ND basis functions.
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, 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...
double FNorm2() const
Compute the square of the Frobenius norm of the matrix.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
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
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...
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_HexahedronElement of order p and BasisType btype.
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
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 AddMult_a_AAt(double a, const DenseMatrix &A, DenseMatrix &AAt)
AAt += a * A * A^t.
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 CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
const IntegrationRule * IntRule
IntegrationRule that defines the quadrature points at which the basis functions of the FE are evaluat...
TriLinear3DFiniteElement()
Construct the TriLinear3DFiniteElement.
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 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
const DofToQuad & GetTensorDofToQuad(const class TensorBasisElement &tb, const IntegrationRule &ir, DofToQuad::Mode mode) const
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.
BiLinear2DFiniteElement()
Construct the BiLinear2DFiniteElement.
void LocalL2Projection_RT(const VectorFiniteElement &cfe, ElementTransformation &Trans, DenseMatrix &I) const
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...
Lagrange1DFiniteElement(int degree)
Construct the Lagrange1DFiniteElement with the provided degree.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
No derivatives implemented.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Implements CalcCurlShape methods.
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...
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 ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...