16 #include "../mesh/nurbs.hpp"
35 #ifndef MFEM_THREAD_SAFE
43 mfem_error (
"FiniteElement::CalcVShape (ip, ...)\n"
44 " is not implemented for this class!");
50 mfem_error (
"FiniteElement::CalcVShape (trans, ...)\n"
51 " is not implemented for this class!");
57 mfem_error (
"FiniteElement::CalcDivShape (ip, ...)\n"
58 " is not implemented for this class!");
65 div_shape *= (1.0 / Trans.
Weight());
71 mfem_error (
"FiniteElement::CalcCurlShape (ip, ...)\n"
72 " is not implemented for this class!");
82 #ifdef MFEM_THREAD_SAFE
87 curl_shape *= (1.0 / Trans.
Weight());
93 curl_shape *= (1.0 / Trans.
Weight());
96 MFEM_ABORT(
"Invalid dimension, Dim = " <<
Dim);
102 mfem_error (
"FiniteElement::GetFaceDofs (...)");
108 mfem_error (
"FiniteElement::CalcHessian (...) is not overloaded !");
114 mfem_error (
"GetLocalInterpolation (...) is not overloaded !");
120 mfem_error(
"FiniteElement::GetLocalRestriction() is not overloaded !");
127 MFEM_ABORT(
"method is not overloaded !");
133 mfem_error (
"FiniteElement::Project (...) is not overloaded !");
139 mfem_error (
"FiniteElement::Project (...) (vector) is not overloaded !");
145 mfem_error(
"FiniteElement::ProjectMatrixCoefficient() is not overloaded !");
150 mfem_error(
"FiniteElement::ProjectDelta(...) is not implemented for "
157 mfem_error(
"FiniteElement::Project(...) (fe version) is not implemented "
158 "for this element!");
165 mfem_error(
"FiniteElement::ProjectGrad(...) is not implemented for "
173 mfem_error(
"FiniteElement::ProjectCurl(...) is not implemented for "
181 mfem_error(
"FiniteElement::ProjectDiv(...) is not implemented for "
199 #ifdef MFEM_THREAD_SAFE
219 int size = (
Dim*(
Dim+1))/2;
225 for (
int nd = 0; nd <
Dof; nd++)
227 Laplacian[nd] = hess(nd,0) + hess(nd,4) + hess(nd,5);
232 for (
int nd = 0; nd <
Dof; nd++)
234 Laplacian[nd] = hess(nd,0) + hess(nd,2);
239 for (
int nd = 0; nd <
Dof; nd++)
241 Laplacian[nd] = hess(nd,0);
252 int size = (
Dim*(
Dim+1))/2;
263 scale[1] = 2*Gij(0,1);
264 scale[2] = 2*Gij(0,2);
266 scale[3] = 2*Gij(1,2);
274 scale[1] = 2*Gij(0,1);
282 for (
int nd = 0; nd <
Dof; nd++)
285 for (
int ii = 0; ii < size; ii++)
287 Laplacian[nd] += hess(nd,ii)*scale[ii];
328 int size = (Dim*(Dim+1))/2;
346 for (
int i = 0; i <
Dim; i++)
348 for (
int j = 0; j <
Dim; j++)
350 for (
int k = 0; k <
Dim; k++)
352 for (
int l = 0; l <
Dim; l++)
354 lhm(map[i*Dim+j],map[k*Dim+l]) += invJ(i,k)*invJ(j,l);
362 for (
int i = 0; i < Dim*
Dim; i++) { mult[map[i]]++; }
367 Mult( hess, lhm, Hessian);
373 mfem_error(
"FiniteElement::GetDofToQuad(...) is not implemented for "
395 #ifdef MFEM_THREAD_SAFE
402 for (
int i = 0; i < fine_fe.
Dof; i++)
407 for (
int j = 0; j <
Dof; j++)
408 if (fabs(I(i,j) =
c_shape(j)) < 1.0e-12)
433 Vector fine_shape(fs), coarse_shape(cs);
434 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
451 fine_mass_inv.
Mult(fine_coarse_mass, I);
469 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
483 #ifdef MFEM_THREAD_SAFE
487 for (
int i = 0; i < nqpt; i++)
491 for (
int j = 0; j <
Dof; j++)
493 d2q->
B[i+nqpt*j] = d2q->
Bt[j+Dof*i] =
c_shape(j);
496 for (
int d = 0; d <
Dim; d++)
498 for (
int j = 0; j <
Dof; j++)
500 d2q->
G[i+nqpt*(d+Dim*j)] = d2q->
Gt[j+Dof*(i+nqpt*d)] =
vshape(j,d);
518 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
523 const int ndof =
Order + 1;
524 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
Dim) + 0.5);
534 Vector val(ndof), grad(ndof);
535 for (
int i = 0; i < nqpt; i++)
540 for (
int j = 0; j < ndof; j++)
542 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
543 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
560 for (
int i = 0; i <
Dof; i++)
563 for (
int j = 0; j < fe.
GetDof(); j++)
565 curl(i,j) = curl_shape(j,0);
592 #ifdef MFEM_THREAD_SAFE
598 for (
int j = 0; j <
Dof; j++)
618 for (
int i = 0; i <
Dof; i++)
624 dofs(i) = coeff.
Eval (Trans, ip);
627 dofs(i) *= Trans.
Weight();
638 for (
int i = 0; i <
Dof; i++)
642 vc.
Eval (x, Trans, ip);
647 for (
int j = 0; j < x.Size(); j++)
649 dofs(Dof*j+i) = x(j);
661 for (
int k = 0; k <
Dof; k++)
666 for (
int r = 0; r < MQ.Height(); r++)
668 for (
int d = 0; d < MQ.Width(); d++)
670 dofs(k+Dof*(d+MQ.Width()*r)) = MQ(r,d);
686 for (
int k = 0; k <
Dof; k++)
689 for (
int j = 0; j < shape.Size(); j++)
691 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
700 for (
int k = 0; k <
Dof; k++)
711 I(k+d*Dof,j) =
vshape(j,d);
727 for (
int k = 0; k <
Dof; k++)
733 Mult(dshape, Jinv, grad_k);
738 for (
int j = 0; j < grad_k.Height(); j++)
739 for (
int d = 0; d <
Dim; d++)
741 grad(k+d*Dof,j) = grad_k(j,d);
754 for (
int k = 0; k <
Dof; k++)
762 for (
int j = 0; j < div_shape.Size(); j++)
764 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j)/detJ;
769 for (
int j = 0; j < div_shape.Size(); j++)
771 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j);
781 for (
int i = 0; i <
Dof; i++)
785 dofs(i) = coeff.
Eval(Trans, ip);
795 for (
int i = 0; i <
Dof; i++)
799 vc.
Eval (x, Trans, ip);
800 for (
int j = 0; j < x.Size(); j++)
802 dofs(Dof*j+i) = x(j);
829 pos_mass_inv.
Mult(mixed_mass, I);
834 void VectorFiniteElement::CalcShape (
837 mfem_error (
"Error: Cannot use scalar CalcShape(...) function with\n"
838 " VectorFiniteElements!");
841 void VectorFiniteElement::CalcDShape (
842 const IntegrationPoint &ip, DenseMatrix &dshape )
const
844 mfem_error (
"Error: Cannot use scalar CalcDShape(...) function with\n"
845 " VectorFiniteElements!");
877 MFEM_ABORT(
"Invalid dimension, Dim = " <<
Dim);
881 MFEM_ABORT(
"Invalid MapType = " <<
MapType);
889 #ifdef MFEM_THREAD_SAFE
894 shape *= (1.0 / Trans.
Weight());
901 #ifdef MFEM_THREAD_SAFE
914 MFEM_ASSERT(vc.
GetVDim() == sdim,
"");
916 const bool square_J = (
Dim == sdim);
918 for (
int k = 0; k <
Dof; k++)
924 if (!square_J) { dofs(k) /= Trans.
Weight(); }
935 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
936 const bool square_J = (
Dim == sdim);
938 Vector nk_phys(sdim), dofs_k(MQ.Height());
939 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
941 for (
int k = 0; k <
Dof; k++)
947 if (!square_J) { nk_phys /= T.
Weight(); }
948 MQ.Mult(nk_phys, dofs_k);
949 for (
int r = 0; r < MQ.Height(); r++)
951 dofs(k+Dof*r) = dofs_k(r);
967 for (
int k = 0; k <
Dof; k++)
976 double w = 1.0/Trans.
Weight();
977 for (
int d = 0; d <
Dim; d++)
983 for (
int j = 0; j < shape.Size(); j++)
990 for (
int d = 0; d < sdim; d++)
992 I(k,j+d*shape.Size()) = s*vk[d];
999 mfem_error(
"VectorFiniteElement::Project_RT (fe version)");
1009 mfem_error(
"VectorFiniteElement::ProjectGrad_RT works only in 2D!");
1017 for (
int k = 0; k <
Dof; k++)
1020 tk[0] = nk[d2n[k]*
Dim+1];
1021 tk[1] = -nk[d2n[k]*
Dim];
1022 dshape.Mult(tk, grad_k);
1023 for (
int j = 0; j < grad_k.Size(); j++)
1025 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1034 #ifdef MFEM_THREAD_SAFE
1047 for (
int k = 0; k <
Dof; k++)
1054 J *= 1.0 / Trans.
Weight();
1061 for (
int j = 0; j < curl_k.Size(); j++)
1063 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1076 for (
int k = 0; k <
Dof; k++)
1079 curl_shape.Mult(nk + d2n[k]*
Dim, curl_k);
1080 for (
int j = 0; j < curl_k.Size(); j++)
1082 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1094 for (
int k = 0; k <
Dof; k++)
1111 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
1113 Vector tk_phys(sdim), dofs_k(MQ.Height());
1114 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
1116 for (
int k = 0; k <
Dof; k++)
1122 MQ.Mult(tk_phys, dofs_k);
1123 for (
int r = 0; r < MQ.Height(); r++)
1125 dofs(k+Dof*r) = dofs_k(r);
1141 for (
int k = 0; k <
Dof; k++)
1150 double w = 1.0/Trans.
Weight();
1151 for (
int d = 0; d < sdim; d++)
1157 for (
int j = 0; j < shape.Size(); j++)
1159 double s = shape(j);
1160 if (fabs(s) < 1e-12)
1164 for (
int d = 0; d < sdim; d++)
1166 I(k, j + d*shape.Size()) = s*vk[d];
1173 mfem_error(
"VectorFiniteElement::Project_ND (fe version)");
1187 for (
int k = 0; k <
Dof; k++)
1190 dshape.Mult(tk + d2t[k]*
Dim, grad_k);
1191 for (
int j = 0; j < grad_k.Size(); j++)
1193 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1207 #ifdef MFEM_THREAD_SAFE
1217 for (
int k = 0; k <
Dof; k++)
1228 for (
int i = 0; i <
Dim; i++)
1230 Ikj +=
vshape(j, i) * vk[i];
1232 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1244 #ifdef MFEM_THREAD_SAFE
1254 for (
int k = 0; k <
Dof; k++)
1265 for (
int i = 0; i <
Dim; i++)
1267 Ikj +=
vshape(j, i) * vk[i];
1269 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1282 #ifdef MFEM_THREAD_SAFE
1288 const double weight = Trans.
Weight();
1289 for (
int j = 0; j <
Dof; j++)
1298 for (
int k = 0; k <
Dof; k++)
1301 for (
int d = 0; d <
Dim; d++)
1303 R_jk +=
vshape(k,d)*pt_data[d];
1325 #ifdef MFEM_THREAD_SAFE
1331 for (
int j = 0; j <
Dof; j++)
1338 Jinv.
Mult(tk+
Dim*d2t[j], pt_data);
1339 for (
int k = 0; k <
Dof; k++)
1342 for (
int d = 0; d <
Dim; d++)
1344 R_jk +=
vshape(k,d)*pt_data[d];
1387 shape(0) = 1. - ip.
x;
1412 shape(0) = 1. - ip.
x - ip.
y;
1420 dshape(0,0) = -1.; dshape(0,1) = -1.;
1421 dshape(1,0) = 1.; dshape(1,1) = 0.;
1422 dshape(2,0) = 0.; dshape(2,1) = 1.;
1441 shape(0) = (1. - ip.
x) * (1. - ip.
y) ;
1442 shape(1) = ip.
x * (1. - ip.
y) ;
1443 shape(2) = ip.
x * ip.
y ;
1444 shape(3) = (1. - ip.
x) * ip.
y ;
1450 dshape(0,0) = -1. + ip.
y; dshape(0,1) = -1. + ip.
x ;
1451 dshape(1,0) = 1. - ip.
y; dshape(1,1) = -ip.
x ;
1452 dshape(2,0) = ip.
y ; dshape(2,1) = ip.
x ;
1453 dshape(3,0) = -ip.
y ; dshape(3,1) = 1. - ip.
x ;
1459 h(0,0) = 0.; h(0,1) = 1.; h(0,2) = 0.;
1460 h(1,0) = 0.; h(1,1) = -1.; h(1,2) = 0.;
1461 h(2,0) = 0.; h(2,1) = 1.; h(2,2) = 0.;
1462 h(3,0) = 0.; h(3,1) = -1.; h(3,2) = 0.;
1480 const double x = ip.
x, y = ip.
y;
1482 shape(0) = 5./3. - 2. * (x + y);
1483 shape(1) = 2. * (x - 1./6.);
1484 shape(2) = 2. * (y - 1./6.);
1490 dshape(0,0) = -2.; dshape(0,1) = -2.;
1491 dshape(1,0) = 2.; dshape(1,1) = 0.;
1492 dshape(2,0) = 0.; dshape(2,1) = 2.;
1497 dofs(vertex) = 2./3.;
1498 dofs((vertex+1)%3) = 1./6.;
1499 dofs((vertex+2)%3) = 1./6.;
1504 const double GaussBiLinear2DFiniteElement::p[] =
1505 { 0.2113248654051871177454256, 0.7886751345948128822545744 };
1523 const double x = ip.
x, y = ip.
y;
1525 shape(0) = 3. * (p[1] - x) * (p[1] - y);
1526 shape(1) = 3. * (x - p[0]) * (p[1] - y);
1527 shape(2) = 3. * (x - p[0]) * (y - p[0]);
1528 shape(3) = 3. * (p[1] - x) * (y - p[0]);
1534 const double x = ip.
x, y = ip.
y;
1536 dshape(0,0) = 3. * (y - p[1]); dshape(0,1) = 3. * (x - p[1]);
1537 dshape(1,0) = 3. * (p[1] - y); dshape(1,1) = 3. * (p[0] - x);
1538 dshape(2,0) = 3. * (y - p[0]); dshape(2,1) = 3. * (x - p[0]);
1539 dshape(3,0) = 3. * (p[0] - y); dshape(3,1) = 3. * (p[1] - x);
1545 dofs(vertex) = p[1]*p[1];
1546 dofs((vertex+1)%4) = p[0]*p[1];
1547 dofs((vertex+2)%4) = p[0]*p[0];
1548 dofs((vertex+3)%4) = p[0]*p[1];
1569 shape(0) = 1. - ip.
x - ip.
y;
1577 dshape(0,0) = -1.; dshape(0,1) = -1.;
1578 dshape(1,0) = 1.; dshape(1,1) = 0.;
1579 dshape(2,0) = 0.; dshape(2,1) = 1.;
1595 double l1 = 1.0 - x, l2 = x, l3 = 2. * x - 1.;
1597 shape(0) = l1 * (-l3);
1599 shape(2) = 4. * l1 * l2;
1607 dshape(0,0) = 4. * x - 3.;
1608 dshape(1,0) = 4. * x - 1.;
1609 dshape(2,0) = 4. - 8. * x;
1624 const double x = ip.
x, x1 = 1. - x;
1628 shape(2) = 2. * x * x1;
1634 const double x = ip.
x;
1636 dshape(0,0) = 2. * x - 2.;
1637 dshape(1,0) = 2. * x;
1638 dshape(2,0) = 2. - 4. * x;
1661 double x = ip.
x, y = ip.
y;
1662 double l1 = 1.-x-y, l2 = x, l3 = y;
1664 shape(0) = l1 * (2. * l1 - 1.);
1665 shape(1) = l2 * (2. * l2 - 1.);
1666 shape(2) = l3 * (2. * l3 - 1.);
1667 shape(3) = 4. * l1 * l2;
1668 shape(4) = 4. * l2 * l3;
1669 shape(5) = 4. * l3 * l1;
1675 double x = ip.
x, y = ip.
y;
1678 dshape(0,1) = 4. * (x + y) - 3.;
1680 dshape(1,0) = 4. * x - 1.;
1684 dshape(2,1) = 4. * y - 1.;
1686 dshape(3,0) = -4. * (2. * x + y - 1.);
1687 dshape(3,1) = -4. * x;
1689 dshape(4,0) = 4. * y;
1690 dshape(4,1) = 4. * x;
1692 dshape(5,0) = -4. * y;
1693 dshape(5,1) = -4. * (x + 2. * y - 1.);
1733 case 0: dofs(3) = 0.25; dofs(5) = 0.25;
break;
1734 case 1: dofs(3) = 0.25; dofs(4) = 0.25;
break;
1735 case 2: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1741 const double GaussQuad2DFiniteElement::p[] =
1742 { 0.0915762135097707434595714634022015, 0.445948490915964886318329253883051 };
1760 for (
int i = 0; i < 6; i++)
1777 const double x = ip.
x, y = ip.
y;
1791 const double x = ip.
x, y = ip.
y;
1792 D(0,0) = 0.; D(0,1) = 0.;
1793 D(1,0) = 1.; D(1,1) = 0.;
1794 D(2,0) = 0.; D(2,1) = 1.;
1795 D(3,0) = 2. * x; D(3,1) = 0.;
1796 D(4,0) = y; D(4,1) = x;
1797 D(5,0) = 0.; D(5,1) = 2. * y;
1829 double x = ip.
x, y = ip.
y;
1830 double l1x, l2x, l3x, l1y, l2y, l3y;
1832 l1x = (x - 1.) * (2. * x - 1);
1833 l2x = 4. * x * (1. - x);
1834 l3x = x * (2. * x - 1.);
1835 l1y = (y - 1.) * (2. * y - 1);
1836 l2y = 4. * y * (1. - y);
1837 l3y = y * (2. * y - 1.);
1839 shape(0) = l1x * l1y;
1840 shape(4) = l2x * l1y;
1841 shape(1) = l3x * l1y;
1842 shape(7) = l1x * l2y;
1843 shape(8) = l2x * l2y;
1844 shape(5) = l3x * l2y;
1845 shape(3) = l1x * l3y;
1846 shape(6) = l2x * l3y;
1847 shape(2) = l3x * l3y;
1853 double x = ip.
x, y = ip.
y;
1854 double l1x, l2x, l3x, l1y, l2y, l3y;
1855 double d1x, d2x, d3x, d1y, d2y, d3y;
1857 l1x = (x - 1.) * (2. * x - 1);
1858 l2x = 4. * x * (1. - x);
1859 l3x = x * (2. * x - 1.);
1860 l1y = (y - 1.) * (2. * y - 1);
1861 l2y = 4. * y * (1. - y);
1862 l3y = y * (2. * y - 1.);
1871 dshape(0,0) = d1x * l1y;
1872 dshape(0,1) = l1x * d1y;
1874 dshape(4,0) = d2x * l1y;
1875 dshape(4,1) = l2x * d1y;
1877 dshape(1,0) = d3x * l1y;
1878 dshape(1,1) = l3x * d1y;
1880 dshape(7,0) = d1x * l2y;
1881 dshape(7,1) = l1x * d2y;
1883 dshape(8,0) = d2x * l2y;
1884 dshape(8,1) = l2x * d2y;
1886 dshape(5,0) = d3x * l2y;
1887 dshape(5,1) = l3x * d2y;
1889 dshape(3,0) = d1x * l3y;
1890 dshape(3,1) = l1x * d3y;
1892 dshape(6,0) = d2x * l3y;
1893 dshape(6,1) = l2x * d3y;
1895 dshape(2,0) = d3x * l3y;
1896 dshape(2,1) = l3x * d3y;
1908 case 0: dofs(4) = 0.25; dofs(7) = 0.25;
break;
1909 case 1: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1910 case 2: dofs(5) = 0.25; dofs(6) = 0.25;
break;
1911 case 3: dofs(6) = 0.25; dofs(7) = 0.25;
break;
1927 TensorBasisElement::DofMapType::Sr_DOF_MAP);
1938 for (
int j = 0; j <= p; j++)
1940 for (
int i = 0; i <= p; i++)
1956 double x = ip.
x, y = ip.
y;
1962 edgeNodalBasis.Eval(x, nodalX);
1963 edgeNodalBasis.Eval(y, nodalY);
1967 for (
int i = 0; i < p-1; i++)
1969 shape(4 + 0*(p-1) + i) = (nodalX(i+1))*(1.-y);
1970 shape(4 + 1*(p-1) + i) = (nodalY(i+1))*x;
1971 shape(4 + 3*(p-1) - i - 1) = (nodalX(i+1)) * y;
1972 shape(4 + 4*(p-1) - i - 1) = (nodalY(i+1)) * (1. - x);
1990 for (
int i = 0; i<p-1; i++)
1992 vtx0fix += (1-edgePts[i+1])*(shape(4 + i) +
1993 shape(4 + 4*(p-1) - i - 1));
1994 vtx1fix += (1-edgePts[i+1])*(shape(4 + 1*(p-1) + i) +
1995 shape(4 + (p-2)-i));
1996 vtx2fix += (1-edgePts[i+1])*(shape(4 + 2*(p-1) + i) +
1998 vtx3fix += (1-edgePts[i+1])*(shape(4 + 3*(p-1) + i) +
2001 shape(0) = bilinearsAtIP(0) - vtx0fix;
2002 shape(1) = bilinearsAtIP(1) - vtx1fix;
2003 shape(2) = bilinearsAtIP(2) - vtx2fix;
2004 shape(3) = bilinearsAtIP(3) - vtx3fix;
2010 double *legX =
new double[p-1];
2011 double *legY =
new double[p-1];
2017 int interior_total = 0;
2018 for (
int j = 4; j < p + 1; j++)
2020 for (
int k = 0; k < j-3; k++)
2022 shape(4 + 4*(p-1) + interior_total)
2023 = legX[k] * legY[j-4-k] * x * (1. - x) * y * (1. - y);
2030 delete storeLegendre;
2038 double x = ip.
x, y = ip.
y;
2046 edgeNodalBasis.Eval(x, nodalX, DnodalX);
2047 edgeNodalBasis.Eval(y, nodalY, DnodalY);
2049 for (
int i = 0; i < p-1; i++)
2051 dshape(4 + 0*(p-1) + i,0) = DnodalX(i+1) * (1.-y);
2052 dshape(4 + 0*(p-1) + i,1) = -nodalX(i+1);
2053 dshape(4 + 1*(p-1) + i,0) = nodalY(i+1);
2054 dshape(4 + 1*(p-1) + i,1) = DnodalY(i+1)*x;
2055 dshape(4 + 3*(p-1) - i - 1,0) = DnodalX(i+1)*y;
2056 dshape(4 + 3*(p-1) - i - 1,1) = nodalX(i+1);
2057 dshape(4 + 4*(p-1) - i - 1,0) = -nodalY(i+1);
2058 dshape(4 + 4*(p-1) - i - 1,1) = DnodalY(i+1) * (1.-x);
2067 dshape(0,0) = DbilinearsAtIP(0,0);
2068 dshape(0,1) = DbilinearsAtIP(0,1);
2069 dshape(1,0) = DbilinearsAtIP(1,0);
2070 dshape(1,1) = DbilinearsAtIP(1,1);
2071 dshape(2,0) = DbilinearsAtIP(2,0);
2072 dshape(2,1) = DbilinearsAtIP(2,1);
2073 dshape(3,0) = DbilinearsAtIP(3,0);
2074 dshape(3,1) = DbilinearsAtIP(3,1);
2076 for (
int i = 0; i<p-1; i++)
2078 dshape(0,0) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 0) +
2079 dshape(4 + 4*(p-1) - i - 1,0));
2080 dshape(0,1) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 1) +
2081 dshape(4 + 4*(p-1) - i - 1,1));
2082 dshape(1,0) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 0) +
2083 dshape(4 + (p-2)-i, 0));
2084 dshape(1,1) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 1) +
2085 dshape(4 + (p-2)-i, 1));
2086 dshape(2,0) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 0) +
2087 dshape(1 + 2*p-i, 0));
2088 dshape(2,1) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 1) +
2089 dshape(1 + 2*p-i, 1));
2090 dshape(3,0) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 0) +
2091 dshape(3*p - i, 0));
2092 dshape(3,1) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 1) +
2093 dshape(3*p - i, 1));
2098 double *legX =
new double[p-1];
2099 double *legY =
new double[p-1];
2100 double *DlegX =
new double[p-1];
2101 double *DlegY =
new double[p-1];
2107 int interior_total = 0;
2108 for (
int j = 4; j < p + 1; j++)
2110 for (
int k = 0; k < j-3; k++)
2112 dshape(4 + 4*(p-1) + interior_total, 0) =
2113 legY[j-4-k]*y*(1-y) * (DlegX[k]*x*(1-x) + legX[k]*(1-2*x));
2114 dshape(4 + 4*(p-1) + interior_total, 1) =
2115 legX[k]*x*(1-x) * (DlegY[j-4-k]*y*(1-y) + legY[j-4-k]*(1-2*y));
2123 delete storeLegendre;
2170 double x = ip.
x, y = ip.
y;
2171 double l1x, l2x, l3x, l1y, l2y, l3y;
2173 l1x = (1. - x) * (1. - x);
2174 l2x = 2. * x * (1. - x);
2176 l1y = (1. - y) * (1. - y);
2177 l2y = 2. * y * (1. - y);
2180 shape(0) = l1x * l1y;
2181 shape(4) = l2x * l1y;
2182 shape(1) = l3x * l1y;
2183 shape(7) = l1x * l2y;
2184 shape(8) = l2x * l2y;
2185 shape(5) = l3x * l2y;
2186 shape(3) = l1x * l3y;
2187 shape(6) = l2x * l3y;
2188 shape(2) = l3x * l3y;
2194 double x = ip.
x, y = ip.
y;
2195 double l1x, l2x, l3x, l1y, l2y, l3y;
2196 double d1x, d2x, d3x, d1y, d2y, d3y;
2198 l1x = (1. - x) * (1. - x);
2199 l2x = 2. * x * (1. - x);
2201 l1y = (1. - y) * (1. - y);
2202 l2y = 2. * y * (1. - y);
2212 dshape(0,0) = d1x * l1y;
2213 dshape(0,1) = l1x * d1y;
2215 dshape(4,0) = d2x * l1y;
2216 dshape(4,1) = l2x * d1y;
2218 dshape(1,0) = d3x * l1y;
2219 dshape(1,1) = l3x * d1y;
2221 dshape(7,0) = d1x * l2y;
2222 dshape(7,1) = l1x * d2y;
2224 dshape(8,0) = d2x * l2y;
2225 dshape(8,1) = l2x * d2y;
2227 dshape(5,0) = d3x * l2y;
2228 dshape(5,1) = l3x * d2y;
2230 dshape(3,0) = d1x * l3y;
2231 dshape(3,1) = l1x * d3y;
2233 dshape(6,0) = d2x * l3y;
2234 dshape(6,1) = l2x * d3y;
2236 dshape(2,0) = d3x * l3y;
2237 dshape(2,1) = l3x * d3y;
2245 Vector xx(&tr_ip.
x, 2), shape(s, 9);
2247 for (
int i = 0; i < 9; i++)
2251 for (
int j = 0; j < 9; j++)
2252 if (fabs(I(i,j) = s[j]) < 1.0e-12)
2257 for (
int i = 0; i < 9; i++)
2259 double *d = &I(0,i);
2260 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2261 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2262 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2263 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2264 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2265 0.25 * (d[0] + d[1] + d[2] + d[3]);
2274 for (
int i = 0; i < 9; i++)
2278 d[i] = coeff.
Eval(Trans, ip);
2280 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2281 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2282 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2283 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2284 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2285 0.25 * (d[0] + d[1] + d[2] + d[3]);
2295 for (
int i = 0; i < 9; i++)
2299 vc.
Eval (x, Trans, ip);
2300 for (
int j = 0; j < x.Size(); j++)
2305 for (
int j = 0; j < x.Size(); j++)
2307 double *d = &dofs(9*j);
2309 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2310 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2311 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2312 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2313 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2314 0.25 * (d[0] + d[1] + d[2] + d[3]);
2322 const double p1 = 0.5*(1.-sqrt(3./5.));
2347 const double a = sqrt(5./3.);
2348 const double p1 = 0.5*(1.-sqrt(3./5.));
2350 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2351 double l1x, l2x, l3x, l1y, l2y, l3y;
2353 l1x = (x - 1.) * (2. * x - 1);
2354 l2x = 4. * x * (1. - x);
2355 l3x = x * (2. * x - 1.);
2356 l1y = (y - 1.) * (2. * y - 1);
2357 l2y = 4. * y * (1. - y);
2358 l3y = y * (2. * y - 1.);
2360 shape(0) = l1x * l1y;
2361 shape(4) = l2x * l1y;
2362 shape(1) = l3x * l1y;
2363 shape(7) = l1x * l2y;
2364 shape(8) = l2x * l2y;
2365 shape(5) = l3x * l2y;
2366 shape(3) = l1x * l3y;
2367 shape(6) = l2x * l3y;
2368 shape(2) = l3x * l3y;
2374 const double a = sqrt(5./3.);
2375 const double p1 = 0.5*(1.-sqrt(3./5.));
2377 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2378 double l1x, l2x, l3x, l1y, l2y, l3y;
2379 double d1x, d2x, d3x, d1y, d2y, d3y;
2381 l1x = (x - 1.) * (2. * x - 1);
2382 l2x = 4. * x * (1. - x);
2383 l3x = x * (2. * x - 1.);
2384 l1y = (y - 1.) * (2. * y - 1);
2385 l2y = 4. * y * (1. - y);
2386 l3y = y * (2. * y - 1.);
2388 d1x = a * (4. * x - 3.);
2389 d2x = a * (4. - 8. * x);
2390 d3x = a * (4. * x - 1.);
2391 d1y = a * (4. * y - 3.);
2392 d2y = a * (4. - 8. * y);
2393 d3y = a * (4. * y - 1.);
2395 dshape(0,0) = d1x * l1y;
2396 dshape(0,1) = l1x * d1y;
2398 dshape(4,0) = d2x * l1y;
2399 dshape(4,1) = l2x * d1y;
2401 dshape(1,0) = d3x * l1y;
2402 dshape(1,1) = l3x * d1y;
2404 dshape(7,0) = d1x * l2y;
2405 dshape(7,1) = l1x * d2y;
2407 dshape(8,0) = d2x * l2y;
2408 dshape(8,1) = l2x * d2y;
2410 dshape(5,0) = d3x * l2y;
2411 dshape(5,1) = l3x * d2y;
2413 dshape(3,0) = d1x * l3y;
2414 dshape(3,1) = l1x * d3y;
2416 dshape(6,0) = d2x * l3y;
2417 dshape(6,1) = l2x * d3y;
2419 dshape(2,0) = d3x * l3y;
2420 dshape(2,1) = l3x * d3y;
2463 double x = ip.
x, y = ip.
y;
2465 double w1x, w2x, w3x, w1y, w2y, w3y;
2466 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2468 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2469 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2471 l0x = (- 4.5) * w1x * w2x * w3x;
2472 l1x = ( 13.5) * x * w2x * w3x;
2473 l2x = (-13.5) * x * w1x * w3x;
2474 l3x = ( 4.5) * x * w1x * w2x;
2476 l0y = (- 4.5) * w1y * w2y * w3y;
2477 l1y = ( 13.5) * y * w2y * w3y;
2478 l2y = (-13.5) * y * w1y * w3y;
2479 l3y = ( 4.5) * y * w1y * w2y;
2481 shape(0) = l0x * l0y;
2482 shape(1) = l3x * l0y;
2483 shape(2) = l3x * l3y;
2484 shape(3) = l0x * l3y;
2485 shape(4) = l1x * l0y;
2486 shape(5) = l2x * l0y;
2487 shape(6) = l3x * l1y;
2488 shape(7) = l3x * l2y;
2489 shape(8) = l2x * l3y;
2490 shape(9) = l1x * l3y;
2491 shape(10) = l0x * l2y;
2492 shape(11) = l0x * l1y;
2493 shape(12) = l1x * l1y;
2494 shape(13) = l2x * l1y;
2495 shape(14) = l1x * l2y;
2496 shape(15) = l2x * l2y;
2502 double x = ip.
x, y = ip.
y;
2504 double w1x, w2x, w3x, w1y, w2y, w3y;
2505 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2506 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2508 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2509 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2511 l0x = (- 4.5) * w1x * w2x * w3x;
2512 l1x = ( 13.5) * x * w2x * w3x;
2513 l2x = (-13.5) * x * w1x * w3x;
2514 l3x = ( 4.5) * x * w1x * w2x;
2516 l0y = (- 4.5) * w1y * w2y * w3y;
2517 l1y = ( 13.5) * y * w2y * w3y;
2518 l2y = (-13.5) * y * w1y * w3y;
2519 l3y = ( 4.5) * y * w1y * w2y;
2521 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2522 d1x = 9. + (-45. + 40.5 * x) * x;
2523 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2524 d3x = 1. + (- 9. + 13.5 * x) * x;
2526 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2527 d1y = 9. + (-45. + 40.5 * y) * y;
2528 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2529 d3y = 1. + (- 9. + 13.5 * y) * y;
2531 dshape( 0,0) = d0x * l0y; dshape( 0,1) = l0x * d0y;
2532 dshape( 1,0) = d3x * l0y; dshape( 1,1) = l3x * d0y;
2533 dshape( 2,0) = d3x * l3y; dshape( 2,1) = l3x * d3y;
2534 dshape( 3,0) = d0x * l3y; dshape( 3,1) = l0x * d3y;
2535 dshape( 4,0) = d1x * l0y; dshape( 4,1) = l1x * d0y;
2536 dshape( 5,0) = d2x * l0y; dshape( 5,1) = l2x * d0y;
2537 dshape( 6,0) = d3x * l1y; dshape( 6,1) = l3x * d1y;
2538 dshape( 7,0) = d3x * l2y; dshape( 7,1) = l3x * d2y;
2539 dshape( 8,0) = d2x * l3y; dshape( 8,1) = l2x * d3y;
2540 dshape( 9,0) = d1x * l3y; dshape( 9,1) = l1x * d3y;
2541 dshape(10,0) = d0x * l2y; dshape(10,1) = l0x * d2y;
2542 dshape(11,0) = d0x * l1y; dshape(11,1) = l0x * d1y;
2543 dshape(12,0) = d1x * l1y; dshape(12,1) = l1x * d1y;
2544 dshape(13,0) = d2x * l1y; dshape(13,1) = l2x * d1y;
2545 dshape(14,0) = d1x * l2y; dshape(14,1) = l1x * d2y;
2546 dshape(15,0) = d2x * l2y; dshape(15,1) = l2x * d2y;
2552 double x = ip.
x, y = ip.
y;
2554 double w1x, w2x, w3x, w1y, w2y, w3y;
2555 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2556 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2557 double h0x, h1x, h2x, h3x, h0y, h1y, h2y, h3y;
2559 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2560 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2562 l0x = (- 4.5) * w1x * w2x * w3x;
2563 l1x = ( 13.5) * x * w2x * w3x;
2564 l2x = (-13.5) * x * w1x * w3x;
2565 l3x = ( 4.5) * x * w1x * w2x;
2567 l0y = (- 4.5) * w1y * w2y * w3y;
2568 l1y = ( 13.5) * y * w2y * w3y;
2569 l2y = (-13.5) * y * w1y * w3y;
2570 l3y = ( 4.5) * y * w1y * w2y;
2572 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2573 d1x = 9. + (-45. + 40.5 * x) * x;
2574 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2575 d3x = 1. + (- 9. + 13.5 * x) * x;
2577 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2578 d1y = 9. + (-45. + 40.5 * y) * y;
2579 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2580 d3y = 1. + (- 9. + 13.5 * y) * y;
2582 h0x = -27. * x + 18.;
2583 h1x = 81. * x - 45.;
2584 h2x = -81. * x + 36.;
2587 h0y = -27. * y + 18.;
2588 h1y = 81. * y - 45.;
2589 h2y = -81. * y + 36.;
2592 h( 0,0) = h0x * l0y; h( 0,1) = d0x * d0y; h( 0,2) = l0x * h0y;
2593 h( 1,0) = h3x * l0y; h( 1,1) = d3x * d0y; h( 1,2) = l3x * h0y;
2594 h( 2,0) = h3x * l3y; h( 2,1) = d3x * d3y; h( 2,2) = l3x * h3y;
2595 h( 3,0) = h0x * l3y; h( 3,1) = d0x * d3y; h( 3,2) = l0x * h3y;
2596 h( 4,0) = h1x * l0y; h( 4,1) = d1x * d0y; h( 4,2) = l1x * h0y;
2597 h( 5,0) = h2x * l0y; h( 5,1) = d2x * d0y; h( 5,2) = l2x * h0y;
2598 h( 6,0) = h3x * l1y; h( 6,1) = d3x * d1y; h( 6,2) = l3x * h1y;
2599 h( 7,0) = h3x * l2y; h( 7,1) = d3x * d2y; h( 7,2) = l3x * h2y;
2600 h( 8,0) = h2x * l3y; h( 8,1) = d2x * d3y; h( 8,2) = l2x * h3y;
2601 h( 9,0) = h1x * l3y; h( 9,1) = d1x * d3y; h( 9,2) = l1x * h3y;
2602 h(10,0) = h0x * l2y; h(10,1) = d0x * d2y; h(10,2) = l0x * h2y;
2603 h(11,0) = h0x * l1y; h(11,1) = d0x * d1y; h(11,2) = l0x * h1y;
2604 h(12,0) = h1x * l1y; h(12,1) = d1x * d1y; h(12,2) = l1x * h1y;
2605 h(13,0) = h2x * l1y; h(13,1) = d2x * d1y; h(13,2) = l2x * h1y;
2606 h(14,0) = h1x * l2y; h(14,1) = d1x * d2y; h(14,2) = l1x * h2y;
2607 h(15,0) = h2x * l2y; h(15,1) = d2x * d2y; h(15,2) = l2x * h2y;
2626 l3 = (0.33333333333333333333-x),
2627 l4 = (0.66666666666666666667-x);
2629 shape(0) = 4.5 * l2 * l3 * l4;
2630 shape(1) = 4.5 * l1 * l3 * l4;
2631 shape(2) = 13.5 * l1 * l2 * l4;
2632 shape(3) = -13.5 * l1 * l2 * l3;
2640 dshape(0,0) = -5.5 + x * (18. - 13.5 * x);
2641 dshape(1,0) = 1. - x * (9. - 13.5 * x);
2642 dshape(2,0) = 9. - x * (45. - 40.5 * x);
2643 dshape(3,0) = -4.5 + x * (36. - 40.5 * x);
2675 double x = ip.
x, y = ip.
y;
2676 double l1 = (-1. + x + y),
2680 shape(0) = -0.5*l1*(3.*l1 + 1.)*(3.*l1 + 2.);
2681 shape(1) = 0.5*x*(lx - 1.)*lx;
2682 shape(2) = 0.5*y*(-1. + ly)*ly;
2683 shape(3) = 4.5*x*l1*(3.*l1 + 1.);
2684 shape(4) = -4.5*x*lx*l1;
2685 shape(5) = 4.5*x*lx*y;
2686 shape(6) = 4.5*x*y*ly;
2687 shape(7) = -4.5*y*l1*ly;
2688 shape(8) = 4.5*y*l1*(1. + 3.*l1);
2689 shape(9) = -27.*x*y*l1;
2695 double x = ip.
x, y = ip.
y;
2697 dshape(0,0) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2698 dshape(1,0) = 1. + 4.5*x*(-2. + 3.*x);
2700 dshape(3,0) = 4.5*(2. + 9.*x*x - 5.*y + 3.*y*y + 2.*x*(-5. + 6.*y));
2701 dshape(4,0) = -4.5*(1. - 1.*y + x*(-8. + 9.*x + 6.*y));
2702 dshape(5,0) = 4.5*(-1. + 6.*x)*y;
2703 dshape(6,0) = 4.5*y*(-1. + 3.*y);
2704 dshape(7,0) = 4.5*(1. - 3.*y)*y;
2705 dshape(8,0) = 4.5*y*(-5. + 6.*x + 6.*y);
2706 dshape(9,0) = -27.*y*(-1. + 2.*x + y);
2708 dshape(0,1) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2710 dshape(2,1) = 1. + 4.5*y*(-2. + 3.*y);
2711 dshape(3,1) = 4.5*x*(-5. + 6.*x + 6.*y);
2712 dshape(4,1) = 4.5*(1. - 3.*x)*x;
2713 dshape(5,1) = 4.5*x*(-1. + 3.*x);
2714 dshape(6,1) = 4.5*x*(-1. + 6.*y);
2715 dshape(7,1) = -4.5*(1. + x*(-1. + 6.*y) + y*(-8. + 9.*y));
2716 dshape(8,1) = 4.5*(2. + 3.*x*x + y*(-10. + 9.*y) + x*(-5. + 12.*y));
2717 dshape(9,1) = -27.*x*(-1. + x + 2.*y);
2723 double x = ip.
x, y = ip.
y;
2725 h(0,0) = 18.-27.*(x+y);
2726 h(0,1) = 18.-27.*(x+y);
2727 h(0,2) = 18.-27.*(x+y);
2737 h(3,0) = -45.+81.*x+54.*y;
2738 h(3,1) = -22.5+54.*x+27.*y;
2741 h(4,0) = 36.-81.*x-27.*y;
2746 h(5,1) = -4.5+27.*x;
2750 h(6,1) = -4.5+27.*y;
2755 h(7,2) = 36.-27.*x-81.*y;
2758 h(8,1) = -22.5+27.*x+54.*y;
2759 h(8,2) = -45.+54.*x+81.*y;
2762 h(9,1) = 27.-54.*(x+y);
2835 double x = ip.
x, y = ip.
y, z = ip.
z;
2837 shape(0) = -((-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z)*
2838 (-1 + 3*x + 3*y + 3*z))/2.;
2839 shape(4) = (9*x*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2840 shape(5) = (-9*x*(-1 + 3*x)*(-1 + x + y + z))/2.;
2841 shape(1) = (x*(2 + 9*(-1 + x)*x))/2.;
2842 shape(6) = (9*y*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2843 shape(19) = -27*x*y*(-1 + x + y + z);
2844 shape(10) = (9*x*(-1 + 3*x)*y)/2.;
2845 shape(7) = (-9*y*(-1 + 3*y)*(-1 + x + y + z))/2.;
2846 shape(11) = (9*x*y*(-1 + 3*y))/2.;
2847 shape(2) = (y*(2 + 9*(-1 + y)*y))/2.;
2848 shape(8) = (9*z*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2849 shape(18) = -27*x*z*(-1 + x + y + z);
2850 shape(12) = (9*x*(-1 + 3*x)*z)/2.;
2851 shape(17) = -27*y*z*(-1 + x + y + z);
2852 shape(16) = 27*x*y*z;
2853 shape(14) = (9*y*(-1 + 3*y)*z)/2.;
2854 shape(9) = (-9*z*(-1 + x + y + z)*(-1 + 3*z))/2.;
2855 shape(13) = (9*x*z*(-1 + 3*z))/2.;
2856 shape(15) = (9*y*z*(-1 + 3*z))/2.;
2857 shape(3) = (z*(2 + 9*(-1 + z)*z))/2.;
2863 double x = ip.
x, y = ip.
y, z = ip.
z;
2865 dshape(0,0) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2866 x*(-4 + 6*y + 6*z)))/2.;
2867 dshape(0,1) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2868 x*(-4 + 6*y + 6*z)))/2.;
2869 dshape(0,2) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2870 x*(-4 + 6*y + 6*z)))/2.;
2871 dshape(4,0) = (9*(9*pow(x,2) + (-1 + y + z)*(-2 + 3*y + 3*z) +
2872 2*x*(-5 + 6*y + 6*z)))/2.;
2873 dshape(4,1) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2874 dshape(4,2) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2875 dshape(5,0) = (-9*(1 - y - z + x*(-8 + 9*x + 6*y + 6*z)))/2.;
2876 dshape(5,1) = (9*(1 - 3*x)*x)/2.;
2877 dshape(5,2) = (9*(1 - 3*x)*x)/2.;
2878 dshape(1,0) = 1 + (9*x*(-2 + 3*x))/2.;
2881 dshape(6,0) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2882 dshape(6,1) = (9*(2 + 3*pow(x,2) - 10*y - 5*z + 3*(y + z)*(3*y + z) +
2883 x*(-5 + 12*y + 6*z)))/2.;
2884 dshape(6,2) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2885 dshape(19,0) = -27*y*(-1 + 2*x + y + z);
2886 dshape(19,1) = -27*x*(-1 + x + 2*y + z);
2887 dshape(19,2) = -27*x*y;
2888 dshape(10,0) = (9*(-1 + 6*x)*y)/2.;
2889 dshape(10,1) = (9*x*(-1 + 3*x))/2.;
2891 dshape(7,0) = (9*(1 - 3*y)*y)/2.;
2892 dshape(7,1) = (-9*(1 + x*(-1 + 6*y) - z + y*(-8 + 9*y + 6*z)))/2.;
2893 dshape(7,2) = (9*(1 - 3*y)*y)/2.;
2894 dshape(11,0) = (9*y*(-1 + 3*y))/2.;
2895 dshape(11,1) = (9*x*(-1 + 6*y))/2.;
2898 dshape(2,1) = 1 + (9*y*(-2 + 3*y))/2.;
2900 dshape(8,0) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2901 dshape(8,1) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2902 dshape(8,2) = (9*(2 + 3*pow(x,2) - 5*y - 10*z + 3*(y + z)*(y + 3*z) +
2903 x*(-5 + 6*y + 12*z)))/2.;
2904 dshape(18,0) = -27*z*(-1 + 2*x + y + z);
2905 dshape(18,1) = -27*x*z;
2906 dshape(18,2) = -27*x*(-1 + x + y + 2*z);
2907 dshape(12,0) = (9*(-1 + 6*x)*z)/2.;
2909 dshape(12,2) = (9*x*(-1 + 3*x))/2.;
2910 dshape(17,0) = -27*y*z;
2911 dshape(17,1) = -27*z*(-1 + x + 2*y + z);
2912 dshape(17,2) = -27*y*(-1 + x + y + 2*z);
2913 dshape(16,0) = 27*y*z;
2914 dshape(16,1) = 27*x*z;
2915 dshape(16,2) = 27*x*y;
2917 dshape(14,1) = (9*(-1 + 6*y)*z)/2.;
2918 dshape(14,2) = (9*y*(-1 + 3*y))/2.;
2919 dshape(9,0) = (9*(1 - 3*z)*z)/2.;
2920 dshape(9,1) = (9*(1 - 3*z)*z)/2.;
2921 dshape(9,2) = (9*(-1 + x + y + 8*z - 6*(x + y)*z - 9*pow(z,2)))/2.;
2922 dshape(13,0) = (9*z*(-1 + 3*z))/2.;
2924 dshape(13,2) = (9*x*(-1 + 6*z))/2.;
2926 dshape(15,1) = (9*z*(-1 + 3*z))/2.;
2927 dshape(15,2) = (9*y*(-1 + 6*z))/2.;
2930 dshape(3,2) = 1 + (9*z*(-2 + 3*z))/2.;
2996 shape(0) = 1. - ip.
x - ip.
y - ip.
z;
3005 if (dshape.
Height() == 4)
3007 double *A = &dshape(0,0);
3008 A[0] = -1.; A[4] = -1.; A[8] = -1.;
3009 A[1] = 1.; A[5] = 0.; A[9] = 0.;
3010 A[2] = 0.; A[6] = 1.; A[10] = 0.;
3011 A[3] = 0.; A[7] = 0.; A[11] = 1.;
3015 dshape(0,0) = -1.; dshape(0,1) = -1.; dshape(0,2) = -1.;
3016 dshape(1,0) = 1.; dshape(1,1) = 0.; dshape(1,2) = 0.;
3017 dshape(2,0) = 0.; dshape(2,1) = 1.; dshape(2,2) = 0.;
3018 dshape(3,0) = 0.; dshape(3,1) = 0.; dshape(3,2) = 1.;
3025 static int face_dofs[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
3028 *dofs = face_dofs[face];
3070 double L0, L1, L2, L3;
3072 L0 = 1. - ip.
x - ip.
y - ip.
z;
3077 shape(0) = L0 * ( 2.0 * L0 - 1.0 );
3078 shape(1) = L1 * ( 2.0 * L1 - 1.0 );
3079 shape(2) = L2 * ( 2.0 * L2 - 1.0 );
3080 shape(3) = L3 * ( 2.0 * L3 - 1.0 );
3081 shape(4) = 4.0 * L0 * L1;
3082 shape(5) = 4.0 * L0 * L2;
3083 shape(6) = 4.0 * L0 * L3;
3084 shape(7) = 4.0 * L1 * L2;
3085 shape(8) = 4.0 * L1 * L3;
3086 shape(9) = 4.0 * L2 * L3;
3097 L0 = 1.0 - x - y - z;
3099 dshape(0,0) = dshape(0,1) = dshape(0,2) = 1.0 - 4.0 * L0;
3100 dshape(1,0) = -1.0 + 4.0 * x; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
3101 dshape(2,0) = 0.0; dshape(2,1) = -1.0 + 4.0 * y; dshape(2,2) = 0.0;
3102 dshape(3,0) = dshape(3,1) = 0.0; dshape(3,2) = -1.0 + 4.0 * z;
3103 dshape(4,0) = 4.0 * (L0 - x); dshape(4,1) = dshape(4,2) = -4.0 * x;
3104 dshape(5,0) = dshape(5,2) = -4.0 * y; dshape(5,1) = 4.0 * (L0 - y);
3105 dshape(6,0) = dshape(6,1) = -4.0 * z; dshape(6,2) = 4.0 * (L0 - z);
3106 dshape(7,0) = 4.0 * y; dshape(7,1) = 4.0 * x; dshape(7,2) = 0.0;
3107 dshape(8,0) = 4.0 * z; dshape(8,1) = 0.0; dshape(8,2) = 4.0 * x;
3108 dshape(9,0) = 0.0; dshape(9,1) = 4.0 * z; dshape(9,2) = 4.0 * y;
3150 double x = ip.
x, y = ip.
y, z = ip.
z;
3151 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3153 shape(0) = ox * oy * oz;
3154 shape(1) = x * oy * oz;
3155 shape(2) = x * y * oz;
3156 shape(3) = ox * y * oz;
3157 shape(4) = ox * oy * z;
3158 shape(5) = x * oy * z;
3159 shape(6) = x * y * z;
3160 shape(7) = ox * y * z;
3166 double x = ip.
x, y = ip.
y, z = ip.
z;
3167 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3169 dshape(0,0) = - oy * oz;
3170 dshape(0,1) = - ox * oz;
3171 dshape(0,2) = - ox * oy;
3173 dshape(1,0) = oy * oz;
3174 dshape(1,1) = - x * oz;
3175 dshape(1,2) = - x * oy;
3177 dshape(2,0) = y * oz;
3178 dshape(2,1) = x * oz;
3179 dshape(2,2) = - x * y;
3181 dshape(3,0) = - y * oz;
3182 dshape(3,1) = ox * oz;
3183 dshape(3,2) = - ox * y;
3185 dshape(4,0) = - oy * z;
3186 dshape(4,1) = - ox * z;
3187 dshape(4,2) = ox * oy;
3189 dshape(5,0) = oy * z;
3190 dshape(5,1) = - x * z;
3191 dshape(5,2) = x * oy;
3193 dshape(6,0) = y * z;
3194 dshape(6,1) = x * z;
3195 dshape(6,2) = x * y;
3197 dshape(7,0) = - y * z;
3198 dshape(7,1) = ox * z;
3199 dshape(7,2) = ox * y;
3235 shape(0) = 1.0 - 2.0 * ip.
y;
3236 shape(1) = -1.0 + 2.0 * ( ip.
x + ip.
y );
3237 shape(2) = 1.0 - 2.0 * ip.
x;
3243 dshape(0,0) = 0.0; dshape(0,1) = -2.0;
3244 dshape(1,0) = 2.0; dshape(1,1) = 2.0;
3245 dshape(2,0) = -2.0; dshape(2,1) = 0.0;
3266 const double l1 = ip.
x+ip.
y-0.5, l2 = 1.-l1, l3 = ip.
x-ip.
y+0.5, l4 = 1.-l3;
3277 const double x2 = 2.*ip.
x, y2 = 2.*ip.
y;
3279 dshape(0,0) = 1. - x2; dshape(0,1) = -2. + y2;
3280 dshape(1,0) = x2; dshape(1,1) = 1. - y2;
3281 dshape(2,0) = 1. - x2; dshape(2,1) = y2;
3282 dshape(3,0) = -2. + x2; dshape(3,1) = 1. - y2;
3300 double x = ip.
x, y = ip.
y;
3303 shape(0,1) = y - 1.;
3306 shape(2,0) = x - 1.;
3318 const double RT0TriangleFiniteElement::nk[3][2] =
3319 { {0, -1}, {1, 1}, {-1, 0} };
3325 #ifdef MFEM_THREAD_SAFE
3331 for (k = 0; k < 3; k++)
3334 for (j = 0; j < 3; j++)
3337 if (j == k) { d -= 1.0; }
3338 if (fabs(d) > 1.0e-12)
3340 mfem::err <<
"RT0TriangleFiniteElement::GetLocalInterpolation (...)\n"
3341 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3357 for (k = 0; k < 3; k++)
3360 ip.
x = vk[0]; ip.
y = vk[1];
3363 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3364 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3365 for (j = 0; j < 3; j++)
3366 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3379 #ifdef MFEM_THREAD_SAFE
3383 for (
int k = 0; k < 3; k++)
3391 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3392 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3412 double x = ip.
x, y = ip.
y;
3415 shape(0,1) = y - 1.;
3420 shape(3,0) = x - 1.;
3433 const double RT0QuadFiniteElement::nk[4][2] =
3434 { {0, -1}, {1, 0}, {0, 1}, {-1, 0} };
3440 #ifdef MFEM_THREAD_SAFE
3446 for (k = 0; k < 4; k++)
3449 for (j = 0; j < 4; j++)
3452 if (j == k) { d -= 1.0; }
3453 if (fabs(d) > 1.0e-12)
3455 mfem::err <<
"RT0QuadFiniteElement::GetLocalInterpolation (...)\n"
3456 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3472 for (k = 0; k < 4; k++)
3475 ip.
x = vk[0]; ip.
y = vk[1];
3478 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3479 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3480 for (j = 0; j < 4; j++)
3481 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3494 #ifdef MFEM_THREAD_SAFE
3498 for (
int k = 0; k < 4; k++)
3506 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3507 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3535 double x = ip.
x, y = ip.
y;
3537 shape(0,0) = -2 * x * (-1 + x + 2 * y);
3538 shape(0,1) = -2 * (-1 + y) * (-1 + x + 2 * y);
3539 shape(1,0) = 2 * x * (x - y);
3540 shape(1,1) = 2 * (x - y) * (-1 + y);
3541 shape(2,0) = 2 * x * (-1 + 2 * x + y);
3542 shape(2,1) = 2 * y * (-1 + 2 * x + y);
3543 shape(3,0) = 2 * x * (-1 + x + 2 * y);
3544 shape(3,1) = 2 * y * (-1 + x + 2 * y);
3545 shape(4,0) = -2 * (-1 + x) * (x - y);
3546 shape(4,1) = 2 * y * (-x + y);
3547 shape(5,0) = -2 * (-1 + x) * (-1 + 2 * x + y);
3548 shape(5,1) = -2 * y * (-1 + 2 * x + y);
3549 shape(6,0) = -3 * x * (-2 + 2 * x + y);
3550 shape(6,1) = -3 * y * (-1 + 2 * x + y);
3551 shape(7,0) = -3 * x * (-1 + x + 2 * y);
3552 shape(7,1) = -3 * y * (-2 + x + 2 * y);
3558 double x = ip.
x, y = ip.
y;
3560 divshape(0) = -2 * (-4 + 3 * x + 6 * y);
3561 divshape(1) = 2 + 6 * x - 6 * y;
3562 divshape(2) = -4 + 12 * x + 6 * y;
3563 divshape(3) = -4 + 6 * x + 12 * y;
3564 divshape(4) = 2 - 6 * x + 6 * y;
3565 divshape(5) = -2 * (-4 + 6 * x + 3 * y);
3566 divshape(6) = -9 * (-1 + 2 * x + y);
3567 divshape(7) = -9 * (-1 + x + 2 * y);
3570 const double RT1TriangleFiniteElement::nk[8][2] =
3582 #ifdef MFEM_THREAD_SAFE
3588 for (k = 0; k < 8; k++)
3591 for (j = 0; j < 8; j++)
3594 if (j == k) { d -= 1.0; }
3595 if (fabs(d) > 1.0e-12)
3597 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3598 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3614 for (k = 0; k < 8; k++)
3617 ip.
x = vk[0]; ip.
y = vk[1];
3620 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3621 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3622 for (j = 0; j < 8; j++)
3623 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3635 #ifdef MFEM_THREAD_SAFE
3639 for (
int k = 0; k < 8; k++)
3647 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3648 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3691 double x = ip.
x, y = ip.
y;
3695 shape(0,1) = -( 1. - 3.*y + 2.*y*y)*( 2. - 3.*x);
3697 shape(1,1) = -( 1. - 3.*y + 2.*y*y)*(-1. + 3.*x);
3699 shape(2,0) = (-x + 2.*x*x)*( 2. - 3.*y);
3701 shape(3,0) = (-x + 2.*x*x)*(-1. + 3.*y);
3705 shape(4,1) = (-y + 2.*y*y)*(-1. + 3.*x);
3707 shape(5,1) = (-y + 2.*y*y)*( 2. - 3.*x);
3709 shape(6,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y);
3711 shape(7,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y);
3714 shape(8,0) = (4.*x - 4.*x*x)*( 2. - 3.*y);
3716 shape(9,0) = (4.*x - 4.*x*x)*(-1. + 3.*y);
3720 shape(10,1) = (4.*y - 4.*y*y)*( 2. - 3.*x);
3722 shape(11,1) = (4.*y - 4.*y*y)*(-1. + 3.*x);
3728 double x = ip.
x, y = ip.
y;
3730 divshape(0) = -(-3. + 4.*y)*( 2. - 3.*x);
3731 divshape(1) = -(-3. + 4.*y)*(-1. + 3.*x);
3732 divshape(2) = (-1. + 4.*x)*( 2. - 3.*y);
3733 divshape(3) = (-1. + 4.*x)*(-1. + 3.*y);
3734 divshape(4) = (-1. + 4.*y)*(-1. + 3.*x);
3735 divshape(5) = (-1. + 4.*y)*( 2. - 3.*x);
3736 divshape(6) = -(-3. + 4.*x)*(-1. + 3.*y);
3737 divshape(7) = -(-3. + 4.*x)*( 2. - 3.*y);
3738 divshape(8) = ( 4. - 8.*x)*( 2. - 3.*y);
3739 divshape(9) = ( 4. - 8.*x)*(-1. + 3.*y);
3740 divshape(10) = ( 4. - 8.*y)*( 2. - 3.*x);
3741 divshape(11) = ( 4. - 8.*y)*(-1. + 3.*x);
3744 const double RT1QuadFiniteElement::nk[12][2] =
3764 #ifdef MFEM_THREAD_SAFE
3770 for (k = 0; k < 12; k++)
3773 for (j = 0; j < 12; j++)
3776 if (j == k) { d -= 1.0; }
3777 if (fabs(d) > 1.0e-12)
3779 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3780 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3796 for (k = 0; k < 12; k++)
3799 ip.
x = vk[0]; ip.
y = vk[1];
3802 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3803 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3804 for (j = 0; j < 12; j++)
3805 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3817 #ifdef MFEM_THREAD_SAFE
3821 for (
int k = 0; k < 12; k++)
3829 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3830 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3834 const double RT2TriangleFiniteElement::M[15][15] =
3837 0, -5.3237900077244501311, 5.3237900077244501311, 16.647580015448900262,
3838 0, 24.442740046346700787, -16.647580015448900262, -12.,
3839 -19.118950038622250656, -47.237900077244501311, 0, -34.414110069520051180,
3840 12., 30.590320061795601049, 15.295160030897800524
3843 0, 1.5, -1.5, -15., 0, 2.625, 15., 15., -4.125, 30., 0, -14.625, -15.,
3847 0, -0.67620999227554986889, 0.67620999227554986889, 7.3524199845510997378,
3848 0, -3.4427400463467007866, -7.3524199845510997378, -12.,
3849 4.1189500386222506555, -0.76209992275549868892, 0, 7.4141100695200511800,
3850 12., -6.5903200617956010489, -3.2951600308978005244
3853 0, 0, 1.5, 0, 0, 1.5, -11.471370023173350393, 0, 2.4713700231733503933,
3854 -11.471370023173350393, 0, 2.4713700231733503933, 15.295160030897800524,
3855 0, -3.2951600308978005244
3858 0, 0, 4.875, 0, 0, 4.875, -16.875, 0, -16.875, -16.875, 0, -16.875, 10.5,
3862 0, 0, 1.5, 0, 0, 1.5, 2.4713700231733503933, 0, -11.471370023173350393,
3863 2.4713700231733503933, 0, -11.471370023173350393, -3.2951600308978005244,
3864 0, 15.295160030897800524
3867 -0.67620999227554986889, 0, -3.4427400463467007866, 0,
3868 7.3524199845510997378, 0.67620999227554986889, 7.4141100695200511800, 0,
3869 -0.76209992275549868892, 4.1189500386222506555, -12.,
3870 -7.3524199845510997378, -3.2951600308978005244, -6.5903200617956010489,
3874 1.5, 0, 2.625, 0, -15., -1.5, -14.625, 0, 30., -4.125, 15., 15., 10.5,
3878 -5.3237900077244501311, 0, 24.442740046346700787, 0, 16.647580015448900262,
3879 5.3237900077244501311, -34.414110069520051180, 0, -47.237900077244501311,
3880 -19.118950038622250656, -12., -16.647580015448900262, 15.295160030897800524,
3881 30.590320061795601049, 12.
3883 { 0, 0, 18., 0, 0, 6., -42., 0, -30., -26., 0, -14., 24., 32., 8.},
3884 { 0, 0, 6., 0, 0, 18., -14., 0, -26., -30., 0, -42., 8., 32., 24.},
3885 { 0, 0, -6., 0, 0, -4., 30., 0, 4., 22., 0, 4., -24., -16., 0},
3886 { 0, 0, -4., 0, 0, -8., 20., 0, 8., 36., 0, 8., -16., -32., 0},
3887 { 0, 0, -8., 0, 0, -4., 8., 0, 36., 8., 0, 20., 0, -32., -16.},
3888 { 0, 0, -4., 0, 0, -6., 4., 0, 22., 4., 0, 30., 0, -16., -24.}
3894 const double p = 0.11270166537925831148;
3931 double x = ip.
x, y = ip.
y;
3933 double Bx[15] = {1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y, 0., x*x*x,
3936 double By[15] = {0., 1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y,
3940 for (
int i = 0; i < 15; i++)
3942 double cx = 0.0, cy = 0.0;
3943 for (
int j = 0; j < 15; j++)
3945 cx += M[i][j] * Bx[j];
3946 cy += M[i][j] * By[j];
3956 double x = ip.
x, y = ip.
y;
3958 double DivB[15] = {0., 0., 1., 0., 0., 1., 2.*x, 0., y, x, 0., 2.*y,
3959 4.*x*x, 4.*x*y, 4.*y*y
3962 for (
int i = 0; i < 15; i++)
3965 for (
int j = 0; j < 15; j++)
3967 div += M[i][j] * DivB[j];
3973 const double RT2QuadFiniteElement::pt[4] = {0.,1./3.,2./3.,1.};
3975 const double RT2QuadFiniteElement::dpt[3] = {0.25,0.5,0.75};
4017 double x = ip.
x, y = ip.
y;
4019 double ax0 = pt[0] - x;
4020 double ax1 = pt[1] - x;
4021 double ax2 = pt[2] - x;
4022 double ax3 = pt[3] - x;
4024 double by0 = dpt[0] - y;
4025 double by1 = dpt[1] - y;
4026 double by2 = dpt[2] - y;
4028 double ay0 = pt[0] - y;
4029 double ay1 = pt[1] - y;
4030 double ay2 = pt[2] - y;
4031 double ay3 = pt[3] - y;
4033 double bx0 = dpt[0] - x;
4034 double bx1 = dpt[1] - x;
4035 double bx2 = dpt[2] - x;
4037 double A01 = pt[0] - pt[1];
4038 double A02 = pt[0] - pt[2];
4039 double A12 = pt[1] - pt[2];
4040 double A03 = pt[0] - pt[3];
4041 double A13 = pt[1] - pt[3];
4042 double A23 = pt[2] - pt[3];
4044 double B01 = dpt[0] - dpt[1];
4045 double B02 = dpt[0] - dpt[2];
4046 double B12 = dpt[1] - dpt[2];
4048 double tx0 = (bx1*bx2)/(B01*B02);
4049 double tx1 = -(bx0*bx2)/(B01*B12);
4050 double tx2 = (bx0*bx1)/(B02*B12);
4052 double ty0 = (by1*by2)/(B01*B02);
4053 double ty1 = -(by0*by2)/(B01*B12);
4054 double ty2 = (by0*by1)/(B02*B12);
4058 shape(0, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx0;
4060 shape(1, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx1;
4062 shape(2, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx2;
4064 shape(3, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty0;
4066 shape(4, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty1;
4068 shape(5, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty2;
4072 shape(6, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx2;
4074 shape(7, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx1;
4076 shape(8, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx0;
4078 shape(9, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty2;
4080 shape(10, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty1;
4082 shape(11, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty0;
4085 shape(12, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty0;
4087 shape(13, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty1;
4089 shape(14, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty2;
4092 shape(15, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty0;
4094 shape(16, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty1;
4096 shape(17, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty2;
4100 shape(18, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx0;
4102 shape(19, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx1;
4104 shape(20, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx2;
4107 shape(21, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx0;
4109 shape(22, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx1;
4111 shape(23, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx2;
4117 double x = ip.
x, y = ip.
y;
4119 double a01 = pt[0]*pt[1];
4120 double a02 = pt[0]*pt[2];
4121 double a12 = pt[1]*pt[2];
4122 double a03 = pt[0]*pt[3];
4123 double a13 = pt[1]*pt[3];
4124 double a23 = pt[2]*pt[3];
4126 double bx0 = dpt[0] - x;
4127 double bx1 = dpt[1] - x;
4128 double bx2 = dpt[2] - x;
4130 double by0 = dpt[0] - y;
4131 double by1 = dpt[1] - y;
4132 double by2 = dpt[2] - y;
4134 double A01 = pt[0] - pt[1];
4135 double A02 = pt[0] - pt[2];
4136 double A12 = pt[1] - pt[2];
4137 double A03 = pt[0] - pt[3];
4138 double A13 = pt[1] - pt[3];
4139 double A23 = pt[2] - pt[3];
4141 double A012 = pt[0] + pt[1] + pt[2];
4142 double A013 = pt[0] + pt[1] + pt[3];
4143 double A023 = pt[0] + pt[2] + pt[3];
4144 double A123 = pt[1] + pt[2] + pt[3];
4146 double B01 = dpt[0] - dpt[1];
4147 double B02 = dpt[0] - dpt[2];
4148 double B12 = dpt[1] - dpt[2];
4150 double tx0 = (bx1*bx2)/(B01*B02);
4151 double tx1 = -(bx0*bx2)/(B01*B12);
4152 double tx2 = (bx0*bx1)/(B02*B12);
4154 double ty0 = (by1*by2)/(B01*B02);
4155 double ty1 = -(by0*by2)/(B01*B12);
4156 double ty2 = (by0*by1)/(B02*B12);
4159 divshape(0) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx0;
4160 divshape(1) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx1;
4161 divshape(2) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx2;
4163 divshape(3) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty0;
4164 divshape(4) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty1;
4165 divshape(5) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty2;
4167 divshape(6) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx2;
4168 divshape(7) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx1;
4169 divshape(8) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx0;
4171 divshape(9) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty2;
4172 divshape(10) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty1;
4173 divshape(11) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty0;
4175 divshape(12) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty0;
4176 divshape(13) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty1;
4177 divshape(14) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty2;
4179 divshape(15) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty0;
4180 divshape(16) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty1;
4181 divshape(17) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty2;
4183 divshape(18) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx0;
4184 divshape(19) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx1;
4185 divshape(20) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx2;
4187 divshape(21) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx0;
4188 divshape(22) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx1;
4189 divshape(23) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx2;
4192 const double RT2QuadFiniteElement::nk[24][2] =
4195 {0,-1}, {0,-1}, {0,-1},
4197 {1, 0}, {1, 0}, {1, 0},
4199 {0, 1}, {0, 1}, {0, 1},
4201 {-1,0}, {-1,0}, {-1,0},
4203 {1, 0}, {1, 0}, {1, 0},
4205 {1, 0}, {1, 0}, {1, 0},
4207 {0, 1}, {0, 1}, {0, 1},
4209 {0, 1}, {0, 1}, {0, 1}
4216 #ifdef MFEM_THREAD_SAFE
4222 for (k = 0; k < 24; k++)
4225 for (j = 0; j < 24; j++)
4228 if (j == k) { d -= 1.0; }
4229 if (fabs(d) > 1.0e-12)
4231 mfem::err <<
"RT2QuadFiniteElement::GetLocalInterpolation (...)\n"
4232 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
4248 for (k = 0; k < 24; k++)
4251 ip.
x = vk[0]; ip.
y = vk[1];
4254 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
4255 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
4256 for (j = 0; j < 24; j++)
4257 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
4269 #ifdef MFEM_THREAD_SAFE
4273 for (
int k = 0; k < 24; k++)
4281 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
4282 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
4298 shape(0) = 2. - 3. * x;
4299 shape(1) = 3. * x - 1.;
4313 const double p = 0.11270166537925831148;
4323 const double p = 0.11270166537925831148;
4324 const double w = 1./((1-2*p)*(1-2*p));
4327 shape(0) = (2*x-1)*(x-1+p)*w;
4328 shape(1) = 4*(x-1+p)*(p-x)*w;
4329 shape(2) = (2*x-1)*(x-p)*w;
4335 const double p = 0.11270166537925831148;
4336 const double w = 1./((1-2*p)*(1-2*p));
4339 dshape(0,0) = (-3+4*x+2*p)*w;
4340 dshape(1,0) = (4-8*x)*w;
4341 dshape(2,0) = (-1+4*x-2*p)*w;
4352 for (i = 1; i < m; i++)
4358 #ifndef MFEM_THREAD_SAFE
4363 for (i = 1; i <= m; i++)
4365 rwk(i) = rwk(i-1) * ( (double)(m) / (double)(i) );
4367 for (i = 0; i < m/2+1; i++)
4369 rwk(m-i) = ( rwk(i) *= rwk(m-i) );
4371 for (i = m-1; i >= 0; i -= 2)
4380 double w, wk, x = ip.
x;
4383 #ifdef MFEM_THREAD_SAFE
4387 k = (int) floor ( m * x + 0.5 );
4388 k = k > m ? m : k < 0 ? 0 : k;
4391 for (i = 0; i <= m; i++)
4394 wk *= ( rxxk(i) = x - (double)(i) / m );
4396 w = wk * ( rxxk(k) = x - (double)(k) / m );
4400 shape(0) = w * rwk(0) / rxxk(0);
4404 shape(0) = wk * rwk(0);
4408 shape(1) = w * rwk(m) / rxxk(m);
4412 shape(1) = wk * rwk(k);
4414 for (i = 1; i < m; i++)
4417 shape(i+1) = w * rwk(i) / rxxk(i);
4421 shape(k+1) = wk * rwk(k);
4428 double s, srx, w, wk, x = ip.
x;
4431 #ifdef MFEM_THREAD_SAFE
4435 k = (int) floor ( m * x + 0.5 );
4436 k = k > m ? m : k < 0 ? 0 : k;
4439 for (i = 0; i <= m; i++)
4442 wk *= ( rxxk(i) = x - (double)(i) / m );
4444 w = wk * ( rxxk(k) = x - (double)(k) / m );
4446 for (i = 0; i <= m; i++)
4448 rxxk(i) = 1.0 / rxxk(i);
4451 for (i = 0; i <= m; i++)
4460 dshape(0,0) = (s - w * rxxk(0)) * rwk(0) * rxxk(0);
4464 dshape(0,0) = wk * srx * rwk(0);
4468 dshape(1,0) = (s - w * rxxk(m)) * rwk(m) * rxxk(m);
4472 dshape(1,0) = wk * srx * rwk(k);
4474 for (i = 1; i < m; i++)
4477 dshape(i+1,0) = (s - w * rxxk(i)) * rwk(i) * rxxk(i);
4481 dshape(k+1,0) = wk * srx * rwk(k);
4510 double L0, L1, L2, L3;
4512 L1 = ip.
x; L2 = ip.
y; L3 = ip.
z; L0 = 1.0 - L1 - L2 - L3;
4513 shape(0) = 1.0 - 3.0 * L0;
4514 shape(1) = 1.0 - 3.0 * L1;
4515 shape(2) = 1.0 - 3.0 * L2;
4516 shape(3) = 1.0 - 3.0 * L3;
4522 dshape(0,0) = 3.0; dshape(0,1) = 3.0; dshape(0,2) = 3.0;
4523 dshape(1,0) = -3.0; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
4524 dshape(2,0) = 0.0; dshape(2,1) = -3.0; dshape(2,2) = 0.0;
4525 dshape(3,0) = 0.0; dshape(3,1) = 0.0; dshape(3,2) = -3.0;
4546 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4567 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4581 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4582 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4583 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4584 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4585 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4586 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4587 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4588 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4590 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4591 I[ 9] = 1; J[ 9] = 2; K[ 9] = 0;
4592 I[10] = 2; J[10] = 1; K[10] = 0;
4593 I[11] = 0; J[11] = 2; K[11] = 0;
4594 I[12] = 2; J[12] = 0; K[12] = 1;
4595 I[13] = 1; J[13] = 2; K[13] = 1;
4596 I[14] = 2; J[14] = 1; K[14] = 1;
4597 I[15] = 0; J[15] = 2; K[15] = 1;
4598 I[16] = 0; J[16] = 0; K[16] = 2;
4599 I[17] = 1; J[17] = 0; K[17] = 2;
4600 I[18] = 1; J[18] = 1; K[18] = 2;
4601 I[19] = 0; J[19] = 1; K[19] = 2;
4603 I[20] = 2; J[20] = 2; K[20] = 0;
4604 I[21] = 2; J[21] = 0; K[21] = 2;
4605 I[22] = 1; J[22] = 2; K[22] = 2;
4606 I[23] = 2; J[23] = 1; K[23] = 2;
4607 I[24] = 0; J[24] = 2; K[24] = 2;
4608 I[25] = 2; J[25] = 2; K[25] = 1;
4610 I[26] = 2; J[26] = 2; K[26] = 2;
4612 else if (degree == 3)
4618 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4619 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4620 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4621 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4622 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4623 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4624 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4625 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4627 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4628 I[ 9] = 3; J[ 9] = 0; K[ 9] = 0;
4629 I[10] = 1; J[10] = 2; K[10] = 0;
4630 I[11] = 1; J[11] = 3; K[11] = 0;
4631 I[12] = 2; J[12] = 1; K[12] = 0;
4632 I[13] = 3; J[13] = 1; K[13] = 0;
4633 I[14] = 0; J[14] = 2; K[14] = 0;
4634 I[15] = 0; J[15] = 3; K[15] = 0;
4635 I[16] = 2; J[16] = 0; K[16] = 1;
4636 I[17] = 3; J[17] = 0; K[17] = 1;
4637 I[18] = 1; J[18] = 2; K[18] = 1;
4638 I[19] = 1; J[19] = 3; K[19] = 1;
4639 I[20] = 2; J[20] = 1; K[20] = 1;
4640 I[21] = 3; J[21] = 1; K[21] = 1;
4641 I[22] = 0; J[22] = 2; K[22] = 1;
4642 I[23] = 0; J[23] = 3; K[23] = 1;
4643 I[24] = 0; J[24] = 0; K[24] = 2;
4644 I[25] = 0; J[25] = 0; K[25] = 3;
4645 I[26] = 1; J[26] = 0; K[26] = 2;
4646 I[27] = 1; J[27] = 0; K[27] = 3;
4647 I[28] = 1; J[28] = 1; K[28] = 2;
4648 I[29] = 1; J[29] = 1; K[29] = 3;
4649 I[30] = 0; J[30] = 1; K[30] = 2;
4650 I[31] = 0; J[31] = 1; K[31] = 3;
4652 I[32] = 2; J[32] = 3; K[32] = 0;
4653 I[33] = 3; J[33] = 3; K[33] = 0;
4654 I[34] = 2; J[34] = 2; K[34] = 0;
4655 I[35] = 3; J[35] = 2; K[35] = 0;
4656 I[36] = 2; J[36] = 0; K[36] = 2;
4657 I[37] = 3; J[37] = 0; K[37] = 2;
4658 I[38] = 2; J[38] = 0; K[38] = 3;
4659 I[39] = 3; J[39] = 0; K[39] = 3;
4660 I[40] = 1; J[40] = 2; K[40] = 2;
4661 I[41] = 1; J[41] = 3; K[41] = 2;
4662 I[42] = 1; J[42] = 2; K[42] = 3;
4663 I[43] = 1; J[43] = 3; K[43] = 3;
4664 I[44] = 3; J[44] = 1; K[44] = 2;
4665 I[45] = 2; J[45] = 1; K[45] = 2;
4666 I[46] = 3; J[46] = 1; K[46] = 3;
4667 I[47] = 2; J[47] = 1; K[47] = 3;
4668 I[48] = 0; J[48] = 3; K[48] = 2;
4669 I[49] = 0; J[49] = 2; K[49] = 2;
4670 I[50] = 0; J[50] = 3; K[50] = 3;
4671 I[51] = 0; J[51] = 2; K[51] = 3;
4672 I[52] = 2; J[52] = 2; K[52] = 1;
4673 I[53] = 3; J[53] = 2; K[53] = 1;
4674 I[54] = 2; J[54] = 3; K[54] = 1;
4675 I[55] = 3; J[55] = 3; K[55] = 1;
4677 I[56] = 2; J[56] = 2; K[56] = 2;
4678 I[57] = 3; J[57] = 2; K[57] = 2;
4679 I[58] = 3; J[58] = 3; K[58] = 2;
4680 I[59] = 2; J[59] = 3; K[59] = 2;
4681 I[60] = 2; J[60] = 2; K[60] = 3;
4682 I[61] = 3; J[61] = 2; K[61] = 3;
4683 I[62] = 3; J[62] = 3; K[62] = 3;
4684 I[63] = 2; J[63] = 3; K[63] = 3;
4688 mfem_error (
"LagrangeHexFiniteElement::LagrangeHexFiniteElement");
4692 dof1d = fe1d ->
GetDof();
4694 #ifndef MFEM_THREAD_SAFE
4704 for (
int n = 0; n <
Dof; n++)
4719 #ifdef MFEM_THREAD_SAFE
4720 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4727 for (
int n = 0; n <
Dof; n++)
4729 shape(n) = shape1dx(I[n]) * shape1dy(J[n]) * shape1dz(K[n]);
4740 #ifdef MFEM_THREAD_SAFE
4741 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4742 DenseMatrix dshape1dx(dof1d,1), dshape1dy(dof1d,1), dshape1dz(dof1d,1);
4753 for (
int n = 0; n <
Dof; n++)
4755 dshape(n,0) = dshape1dx(I[n],0) * shape1dy(J[n]) * shape1dz(K[n]);
4756 dshape(n,1) = shape1dx(I[n]) * dshape1dy(J[n],0) * shape1dz(K[n]);
4757 dshape(n,2) = shape1dx(I[n]) * shape1dy(J[n]) * dshape1dz(K[n],0);
4786 shape(0) = 1.0 - 2.0 * x;
4793 shape(1) = 2.0 * x - 1.0;
4794 shape(2) = 2.0 - 2.0 * x;
4805 dshape(0,0) = - 2.0;
4813 dshape(2,0) = - 2.0;
4840 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4841 L1 = 2.0 * ( ip.
x );
4842 L2 = 2.0 * ( ip.
y );
4851 for (i = 0; i < 6; i++)
4858 shape(0) = L0 - 1.0;
4865 shape(1) = L1 - 1.0;
4872 shape(2) = L2 - 1.0;
4876 shape(3) = 1.0 - L2;
4877 shape(4) = 1.0 - L0;
4878 shape(5) = 1.0 - L1;
4888 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4889 L1 = 2.0 * ( ip.
x );
4890 L2 = 2.0 * ( ip.
y );
4892 double DL0[2], DL1[2], DL2[2];
4893 DL0[0] = -2.0; DL0[1] = -2.0;
4894 DL1[0] = 2.0; DL1[1] = 0.0;
4895 DL2[0] = 0.0; DL2[1] = 2.0;
4897 for (i = 0; i < 6; i++)
4898 for (j = 0; j < 2; j++)
4905 for (j = 0; j < 2; j++)
4907 dshape(0,j) = DL0[j];
4908 dshape(3,j) = DL1[j];
4909 dshape(5,j) = DL2[j];
4914 for (j = 0; j < 2; j++)
4916 dshape(3,j) = DL0[j];
4917 dshape(1,j) = DL1[j];
4918 dshape(4,j) = DL2[j];
4923 for (j = 0; j < 2; j++)
4925 dshape(5,j) = DL0[j];
4926 dshape(4,j) = DL1[j];
4927 dshape(2,j) = DL2[j];
4932 for (j = 0; j < 2; j++)
4934 dshape(3,j) = - DL2[j];
4935 dshape(4,j) = - DL0[j];
4936 dshape(5,j) = - DL1[j];
4981 double L0, L1, L2, L3, L4, L5;
4982 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
4983 L1 = 2.0 * ( ip.
x );
4984 L2 = 2.0 * ( ip.
y );
4985 L3 = 2.0 * ( ip.
z );
4986 L4 = 2.0 * ( ip.
x + ip.
y );
4987 L5 = 2.0 * ( ip.
y + ip.
z );
5000 for (i = 0; i < 10; i++)
5007 shape(0) = L0 - 1.0;
5015 shape(1) = L1 - 1.0;
5023 shape(2) = L2 - 1.0;
5031 shape(3) = L3 - 1.0;
5033 else if ((L4 <= 1.0) && (L5 <= 1.0))
5035 shape(4) = 1.0 - L5;
5037 shape(6) = 1.0 - L4;
5038 shape(8) = 1.0 - L0;
5040 else if ((L4 >= 1.0) && (L5 <= 1.0))
5042 shape(4) = 1.0 - L5;
5043 shape(5) = 1.0 - L1;
5044 shape(7) = L4 - 1.0;
5047 else if ((L4 <= 1.0) && (L5 >= 1.0))
5049 shape(5) = 1.0 - L3;
5050 shape(6) = 1.0 - L4;
5052 shape(9) = L5 - 1.0;
5054 else if ((L4 >= 1.0) && (L5 >= 1.0))
5057 shape(7) = L4 - 1.0;
5058 shape(8) = 1.0 - L2;
5059 shape(9) = L5 - 1.0;
5068 double L0, L1, L2, L3, L4, L5;
5069 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5070 L1 = 2.0 * ( ip.
x );
5071 L2 = 2.0 * ( ip.
y );
5072 L3 = 2.0 * ( ip.
z );
5073 L4 = 2.0 * ( ip.
x + ip.
y );
5074 L5 = 2.0 * ( ip.
y + ip.
z );
5076 double DL0[3], DL1[3], DL2[3], DL3[3], DL4[3], DL5[3];
5077 DL0[0] = -2.0; DL0[1] = -2.0; DL0[2] = -2.0;
5078 DL1[0] = 2.0; DL1[1] = 0.0; DL1[2] = 0.0;
5079 DL2[0] = 0.0; DL2[1] = 2.0; DL2[2] = 0.0;
5080 DL3[0] = 0.0; DL3[1] = 0.0; DL3[2] = 2.0;
5081 DL4[0] = 2.0; DL4[1] = 2.0; DL4[2] = 0.0;
5082 DL5[0] = 0.0; DL5[1] = 2.0; DL5[2] = 2.0;
5084 for (i = 0; i < 10; i++)
5085 for (j = 0; j < 3; j++)
5092 for (j = 0; j < 3; j++)
5094 dshape(0,j) = DL0[j];
5095 dshape(4,j) = DL1[j];
5096 dshape(5,j) = DL2[j];
5097 dshape(6,j) = DL3[j];
5102 for (j = 0; j < 3; j++)
5104 dshape(4,j) = DL0[j];
5105 dshape(1,j) = DL1[j];
5106 dshape(7,j) = DL2[j];
5107 dshape(8,j) = DL3[j];
5112 for (j = 0; j < 3; j++)
5114 dshape(5,j) = DL0[j];
5115 dshape(7,j) = DL1[j];
5116 dshape(2,j) = DL2[j];
5117 dshape(9,j) = DL3[j];
5122 for (j = 0; j < 3; j++)
5124 dshape(6,j) = DL0[j];
5125 dshape(8,j) = DL1[j];
5126 dshape(9,j) = DL2[j];
5127 dshape(3,j) = DL3[j];
5130 else if ((L4 <= 1.0) && (L5 <= 1.0))
5132 for (j = 0; j < 3; j++)
5134 dshape(4,j) = - DL5[j];
5135 dshape(5,j) = DL2[j];
5136 dshape(6,j) = - DL4[j];
5137 dshape(8,j) = - DL0[j];
5140 else if ((L4 >= 1.0) && (L5 <= 1.0))
5142 for (j = 0; j < 3; j++)
5144 dshape(4,j) = - DL5[j];
5145 dshape(5,j) = - DL1[j];
5146 dshape(7,j) = DL4[j];
5147 dshape(8,j) = DL3[j];
5150 else if ((L4 <= 1.0) && (L5 >= 1.0))
5152 for (j = 0; j < 3; j++)
5154 dshape(5,j) = - DL3[j];
5155 dshape(6,j) = - DL4[j];
5156 dshape(8,j) = DL1[j];
5157 dshape(9,j) = DL5[j];
5160 else if ((L4 >= 1.0) && (L5 >= 1.0))
5162 for (j = 0; j < 3; j++)
5164 dshape(5,j) = DL0[j];
5165 dshape(7,j) = DL4[j];
5166 dshape(8,j) = - DL2[j];
5167 dshape(9,j) = DL5[j];
5200 double x = ip.
x, y = ip.
y;
5202 Lx = 2.0 * ( 1. - x );
5203 Ly = 2.0 * ( 1. - y );
5212 for (i = 0; i < 9; i++)
5217 if ((x <= 0.5) && (y <= 0.5))
5219 shape(0) = (Lx - 1.0) * (Ly - 1.0);
5220 shape(4) = (2.0 - Lx) * (Ly - 1.0);
5221 shape(8) = (2.0 - Lx) * (2.0 - Ly);
5222 shape(7) = (Lx - 1.0) * (2.0 - Ly);
5224 else if ((x >= 0.5) && (y <= 0.5))
5226 shape(4) = Lx * (Ly - 1.0);
5227 shape(1) = (1.0 - Lx) * (Ly - 1.0);
5228 shape(5) = (1.0 - Lx) * (2.0 - Ly);
5229 shape(8) = Lx * (2.0 - Ly);
5231 else if ((x >= 0.5) && (y >= 0.5))
5233 shape(8) = Lx * Ly ;
5234 shape(5) = (1.0 - Lx) * Ly ;
5235 shape(2) = (1.0 - Lx) * (1.0 - Ly);
5236 shape(6) = Lx * (1.0 - Ly);
5238 else if ((x <= 0.5) && (y >= 0.5))
5240 shape(7) = (Lx - 1.0) * Ly ;
5241 shape(8) = (2.0 - Lx) * Ly ;
5242 shape(6) = (2.0 - Lx) * (1.0 - Ly);
5243 shape(3) = (Lx - 1.0) * (1.0 - Ly);
5251 double x = ip.
x, y = ip.
y;
5253 Lx = 2.0 * ( 1. - x );
5254 Ly = 2.0 * ( 1. - y );
5256 for (i = 0; i < 9; i++)
5257 for (j = 0; j < 2; j++)
5262 if ((x <= 0.5) && (y <= 0.5))
5264 dshape(0,0) = 2.0 * (1.0 - Ly);
5265 dshape(0,1) = 2.0 * (1.0 - Lx);
5267 dshape(4,0) = 2.0 * (Ly - 1.0);
5268 dshape(4,1) = -2.0 * (2.0 - Lx);
5270 dshape(8,0) = 2.0 * (2.0 - Ly);
5271 dshape(8,1) = 2.0 * (2.0 - Lx);
5273 dshape(7,0) = -2.0 * (2.0 - Ly);
5274 dshape(7,0) = 2.0 * (Lx - 1.0);
5276 else if ((x >= 0.5) && (y <= 0.5))
5278 dshape(4,0) = -2.0 * (Ly - 1.0);
5279 dshape(4,1) = -2.0 * Lx;
5281 dshape(1,0) = 2.0 * (Ly - 1.0);
5282 dshape(1,1) = -2.0 * (1.0 - Lx);
5284 dshape(5,0) = 2.0 * (2.0 - Ly);
5285 dshape(5,1) = 2.0 * (1.0 - Lx);
5287 dshape(8,0) = -2.0 * (2.0 - Ly);
5288 dshape(8,1) = 2.0 * Lx;
5290 else if ((x >= 0.5) && (y >= 0.5))
5292 dshape(8,0) = -2.0 * Ly;
5293 dshape(8,1) = -2.0 * Lx;
5295 dshape(5,0) = 2.0 * Ly;
5296 dshape(5,1) = -2.0 * (1.0 - Lx);
5298 dshape(2,0) = 2.0 * (1.0 - Ly);
5299 dshape(2,1) = 2.0 * (1.0 - Lx);
5301 dshape(6,0) = -2.0 * (1.0 - Ly);
5302 dshape(6,1) = 2.0 * Lx;
5304 else if ((x <= 0.5) && (y >= 0.5))
5306 dshape(7,0) = -2.0 * Ly;
5307 dshape(7,1) = -2.0 * (Lx - 1.0);
5309 dshape(8,0) = 2.0 * Ly ;
5310 dshape(8,1) = -2.0 * (2.0 - Lx);
5312 dshape(6,0) = 2.0 * (1.0 - Ly);
5313 dshape(6,1) = 2.0 * (2.0 - Lx);
5315 dshape(3,0) = -2.0 * (1.0 - Ly);
5316 dshape(3,1) = 2.0 * (Lx - 1.0);
5327 I[ 0] = 0.0; J[ 0] = 0.0; K[ 0] = 0.0;
5328 I[ 1] = 1.0; J[ 1] = 0.0; K[ 1] = 0.0;
5329 I[ 2] = 1.0; J[ 2] = 1.0; K[ 2] = 0.0;
5330 I[ 3] = 0.0; J[ 3] = 1.0; K[ 3] = 0.0;
5331 I[ 4] = 0.0; J[ 4] = 0.0; K[ 4] = 1.0;
5332 I[ 5] = 1.0; J[ 5] = 0.0; K[ 5] = 1.0;
5333 I[ 6] = 1.0; J[ 6] = 1.0; K[ 6] = 1.0;
5334 I[ 7] = 0.0; J[ 7] = 1.0; K[ 7] = 1.0;
5336 I[ 8] = 0.5; J[ 8] = 0.0; K[ 8] = 0.0;
5337 I[ 9] = 1.0; J[ 9] = 0.5; K[ 9] = 0.0;
5338 I[10] = 0.5; J[10] = 1.0; K[10] = 0.0;
5339 I[11] = 0.0; J[11] = 0.5; K[11] = 0.0;
5340 I[12] = 0.5; J[12] = 0.0; K[12] = 1.0;
5341 I[13] = 1.0; J[13] = 0.5; K[13] = 1.0;
5342 I[14] = 0.5; J[14] = 1.0; K[14] = 1.0;
5343 I[15] = 0.0; J[15] = 0.5; K[15] = 1.0;
5344 I[16] = 0.0; J[16] = 0.0; K[16] = 0.5;
5345 I[17] = 1.0; J[17] = 0.0; K[17] = 0.5;
5346 I[18] = 1.0; J[18] = 1.0; K[18] = 0.5;
5347 I[19] = 0.0; J[19] = 1.0; K[19] = 0.5;
5349 I[20] = 0.5; J[20] = 0.5; K[20] = 0.0;
5350 I[21] = 0.5; J[21] = 0.0; K[21] = 0.5;
5351 I[22] = 1.0; J[22] = 0.5; K[22] = 0.5;
5352 I[23] = 0.5; J[23] = 1.0; K[23] = 0.5;
5353 I[24] = 0.0; J[24] = 0.5; K[24] = 0.5;
5354 I[25] = 0.5; J[25] = 0.5; K[25] = 1.0;
5356 I[26] = 0.5; J[26] = 0.5; K[26] = 0.5;
5358 for (
int n = 0; n < 27; n++)
5371 double x = ip.
x, y = ip.
y, z = ip.
z;
5373 for (i = 0; i < 27; i++)
5378 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5393 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5408 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5423 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5438 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5453 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5468 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5499 shape(N[0]) = Lx * Ly * Lz;
5500 shape(N[1]) = (1 - Lx) * Ly * Lz;
5501 shape(N[2]) = (1 - Lx) * (1 - Ly) * Lz;
5502 shape(N[3]) = Lx * (1 - Ly) * Lz;
5503 shape(N[4]) = Lx * Ly * (1 - Lz);
5504 shape(N[5]) = (1 - Lx) * Ly * (1 - Lz);
5505 shape(N[6]) = (1 - Lx) * (1 - Ly) * (1 - Lz);
5506 shape(N[7]) = Lx * (1 - Ly) * (1 - Lz);
5514 double x = ip.
x, y = ip.
y, z = ip.
z;
5516 for (i = 0; i < 27; i++)
5517 for (j = 0; j < 3; j++)
5522 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5537 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5552 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5567 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5582 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5597 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5612 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5643 dshape(N[0],0) = -2.0 * Ly * Lz ;
5644 dshape(N[0],1) = -2.0 * Lx * Lz ;
5645 dshape(N[0],2) = -2.0 * Lx * Ly ;
5647 dshape(N[1],0) = 2.0 * Ly * Lz ;
5648 dshape(N[1],1) = -2.0 * (1 - Lx) * Lz ;
5649 dshape(N[1],2) = -2.0 * (1 - Lx) * Ly ;
5651 dshape(N[2],0) = 2.0 * (1 - Ly) * Lz ;
5652 dshape(N[2],1) = 2.0 * (1 - Lx) * Lz ;
5653 dshape(N[2],2) = -2.0 * (1 - Lx) * (1 - Ly);
5655 dshape(N[3],0) = -2.0 * (1 - Ly) * Lz ;
5656 dshape(N[3],1) = 2.0 * Lx * Lz ;
5657 dshape(N[3],2) = -2.0 * Lx * (1 - Ly);
5659 dshape(N[4],0) = -2.0 * Ly * (1 - Lz);
5660 dshape(N[4],1) = -2.0 * Lx * (1 - Lz);
5661 dshape(N[4],2) = 2.0 * Lx * Ly ;
5663 dshape(N[5],0) = 2.0 * Ly * (1 - Lz);
5664 dshape(N[5],1) = -2.0 * (1 - Lx) * (1 - Lz);
5665 dshape(N[5],2) = 2.0 * (1 - Lx) * Ly ;
5667 dshape(N[6],0) = 2.0 * (1 - Ly) * (1 - Lz);
5668 dshape(N[6],1) = 2.0 * (1 - Lx) * (1 - Lz);
5669 dshape(N[6],2) = 2.0 * (1 - Lx) * (1 - Ly);
5671 dshape(N[7],0) = -2.0 * (1 - Ly) * (1 - Lz);
5672 dshape(N[7],1) = 2.0 * Lx * (1 - Lz);
5673 dshape(N[7],2) = 2.0 * Lx * (1 - Ly);
5733 double x = ip.
x, y = ip.
y, z = ip.
z;
5735 shape(0,0) = (1. - y) * (1. - z);
5739 shape(2,0) = y * (1. - z);
5743 shape(4,0) = z * (1. - y);
5752 shape(1,1) = x * (1. - z);
5756 shape(3,1) = (1. - x) * (1. - z);
5764 shape(7,1) = (1. - x) * z;
5769 shape(8,2) = (1. - x) * (1. - y);
5773 shape(9,2) = x * (1. - y);
5777 shape(10,2) = x * y;
5781 shape(11,2) = y * (1. - x);
5789 double x = ip.
x, y = ip.
y, z = ip.
z;
5791 curl_shape(0,0) = 0.;
5792 curl_shape(0,1) = y - 1.;
5793 curl_shape(0,2) = 1. - z;
5795 curl_shape(2,0) = 0.;
5796 curl_shape(2,1) = -y;
5797 curl_shape(2,2) = z - 1.;
5799 curl_shape(4,0) = 0;
5800 curl_shape(4,1) = 1. - y;
5801 curl_shape(4,2) = z;
5803 curl_shape(6,0) = 0.;
5804 curl_shape(6,1) = y;
5805 curl_shape(6,2) = -z;
5807 curl_shape(1,0) = x;
5808 curl_shape(1,1) = 0.;
5809 curl_shape(1,2) = 1. - z;
5811 curl_shape(3,0) = 1. - x;
5812 curl_shape(3,1) = 0.;
5813 curl_shape(3,2) = z - 1.;
5815 curl_shape(5,0) = -x;
5816 curl_shape(5,1) = 0.;
5817 curl_shape(5,2) = z;
5819 curl_shape(7,0) = x - 1.;
5820 curl_shape(7,1) = 0.;
5821 curl_shape(7,2) = -z;
5823 curl_shape(8,0) = x - 1.;
5824 curl_shape(8,1) = 1. - y;
5825 curl_shape(8,2) = 0.;
5827 curl_shape(9,0) = -x;
5828 curl_shape(9,1) = y - 1.;
5829 curl_shape(9,2) = 0;
5831 curl_shape(10,0) = x;
5832 curl_shape(10,1) = -y;
5833 curl_shape(10,2) = 0.;
5835 curl_shape(11,0) = 1. - x;
5836 curl_shape(11,1) = y;
5837 curl_shape(11,2) = 0.;
5840 const double Nedelec1HexFiniteElement::tk[12][3] =
5842 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5843 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5844 {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}
5851 #ifdef MFEM_THREAD_SAFE
5856 for (k = 0; k < 12; k++)
5859 for (j = 0; j < 12; j++)
5861 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
5863 if (j == k) { d -= 1.0; }
5864 if (fabs(d) > 1.0e-12)
5866 mfem::err <<
"Nedelec1HexFiniteElement::GetLocalInterpolation (...)\n"
5867 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
5875 ip.
x = ip.
y = ip.
z = 0.0;
5882 for (k = 0; k < 12; k++)
5885 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
5888 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
5889 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
5890 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
5891 for (j = 0; j < 12; j++)
5892 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
5893 vshape(j,2)*vk[2])) < 1.0e-12)
5907 for (
int k = 0; k < 12; k++)
5915 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
5916 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
5917 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
5954 double x = ip.
x, y = ip.
y, z = ip.
z;
5956 shape(0,0) = 1. - y - z;
5961 shape(1,1) = 1. - x - z;
5966 shape(2,2) = 1. - x - y;
5985 curl_shape(0,0) = 0.;
5986 curl_shape(0,1) = -2.;
5987 curl_shape(0,2) = 2.;
5989 curl_shape(1,0) = 2.;
5990 curl_shape(1,1) = 0.;
5991 curl_shape(1,2) = -2.;
5993 curl_shape(2,0) = -2.;
5994 curl_shape(2,1) = 2.;
5995 curl_shape(2,2) = 0.;
5997 curl_shape(3,0) = 0.;
5998 curl_shape(3,1) = 0.;
5999 curl_shape(3,2) = 2.;
6001 curl_shape(4,0) = 0.;
6002 curl_shape(4,1) = -2.;
6003 curl_shape(4,2) = 0.;
6005 curl_shape(5,0) = 2.;
6006 curl_shape(5,1) = 0.;
6007 curl_shape(5,2) = 0.;
6010 const double Nedelec1TetFiniteElement::tk[6][3] =
6011 {{1,0,0}, {0,1,0}, {0,0,1}, {-1,1,0}, {-1,0,1}, {0,-1,1}};
6017 #ifdef MFEM_THREAD_SAFE
6022 for (k = 0; k < 6; k++)
6025 for (j = 0; j < 6; j++)
6027 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
6029 if (j == k) { d -= 1.0; }
6030 if (fabs(d) > 1.0e-12)
6032 mfem::err <<
"Nedelec1TetFiniteElement::GetLocalInterpolation (...)\n"
6033 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6041 ip.
x = ip.
y = ip.
z = 0.0;
6048 for (k = 0; k < 6; k++)
6051 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6054 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
6055 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
6056 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
6057 for (j = 0; j < 6; j++)
6058 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6059 vshape(j,2)*vk[2])) < 1.0e-12)
6073 for (
int k = 0; k < 6; k++)
6081 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
6082 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
6083 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
6120 double x = ip.
x, y = ip.
y, z = ip.
z;
6124 shape(0,2) = z - 1.;
6127 shape(1,1) = y - 1.;
6138 shape(4,0) = x - 1.;
6158 const double RT0HexFiniteElement::nk[6][3] =
6159 {{0,0,-1}, {0,-1,0}, {1,0,0}, {0,1,0}, {-1,0,0}, {0,0,1}};
6165 #ifdef MFEM_THREAD_SAFE
6171 for (k = 0; k < 6; k++)
6174 for (j = 0; j < 6; j++)
6176 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6178 if (j == k) { d -= 1.0; }
6179 if (fabs(d) > 1.0e-12)
6181 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6182 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6190 ip.
x = ip.
y = ip.
z = 0.0;
6198 for (k = 0; k < 6; k++)
6201 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6204 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6205 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6206 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6207 for (j = 0; j < 6; j++)
6208 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6209 vshape(j,2)*vk[2])) < 1.0e-12)
6222 #ifdef MFEM_THREAD_SAFE
6226 for (
int k = 0; k < 6; k++)
6235 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6236 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6237 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6366 double x = ip.
x, y = ip.
y, z = ip.
z;
6370 shape(2,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6373 shape(3,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6376 shape(0,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6379 shape(1,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6382 shape(4,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6385 shape(5,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6388 shape(6,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6391 shape(7,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6394 shape(8,0) = (-x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6397 shape(9,0) = (-x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6400 shape(10,0) = (-x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6403 shape(11,0) = (-x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6408 shape(13,1) = (-y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6411 shape(12,1) = (-y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6414 shape(15,1) = (-y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6417 shape(14,1) = (-y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6420 shape(17,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6423 shape(16,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6426 shape(19,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6429 shape(18,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6435 shape(20,2) = (-z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6438 shape(21,2) = (-z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6441 shape(22,2) = (-z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6444 shape(23,2) = (-z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6446 shape(24,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6449 shape(25,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6452 shape(26,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6455 shape(27,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6460 shape(28,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6463 shape(29,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6466 shape(30,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6469 shape(31,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6474 shape(32,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6477 shape(33,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6480 shape(34,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6483 shape(35,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6489 double x = ip.
x, y = ip.
y, z = ip.
z;
6491 divshape(2) = -(-3. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6492 divshape(3) = -(-3. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6493 divshape(0) = -(-3. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6494 divshape(1) = -(-3. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6496 divshape(4) = -(-3. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6497 divshape(5) = -(-3. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6498 divshape(6) = -(-3. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6499 divshape(7) = -(-3. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6501 divshape(8) = (-1. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6502 divshape(9) = (-1. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6503 divshape(10) = (-1. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6504 divshape(11) = (-1. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6506 divshape(13) = (-1. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6507 divshape(12) = (-1. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6508 divshape(15) = (-1. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6509 divshape(14) = (-1. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6511 divshape(17) = -(-3. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6512 divshape(16) = -(-3. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6513 divshape(19) = -(-3. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6514 divshape(18) = -(-3. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6516 divshape(20) = (-1. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6517 divshape(21) = (-1. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6518 divshape(22) = (-1. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6519 divshape(23) = (-1. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6521 divshape(24) = ( 4. - 8.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6522 divshape(25) = ( 4. - 8.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6523 divshape(26) = ( 4. - 8.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6524 divshape(27) = ( 4. - 8.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6526 divshape(28) = ( 4. - 8.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6527 divshape(29) = ( 4. - 8.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6528 divshape(30) = ( 4. - 8.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6529 divshape(31) = ( 4. - 8.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6531 divshape(32) = ( 4. - 8.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6532 divshape(33) = ( 4. - 8.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6533 divshape(34) = ( 4. - 8.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6534 divshape(35) = ( 4. - 8.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6537 const double RT1HexFiniteElement::nk[36][3] =
6539 {0, 0,-1}, {0, 0,-1}, {0, 0,-1}, {0, 0,-1},
6540 {0,-1, 0}, {0,-1, 0}, {0,-1, 0}, {0,-1, 0},
6541 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6542 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6543 {-1,0, 0}, {-1,0, 0}, {-1,0, 0}, {-1,0, 0},
6544 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
6545 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6546 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6547 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}
6554 #ifdef MFEM_THREAD_SAFE
6560 for (k = 0; k < 36; k++)
6563 for (j = 0; j < 36; j++)
6565 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6567 if (j == k) { d -= 1.0; }
6568 if (fabs(d) > 1.0e-12)
6570 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6571 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6579 ip.
x = ip.
y = ip.
z = 0.0;
6587 for (k = 0; k < 36; k++)
6590 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6593 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6594 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6595 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6596 for (j = 0; j < 36; j++)
6597 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6598 vshape(j,2)*vk[2])) < 1.0e-12)
6611 #ifdef MFEM_THREAD_SAFE
6615 for (
int k = 0; k < 36; k++)
6624 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6625 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6626 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6654 double x2 = 2.0*ip.
x, y2 = 2.0*ip.
y, z2 = 2.0*ip.
z;
6660 shape(1,0) = x2 - 2.0;
6665 shape(2,1) = y2 - 2.0;
6670 shape(3,2) = z2 - 2.0;
6682 const double RT0TetFiniteElement::nk[4][3] =
6683 {{.5,.5,.5}, {-.5,0,0}, {0,-.5,0}, {0,0,-.5}};
6689 #ifdef MFEM_THREAD_SAFE
6695 for (k = 0; k < 4; k++)
6698 for (j = 0; j < 4; j++)
6700 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6702 if (j == k) { d -= 1.0; }
6703 if (fabs(d) > 1.0e-12)
6705 mfem::err <<
"RT0TetFiniteElement::GetLocalInterpolation (...)\n"
6706 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6714 ip.
x = ip.
y = ip.
z = 0.0;
6722 for (k = 0; k < 4; k++)
6725 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6728 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6729 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6730 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6731 for (j = 0; j < 4; j++)
6732 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6733 vshape(j,2)*vk[2])) < 1.0e-12)
6746 #ifdef MFEM_THREAD_SAFE
6750 for (
int k = 0; k < 4; k++)
6759 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6760 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6761 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6796 double x = 2. * ip.
x - 1.;
6797 double y = 2. * ip.
y - 1.;
6798 double z = 2. * ip.
z - 1.;
6799 double f5 = x * x - y * y;
6800 double f6 = y * y - z * z;
6802 shape(0) = (1./6.) * (1. - 3. * z - f5 - 2. * f6);
6803 shape(1) = (1./6.) * (1. - 3. * y - f5 + f6);
6804 shape(2) = (1./6.) * (1. + 3. * x + 2. * f5 + f6);
6805 shape(3) = (1./6.) * (1. + 3. * y - f5 + f6);
6806 shape(4) = (1./6.) * (1. - 3. * x + 2. * f5 + f6);
6807 shape(5) = (1./6.) * (1. + 3. * z - f5 - 2. * f6);
6813 const double a = 2./3.;
6815 double xt = a * (1. - 2. * ip.
x);
6816 double yt = a * (1. - 2. * ip.
y);
6817 double zt = a * (1. - 2. * ip.
z);
6821 dshape(0,2) = -1. - 2. * zt;
6824 dshape(1,1) = -1. - 2. * yt;
6827 dshape(2,0) = 1. - 2. * xt;
6832 dshape(3,1) = 1. - 2. * yt;
6835 dshape(4,0) = -1. - 2. * xt;
6841 dshape(5,2) = 1. - 2. * zt;
6855 for (
int i = 0; i <= p; i++)
6869 for (
int i = 0; i <= p; i++)
6871 for (
int j = 0; j < i; j++)
6873 double xij = x(i) - x(j);
6878 for (
int i = 0; i <= p; i++)
6885 for (
int i = 0; i < p; i++)
6889 mfem_error(
"Poly_1D::Basis::Basis : nodes are not increasing!");
6915 int i, k, p = x.Size() - 1;
6925 for (k = 0; k < p; k++)
6927 if (y >= (x(k) + x(k+1))/2)
6933 for (i = k+1; i <= p; i++)
6940 l = lk * (y - x(k));
6942 for (i = 0; i < k; i++)
6944 u(i) = l * w(i) / (y - x(i));
6947 for (i++; i <= p; i++)
6949 u(i) = l * w(i) / (y - x(i));
6974 int i, k, p = x.Size() - 1;
6975 double l, lp, lk, sk, si;
6985 for (k = 0; k < p; k++)
6987 if (y >= (x(k) + x(k+1))/2)
6993 for (i = k+1; i <= p; i++)
7000 l = lk * (y - x(k));
7003 for (i = 0; i < k; i++)
7005 si = 1.0/(y - x(i));
7007 u(i) = l * si * w(i);
7010 for (i++; i <= p; i++)
7012 si = 1.0/(y - x(i));
7014 u(i) = l * si * w(i);
7018 for (i = 0; i < k; i++)
7020 d(i) = (lp * w(i) - u(i))/(y - x(i));
7023 for (i++; i <= p; i++)
7025 d(i) = (lp * w(i) - u(i))/(y - x(i));
7042 for (
int i = 0; i <= p; i++)
7044 binom(i,0) = binom(i,i) = 1;
7045 for (
int j = 1; j < i; j++)
7047 binom(i,j) = binom(i-1,j) + binom(i-1,j-1);
7056 for (
int i = 0; i <= p; i++)
7059 double s = sin(M_PI_2*(i + 0.5)/(p + 1));
7064 void Poly_1D::CalcMono(
const int p,
const double x,
double *u)
7068 for (
int n = 1; n <= p; n++)
7074 void Poly_1D::CalcMono(
const int p,
const double x,
double *u,
double *d)
7079 for (
int n = 1; n <= p; n++)
7099 for (i = 1; i < p; i++)
7106 for (i--; i > 0; i--)
7116 double *u,
double *d)
7127 const double xpy = x + y, ptx = p*x;
7130 for (i = 1; i < p; i++)
7132 d[i] = b[i]*z*(i*xpy - ptx);
7139 for (i--; i > 0; i--)
7161 const double xpy = x + y, ptx = p*x;
7164 for (i = 1; i < p; i++)
7166 d[i] = b[i]*z*(i*xpy - ptx);
7171 for (i--; i > 0; i--)
7186 if (p == 0) {
return; }
7187 u[1] = z = 2.*x - 1.;
7188 for (
int n = 1; n < p; n++)
7190 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7203 if (p == 0) {
return; }
7204 u[1] = z = 2.*x - 1.;
7206 for (
int n = 1; n < p; n++)
7208 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7209 d[n+1] = (4*n + 2)*u[n] + d[n-1];
7213 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u)
7220 if (p == 0) {
return; }
7221 u[1] = z = 2.*x - 1.;
7222 for (
int n = 1; n < p; n++)
7224 u[n+1] = 2*z*u[n] - u[n-1];
7228 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d)
7241 if (p == 0) {
return; }
7242 u[1] = z = 2.*x - 1.;
7244 for (
int n = 1; n < p; n++)
7246 u[n+1] = 2*z*u[n] - u[n-1];
7247 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7251 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d,
7267 if (p == 0) {
return; }
7268 u[1] = z = 2.*x - 1.;
7271 for (
int n = 1; n < p; n++)
7273 u[n+1] = 2*z*u[n] - u[n-1];
7274 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7275 dd[n+1] = (n + 1)*(2.*(n + 1)*d[n] + z*dd[n])/n;
7286 if (points_container.find(btype) == points_container.end())
7291 if (pts.
Size() <= p)
7297 pts[p] =
new double[p + 1];
7307 if ( bases_container.find(btype) == bases_container.end() )
7313 if (bases.
Size() <= p)
7317 if (bases[p] == NULL)
7327 for (PointsMap::iterator it = points_container.begin();
7328 it != points_container.end() ; ++it)
7331 for (
int i = 0 ; i < pts.
Size() ; ++i )
7338 for (BasisMap::iterator it = bases_container.begin();
7339 it != bases_container.end() ; ++it)
7342 for (
int i = 0 ; i < bases.
Size() ; ++i )
7368 for (
int i = 1; i < p; i++)
7376 const int p1 = p + 1;
7387 for (
int i = 1; i < p; i++)
7391 for (
int i = 1; i < p; i++)
7395 for (
int i = 1; i < p; i++)
7399 for (
int i = 1; i < p; i++)
7405 for (
int j = 1; j < p; j++)
7407 for (
int i = 1; i < p; i++)
7416 const int p1 = p + 1;
7420 dof_map[0 + (0 + 0*p1)*p1] = 0;
7421 dof_map[p + (0 + 0*p1)*p1] = 1;
7422 dof_map[p + (p + 0*p1)*p1] = 2;
7423 dof_map[0 + (p + 0*p1)*p1] = 3;
7424 dof_map[0 + (0 + p*p1)*p1] = 4;
7425 dof_map[p + (0 + p*p1)*p1] = 5;
7426 dof_map[p + (p + p*p1)*p1] = 6;
7427 dof_map[0 + (p + p*p1)*p1] = 7;
7432 for (
int i = 1; i < p; i++)
7434 dof_map[i + (0 + 0*p1)*p1] = o++;
7436 for (
int i = 1; i < p; i++)
7438 dof_map[p + (i + 0*p1)*p1] = o++;
7440 for (
int i = 1; i < p; i++)
7442 dof_map[i + (p + 0*p1)*p1] = o++;
7444 for (
int i = 1; i < p; i++)
7446 dof_map[0 + (i + 0*p1)*p1] = o++;
7448 for (
int i = 1; i < p; i++)
7450 dof_map[i + (0 + p*p1)*p1] = o++;
7452 for (
int i = 1; i < p; i++)
7454 dof_map[p + (i + p*p1)*p1] = o++;
7456 for (
int i = 1; i < p; i++)
7458 dof_map[i + (p + p*p1)*p1] = o++;
7460 for (
int i = 1; i < p; i++)
7462 dof_map[0 + (i + p*p1)*p1] = o++;
7464 for (
int i = 1; i < p; i++)
7466 dof_map[0 + (0 + i*p1)*p1] = o++;
7468 for (
int i = 1; i < p; i++)
7470 dof_map[p + (0 + i*p1)*p1] = o++;
7472 for (
int i = 1; i < p; i++)
7474 dof_map[p + (p + i*p1)*p1] = o++;
7476 for (
int i = 1; i < p; i++)
7478 dof_map[0 + (p + i*p1)*p1] = o++;
7482 for (
int j = 1; j < p; j++)
7484 for (
int i = 1; i < p; i++)
7486 dof_map[i + ((p-j) + 0*p1)*p1] = o++;
7489 for (
int j = 1; j < p; j++)
7491 for (
int i = 1; i < p; i++)
7493 dof_map[i + (0 + j*p1)*p1] = o++;
7496 for (
int j = 1; j < p; j++)
7498 for (
int i = 1; i < p; i++)
7500 dof_map[p + (i + j*p1)*p1] = o++;
7503 for (
int j = 1; j < p; j++)
7505 for (
int i = 1; i < p; i++)
7507 dof_map[(p-i) + (p + j*p1)*p1] = o++;
7510 for (
int j = 1; j < p; j++)
7512 for (
int i = 1; i < p; i++)
7514 dof_map[0 + ((p-i) + j*p1)*p1] = o++;
7517 for (
int j = 1; j < p; j++)
7519 for (
int i = 1; i < p; i++)
7521 dof_map[i + (j + p*p1)*p1] = o++;
7526 for (
int k = 1; k < p; k++)
7528 for (
int j = 1; j < p; j++)
7530 for (
int i = 1; i < p; i++)
7532 dof_map[i + (j + k*p1)*p1] = o++;
7539 MFEM_ABORT(
"invalid dimension: " << dims);
7550 MFEM_ABORT(
"invalid DofMapType: " << dmtype);
7565 const int dims,
const int p,
const DofMapType dmtype)
7567 Pow(p + 1, dims), p,
7581 cbasis1d(
poly1d.GetBasis(p, VerifyClosed(cbtype))),
7582 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(obtype))) { }
7589 #ifndef MFEM_THREAD_SAFE
7596 for (
int i = 1; i < p; i++)
7605 const int p =
Order;
7607 #ifdef MFEM_THREAD_SAFE
7613 shape(0) = shape_x(0);
7614 shape(1) = shape_x(p);
7615 for (
int i = 1; i < p; i++)
7617 shape(i+1) = shape_x(i);
7624 const int p =
Order;
7626 #ifdef MFEM_THREAD_SAFE
7627 Vector shape_x(p+1), dshape_x(p+1);
7632 dshape(0,0) = dshape_x(0);
7633 dshape(1,0) = dshape_x(p);
7634 for (
int i = 1; i < p; i++)
7636 dshape(i+1,0) = dshape_x(i);
7642 const int p =
Order;
7650 for (
int i = 1; i < p; i++)
7659 for (
int i = 1; i < p; i++)
7673 #ifndef MFEM_THREAD_SAFE
7674 const int p1 = p + 1;
7683 for (
int j = 0; j <= p; j++)
7685 for (
int i = 0; i <= p; i++)
7695 const int p =
Order;
7697 #ifdef MFEM_THREAD_SAFE
7698 Vector shape_x(p+1), shape_y(p+1);
7704 for (
int o = 0, j = 0; j <= p; j++)
7705 for (
int i = 0; i <= p; i++)
7707 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
7714 const int p =
Order;
7716 #ifdef MFEM_THREAD_SAFE
7717 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
7723 for (
int o = 0, j = 0; j <= p; j++)
7725 for (
int i = 0; i <= p; i++)
7727 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
7728 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
7735 const int p =
Order;
7738 #ifdef MFEM_THREAD_SAFE
7739 Vector shape_x(p+1), shape_y(p+1);
7742 for (
int i = 0; i <= p; i++)
7751 for (
int o = 0, j = 0; j <= p; j++)
7752 for (
int i = 0; i <= p; i++)
7754 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j);
7758 for (
int o = 0, j = 0; j <= p; j++)
7759 for (
int i = 0; i <= p; i++)
7761 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j);
7765 for (
int o = 0, j = 0; j <= p; j++)
7766 for (
int i = 0; i <= p; i++)
7768 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j);
7772 for (
int o = 0, j = 0; j <= p; j++)
7773 for (
int i = 0; i <= p; i++)
7775 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j);
7787 #ifndef MFEM_THREAD_SAFE
7788 const int p1 = p + 1;
7799 for (
int k = 0; k <= p; k++)
7800 for (
int j = 0; j <= p; j++)
7801 for (
int i = 0; i <= p; i++)
7810 const int p =
Order;
7812 #ifdef MFEM_THREAD_SAFE
7813 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7820 for (
int o = 0, k = 0; k <= p; k++)
7821 for (
int j = 0; j <= p; j++)
7822 for (
int i = 0; i <= p; i++)
7824 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
7831 const int p =
Order;
7833 #ifdef MFEM_THREAD_SAFE
7834 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7835 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
7842 for (
int o = 0, k = 0; k <= p; k++)
7843 for (
int j = 0; j <= p; j++)
7844 for (
int i = 0; i <= p; i++)
7846 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
7847 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
7848 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
7854 const int p =
Order;
7857 #ifdef MFEM_THREAD_SAFE
7858 Vector shape_x(p+1), shape_y(p+1);
7861 for (
int i = 0; i <= p; i++)
7870 for (
int o = 0, k = 0; k <= p; k++)
7871 for (
int j = 0; j <= p; j++)
7872 for (
int i = 0; i <= p; i++)
7874 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_x(k);
7878 for (
int o = 0, k = 0; k <= p; k++)
7879 for (
int j = 0; j <= p; j++)
7880 for (
int i = 0; i <= p; i++)
7882 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_x(k);
7886 for (
int o = 0, k = 0; k <= p; k++)
7887 for (
int j = 0; j <= p; j++)
7888 for (
int i = 0; i <= p; i++)
7890 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_x(k);
7894 for (
int o = 0, k = 0; k <= p; k++)
7895 for (
int j = 0; j <= p; j++)
7896 for (
int i = 0; i <= p; i++)
7898 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_x(k);
7902 for (
int o = 0, k = 0; k <= p; k++)
7903 for (
int j = 0; j <= p; j++)
7904 for (
int i = 0; i <= p; i++)
7906 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_y(k);
7910 for (
int o = 0, k = 0; k <= p; k++)
7911 for (
int j = 0; j <= p; j++)
7912 for (
int i = 0; i <= p; i++)
7914 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_y(k);
7918 for (
int o = 0, k = 0; k <= p; k++)
7919 for (
int j = 0; j <= p; j++)
7920 for (
int i = 0; i <= p; i++)
7922 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_y(k);
7926 for (
int o = 0, k = 0; k <= p; k++)
7927 for (
int j = 0; j <= p; j++)
7928 for (
int i = 0; i <= p; i++)
7930 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_y(k);
7940 #ifndef MFEM_THREAD_SAFE
7949 for (
int i = 1; i < p; i++)
7958 const int p =
Order;
7960 #ifdef MFEM_THREAD_SAFE
7967 shape(0) = shape_x(0);
7968 shape(1) = shape_x(p);
7969 for (
int i = 1; i < p; i++)
7971 shape(i+1) = shape_x(i);
7978 const int p =
Order;
7980 #ifdef MFEM_THREAD_SAFE
7981 Vector shape_x(p+1), dshape_x(p+1);
7987 dshape(0,0) = dshape_x(0);
7988 dshape(1,0) = dshape_x(p);
7989 for (
int i = 1; i < p; i++)
7991 dshape(i+1,0) = dshape_x(i);
8005 #ifndef MFEM_THREAD_SAFE
8006 const int p1 = p + 1;
8015 for (
int j = 0; j <= p; j++)
8016 for (
int i = 0; i <= p; i++)
8025 const int p =
Order;
8027 #ifdef MFEM_THREAD_SAFE
8028 Vector shape_x(p+1), shape_y(p+1);
8035 for (
int o = 0, j = 0; j <= p; j++)
8036 for (
int i = 0; i <= p; i++)
8038 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
8045 const int p =
Order;
8047 #ifdef MFEM_THREAD_SAFE
8048 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
8055 for (
int o = 0, j = 0; j <= p; j++)
8056 for (
int i = 0; i <= p; i++)
8058 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
8059 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
8073 #ifndef MFEM_THREAD_SAFE
8074 const int p1 = p + 1;
8085 for (
int k = 0; k <= p; k++)
8086 for (
int j = 0; j <= p; j++)
8087 for (
int i = 0; i <= p; i++)
8095 const int p =
Order;
8097 #ifdef MFEM_THREAD_SAFE
8098 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8105 for (
int o = 0, k = 0; k <= p; k++)
8106 for (
int j = 0; j <= p; j++)
8107 for (
int i = 0; i <= p; i++)
8109 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
8116 const int p =
Order;
8118 #ifdef MFEM_THREAD_SAFE
8119 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8120 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8127 for (
int o = 0, k = 0; k <= p; k++)
8128 for (
int j = 0; j <= p; j++)
8129 for (
int i = 0; i <= p; i++)
8131 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
8132 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
8133 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
8150 #ifndef MFEM_THREAD_SAFE
8164 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8174 for (
int i = 1; i < p; i++)
8178 for (
int i = 1; i < p; i++)
8182 for (
int i = 1; i < p; i++)
8188 for (
int j = 1; j < p; j++)
8189 for (
int i = 1; i + j < p; i++)
8191 const double w = cp[i] + cp[j] + cp[p-i-j];
8196 for (
int k = 0; k <
Dof; k++)
8204 for (
int j = 0; j <= p; j++)
8205 for (
int i = 0; i + j <= p; i++)
8207 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8218 const int p =
Order;
8220 #ifdef MFEM_THREAD_SAFE
8221 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
Dof);
8228 for (
int o = 0, j = 0; j <= p; j++)
8229 for (
int i = 0; i + j <= p; i++)
8231 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8240 const int p =
Order;
8242 #ifdef MFEM_THREAD_SAFE
8243 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8244 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8252 for (
int o = 0, j = 0; j <= p; j++)
8253 for (
int i = 0; i + j <= p; i++)
8256 du(o,0) = ((dshape_x(i)* shape_l(k)) -
8257 ( shape_x(i)*dshape_l(k)))*shape_y(j);
8258 du(o,1) = ((dshape_y(j)* shape_l(k)) -
8259 ( shape_y(j)*dshape_l(k)))*shape_x(i);
8263 Ti.
Mult(du, dshape);
8269 const int p =
Order;
8270 #ifdef MFEM_THREAD_SAFE
8271 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8272 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8273 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_l(p + 1);
8281 for (
int o = 0, j = 0; j <= p; j++)
8282 for (
int i = 0; i + j <= p; i++)
8286 ddu(o,0) = ((ddshape_x(i) * shape_l(k)) - 2. * (dshape_x(i) * dshape_l(k)) +
8287 (shape_x(i) * ddshape_l(k))) * shape_y(j);
8288 ddu(o,1) = (((shape_x(i) * ddshape_l(k)) - dshape_x(i) * dshape_l(k)) * shape_y(
8289 j)) + (((dshape_x(i) * shape_l(k)) - (shape_x(i) * dshape_l(k))) * dshape_y(j));
8290 ddu(o,2) = ((ddshape_y(j) * shape_l(k)) - 2. * (dshape_y(j) * dshape_l(k)) +
8291 (shape_y(j) * ddshape_l(k))) * shape_x(i);
8295 Ti.
Mult(ddu, ddshape);
8305 #ifndef MFEM_THREAD_SAFE
8322 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8333 for (
int i = 1; i < p; i++)
8337 for (
int i = 1; i < p; i++)
8341 for (
int i = 1; i < p; i++)
8345 for (
int i = 1; i < p; i++)
8349 for (
int i = 1; i < p; i++)
8353 for (
int i = 1; i < p; i++)
8359 for (
int j = 1; j < p; j++)
8360 for (
int i = 1; i + j < p; i++)
8362 double w = cp[i] + cp[j] + cp[p-i-j];
8365 for (
int j = 1; j < p; j++)
8366 for (
int i = 1; i + j < p; i++)
8368 double w = cp[i] + cp[j] + cp[p-i-j];
8371 for (
int j = 1; j < p; j++)
8372 for (
int i = 1; i + j < p; i++)
8374 double w = cp[i] + cp[j] + cp[p-i-j];
8377 for (
int j = 1; j < p; j++)
8378 for (
int i = 1; i + j < p; i++)
8380 double w = cp[i] + cp[j] + cp[p-i-j];
8385 for (
int k = 1; k < p; k++)
8386 for (
int j = 1; j + k < p; j++)
8387 for (
int i = 1; i + j + k < p; i++)
8389 double w = cp[i] + cp[j] + cp[k] + cp[p-i-j-k];
8394 for (
int m = 0; m <
Dof; m++)
8403 for (
int k = 0; k <= p; k++)
8404 for (
int j = 0; j + k <= p; j++)
8405 for (
int i = 0; i + j + k <= p; i++)
8407 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8418 const int p =
Order;
8420 #ifdef MFEM_THREAD_SAFE
8421 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8430 for (
int o = 0, k = 0; k <= p; k++)
8431 for (
int j = 0; j + k <= p; j++)
8432 for (
int i = 0; i + j + k <= p; i++)
8434 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8443 const int p =
Order;
8445 #ifdef MFEM_THREAD_SAFE
8446 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8447 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8456 for (
int o = 0, k = 0; k <= p; k++)
8457 for (
int j = 0; j + k <= p; j++)
8458 for (
int i = 0; i + j + k <= p; i++)
8460 int l = p - i - j - k;
8461 du(o,0) = ((dshape_x(i)* shape_l(l)) -
8462 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
8463 du(o,1) = ((dshape_y(j)* shape_l(l)) -
8464 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
8465 du(o,2) = ((dshape_z(k)* shape_l(l)) -
8466 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
8470 Ti.
Mult(du, dshape);
8476 const int p =
Order;
8478 #ifdef MFEM_THREAD_SAFE
8479 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8480 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8481 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_z(p + 1), ddshape_l(p + 1);
8490 for (
int o = 0, k = 0; k <= p; k++)
8491 for (
int j = 0; j + k <= p; j++)
8492 for (
int i = 0; i + j + k <= p; i++)
8495 int l = p - i - j - k;
8496 ddu(o,0) = ((ddshape_x(i) * shape_l(l)) - 2. * (dshape_x(i) * dshape_l(l)) +
8497 (shape_x(i) * ddshape_l(l))) * shape_y(j) * shape_z(k);
8498 ddu(o,1) = ((dshape_y(j) * ((dshape_x(i) * shape_l(l)) -
8499 (shape_x(i) * dshape_l(l)))) +
8500 (shape_y(j) * ((ddshape_l(l) * shape_x(i)) -
8501 (dshape_x(i) * dshape_l(l)))))* shape_z(k);
8502 ddu(o,2) = ((dshape_z(k) * ((dshape_x(i) * shape_l(l)) -
8503 (shape_x(i) * dshape_l(l)))) +
8504 (shape_z(k) * ((ddshape_l(l) * shape_x(i)) -
8505 (dshape_x(i) * dshape_l(l)))))* shape_y(j);
8506 ddu(o,3) = ((ddshape_y(j) * shape_l(l)) - 2. * (dshape_y(j) * dshape_l(l)) +
8507 (shape_y(j) * ddshape_l(l))) * shape_x(i) * shape_z(k);
8508 ddu(o,4) = ((dshape_z(k) * ((dshape_y(j) * shape_l(l)) -
8509 (shape_y(j)*dshape_l(l))) ) +
8510 (shape_z(k)* ((ddshape_l(l)*shape_y(j)) -
8511 (dshape_y(j) * dshape_l(l)) ) ) )* shape_x(i);
8512 ddu(o,5) = ((ddshape_z(k) * shape_l(l)) - 2. * (dshape_z(k) * dshape_l(l)) +
8513 (shape_z(k) * ddshape_l(l))) * shape_y(j) * shape_x(i);
8516 Ti.
Mult(ddu, ddshape);
8523 #ifndef MFEM_THREAD_SAFE
8533 Index(
int p) { p2p3 = 2*p + 3; }
8534 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
8548 for (
int i = 1; i < p; i++)
8553 for (
int i = 1; i < p; i++)
8558 for (
int i = 1; i < p; i++)
8565 for (
int j = 1; j < p; j++)
8566 for (
int i = 1; i + j < p; i++)
8575 const int p,
const double l1,
const double l2,
double *shape)
8577 const double l3 = 1. - l1 - l2;
8587 for (
int o = 0, j = 0; j <= p; j++)
8591 for (
int i = 0; i <= p - j; i++)
8601 const int p,
const double l1,
const double l2,
8602 double *dshape_1d,
double *dshape)
8604 const int dof = ((p + 1)*(p + 2))/2;
8605 const double l3 = 1. - l1 - l2;
8609 for (
int o = 0, j = 0; j <= p; j++)
8613 for (
int i = 0; i <= p - j; i++)
8615 dshape[o++] = s*dshape_1d[i];
8620 for (
int i = 0; i <= p; i++)
8624 for (
int o = i, j = 0; j <= p - i; j++)
8626 dshape[dof + o] = s*dshape_1d[j];
8636 #ifdef MFEM_THREAD_SAFE
8640 for (
int i = 0; i <
Dof; i++)
8649 #ifdef MFEM_THREAD_SAFE
8654 for (
int d = 0; d < 2; d++)
8656 for (
int i = 0; i <
Dof; i++)
8668 #ifndef MFEM_THREAD_SAFE
8678 int tri(
int k) {
return (k*(k + 1))/2; }
8679 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
8680 Index(
int p_) { p = p_; dof = tet(p + 1); }
8681 int operator()(
int i,
int j,
int k)
8682 {
return dof - tet(p - k) - tri(p + 1 - k - j) + i; }
8698 for (
int i = 1; i < p; i++)
8703 for (
int i = 1; i < p; i++)
8708 for (
int i = 1; i < p; i++)
8713 for (
int i = 1; i < p; i++)
8718 for (
int i = 1; i < p; i++)
8723 for (
int i = 1; i < p; i++)
8730 for (
int j = 1; j < p; j++)
8731 for (
int i = 1; i + j < p; i++)
8736 for (
int j = 1; j < p; j++)
8737 for (
int i = 1; i + j < p; i++)
8742 for (
int j = 1; j < p; j++)
8743 for (
int i = 1; i + j < p; i++)
8748 for (
int j = 1; j < p; j++)
8749 for (
int i = 1; i + j < p; i++)
8756 for (
int k = 1; k < p; k++)
8757 for (
int j = 1; j + k < p; j++)
8758 for (
int i = 1; i + j + k < p; i++)
8767 const int p,
const double l1,
const double l2,
const double l3,
8770 const double l4 = 1. - l1 - l2 - l3;
8779 for (
int o = 0, k = 0; k <= p; k++)
8782 const double ek = bp[k]*l3k;
8784 for (
int j = 0; j <= p - k; j++)
8787 double ekj = ek*bpk[j]*l2j;
8788 for (
int i = 0; i <= p - k - j; i++)
8800 const int p,
const double l1,
const double l2,
const double l3,
8801 double *dshape_1d,
double *dshape)
8803 const int dof = ((p + 1)*(p + 2)*(p + 3))/6;
8804 const double l4 = 1. - l1 - l2 - l3;
8812 for (
int o = 0, k = 0; k <= p; k++)
8815 const double ek = bp[k]*l3k;
8817 for (
int j = 0; j <= p - k; j++)
8820 double ekj = ek*bpk[j]*l2j;
8821 for (
int i = 0; i <= p - k - j; i++)
8823 dshape[o++] = dshape_1d[i]*ekj;
8834 for (
int ok = 0, k = 0; k <= p; k++)
8837 const double ek = bp[k]*l3k;
8839 for (
int i = 0; i <= p - k; i++)
8842 double eki = ek*bpk[i]*l1i;
8844 for (
int j = 0; j <= p - k - i; j++)
8846 dshape[dof + o] = dshape_1d[j]*eki;
8852 ok += ((p - k + 2)*(p - k + 1))/2;
8859 for (
int j = 0; j <= p; j++)
8862 const double ej = bp[j]*l2j;
8864 for (
int i = 0; i <= p - j; i++)
8867 double eji = ej*bpj[i]*l1i;
8868 int m = ((p + 2)*(p + 1))/2;
8869 int n = ((p - j + 2)*(p - j + 1))/2;
8870 for (
int o = i, k = 0; k <= p - j - i; k++)
8875 dshape[2*dof + o - n] = dshape_1d[k]*eji;
8888 #ifdef MFEM_THREAD_SAFE
8892 for (
int i = 0; i <
Dof; i++)
8901 #ifdef MFEM_THREAD_SAFE
8906 for (
int d = 0; d < 3; d++)
8908 for (
int i = 0; i <
Dof; i++)
8923 #ifndef MFEM_THREAD_SAFE
8934 t_dof[0] = 0; s_dof[0] = 0;
8935 t_dof[1] = 1; s_dof[1] = 0;
8936 t_dof[2] = 2; s_dof[2] = 0;
8937 t_dof[3] = 0; s_dof[3] = 1;
8938 t_dof[4] = 1; s_dof[4] = 1;
8939 t_dof[5] = 2; s_dof[5] = 1;
8943 for (
int i=1; i<p; i++)
8945 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 0 * ne + i] = 0;
8946 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 1 * ne + i] = 0;
8947 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 2 * ne + i] = 0;
8948 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 3 * ne + i] = 1;
8949 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 4 * ne + i] = 1;
8950 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 5 * ne + i] = 1;
8951 t_dof[5 + 6 * ne + i] = 0; s_dof[5 + 6 * ne + i] = i + 1;
8952 t_dof[5 + 7 * ne + i] = 1; s_dof[5 + 7 * ne + i] = i + 1;
8953 t_dof[5 + 8 * ne + i] = 2; s_dof[5 + 8 * ne + i] = i + 1;
8958 int nt = (p-1)*(p-2)/2;
8959 for (
int j=1; j<p; j++)
8961 for (
int i=1; i<p-j; i++)
8963 int l = j - p + (((2 * p - 1) - i) * i) / 2;
8964 t_dof[6 + 9 * ne + k] = 3 * p + l; s_dof[6 + 9 * ne + k] = 0;
8965 t_dof[6 + 9 * ne + nt + k] = 3 * p + k; s_dof[6 + 9 * ne + nt + k] = 1;
8972 int nq = (p-1)*(p-1);
8973 for (
int j=1; j<p; j++)
8975 for (
int i=1; i<p; i++)
8977 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
8978 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
8979 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
8981 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
8982 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
8983 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
8991 for (
int k=1; k<p; k++)
8994 for (
int j=1; j<p; j++)
8996 for (
int i=1; i<j; i++)
8998 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
8999 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9008 for (
int i=0; i<
Dof; i++)
9019 #ifdef MFEM_THREAD_SAFE
9029 for (
int i=0; i<
Dof; i++)
9031 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
9038 #ifdef MFEM_THREAD_SAFE
9052 for (
int i=0; i<
Dof; i++)
9054 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
9055 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
9056 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
9067 #ifndef MFEM_THREAD_SAFE
9087 for (
int i=1; i<p; i++)
9089 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
9090 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
9091 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
9092 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
9093 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
9094 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
9095 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
9096 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
9097 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
9102 int nt = (p-1)*(p-2)/2;
9103 for (
int j=1; j<p; j++)
9105 for (
int i=1; i<j; i++)
9107 t_dof[6 + 9 * ne + k] = 3 * p + k;
s_dof[6 + 9 * ne + k] = 0;
9108 t_dof[6 + 9 * ne + nt + k] = 3 * p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
9115 int nq = (p-1)*(p-1);
9116 for (
int j=1; j<p; j++)
9118 for (
int i=1; i<p; i++)
9120 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
9121 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
9122 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
9124 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
9125 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
9126 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
9134 for (
int k=1; k<p; k++)
9137 for (
int j=1; j<p; j++)
9139 for (
int i=1; i<j; i++)
9141 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
9142 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9151 for (
int i=0; i<
Dof; i++)
9162 #ifdef MFEM_THREAD_SAFE
9172 for (
int i=0; i<
Dof; i++)
9181 #ifdef MFEM_THREAD_SAFE
9195 for (
int i=0; i<
Dof; i++)
9209 #ifndef MFEM_THREAD_SAFE
9214 for (
int i = 0; i <= p; i++)
9229 #ifdef MFEM_THREAD_SAFE
9239 const int p =
Order;
9245 for (
int i = 0; i <= p; i++)
9252 for (
int i = 0; i <= p; i++)
9264 #ifndef MFEM_THREAD_SAFE
9275 for (
int i = 0; i <= p; i++)
9291 #ifdef MFEM_THREAD_SAFE
9302 dofs[vertex*
Order] = 1.0;
9311 #ifndef MFEM_THREAD_SAFE
9318 for (
int o = 0, j = 0; j <= p; j++)
9319 for (
int i = 0; i <= p; i++)
9328 const int p =
Order;
9330 #ifdef MFEM_THREAD_SAFE
9331 Vector shape_x(p+1), shape_y(p+1);
9337 for (
int o = 0, j = 0; j <= p; j++)
9338 for (
int i = 0; i <= p; i++)
9340 shape(o++) = shape_x(i)*shape_y(j);
9347 const int p =
Order;
9349 #ifdef MFEM_THREAD_SAFE
9350 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9356 for (
int o = 0, j = 0; j <= p; j++)
9357 for (
int i = 0; i <= p; i++)
9359 dshape(o,0) = dshape_x(i)* shape_y(j);
9360 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9366 const int p =
Order;
9369 #ifdef MFEM_THREAD_SAFE
9370 Vector shape_x(p+1), shape_y(p+1);
9373 for (
int i = 0; i <= p; i++)
9382 for (
int o = 0, j = 0; j <= p; j++)
9383 for (
int i = 0; i <= p; i++)
9385 dofs[o++] = shape_x(i)*shape_x(j);
9389 for (
int o = 0, j = 0; j <= p; j++)
9390 for (
int i = 0; i <= p; i++)
9392 dofs[o++] = shape_y(i)*shape_x(j);
9396 for (
int o = 0, j = 0; j <= p; j++)
9397 for (
int i = 0; i <= p; i++)
9399 dofs[o++] = shape_y(i)*shape_y(j);
9403 for (
int o = 0, j = 0; j <= p; j++)
9404 for (
int i = 0; i <= p; i++)
9406 dofs[o++] = shape_x(i)*shape_y(j);
9416 #ifndef MFEM_THREAD_SAFE
9429 for (
int o = 0, j = 0; j <= p; j++)
9430 for (
int i = 0; i <= p; i++)
9440 const int p =
Order;
9442 #ifdef MFEM_THREAD_SAFE
9443 Vector shape_x(p+1), shape_y(p+1);
9449 for (
int o = 0, j = 0; j <= p; j++)
9450 for (
int i = 0; i <= p; i++)
9452 shape(o++) = shape_x(i)*shape_y(j);
9459 const int p =
Order;
9461 #ifdef MFEM_THREAD_SAFE
9462 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9468 for (
int o = 0, j = 0; j <= p; j++)
9469 for (
int i = 0; i <= p; i++)
9471 dshape(o,0) = dshape_x(i)* shape_y(j);
9472 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9478 const int p =
Order;
9483 case 0: dofs[0] = 1.0;
break;
9484 case 1: dofs[p] = 1.0;
break;
9485 case 2: dofs[p*(p + 2)] = 1.0;
break;
9486 case 3: dofs[p*(p + 1)] = 1.0;
break;
9496 #ifndef MFEM_THREAD_SAFE
9505 for (
int o = 0, k = 0; k <= p; k++)
9506 for (
int j = 0; j <= p; j++)
9507 for (
int i = 0; i <= p; i++)
9516 const int p =
Order;
9518 #ifdef MFEM_THREAD_SAFE
9519 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9526 for (
int o = 0, k = 0; k <= p; k++)
9527 for (
int j = 0; j <= p; j++)
9528 for (
int i = 0; i <= p; i++)
9530 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9537 const int p =
Order;
9539 #ifdef MFEM_THREAD_SAFE
9540 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9541 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9548 for (
int o = 0, k = 0; k <= p; k++)
9549 for (
int j = 0; j <= p; j++)
9550 for (
int i = 0; i <= p; i++)
9552 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9553 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9554 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9560 const int p =
Order;
9563 #ifdef MFEM_THREAD_SAFE
9564 Vector shape_x(p+1), shape_y(p+1);
9567 for (
int i = 0; i <= p; i++)
9576 for (
int o = 0, k = 0; k <= p; k++)
9577 for (
int j = 0; j <= p; j++)
9578 for (
int i = 0; i <= p; i++)
9580 dofs[o++] = shape_x(i)*shape_x(j)*shape_x(k);
9584 for (
int o = 0, k = 0; k <= p; k++)
9585 for (
int j = 0; j <= p; j++)
9586 for (
int i = 0; i <= p; i++)
9588 dofs[o++] = shape_y(i)*shape_x(j)*shape_x(k);
9592 for (
int o = 0, k = 0; k <= p; k++)
9593 for (
int j = 0; j <= p; j++)
9594 for (
int i = 0; i <= p; i++)
9596 dofs[o++] = shape_y(i)*shape_y(j)*shape_x(k);
9600 for (
int o = 0, k = 0; k <= p; k++)
9601 for (
int j = 0; j <= p; j++)
9602 for (
int i = 0; i <= p; i++)
9604 dofs[o++] = shape_x(i)*shape_y(j)*shape_x(k);
9608 for (
int o = 0, k = 0; k <= p; k++)
9609 for (
int j = 0; j <= p; j++)
9610 for (
int i = 0; i <= p; i++)
9612 dofs[o++] = shape_x(i)*shape_x(j)*shape_y(k);
9616 for (
int o = 0, k = 0; k <= p; k++)
9617 for (
int j = 0; j <= p; j++)
9618 for (
int i = 0; i <= p; i++)
9620 dofs[o++] = shape_y(i)*shape_x(j)*shape_y(k);
9624 for (
int o = 0, k = 0; k <= p; k++)
9625 for (
int j = 0; j <= p; j++)
9626 for (
int i = 0; i <= p; i++)
9628 dofs[o++] = shape_y(i)*shape_y(j)*shape_y(k);
9632 for (
int o = 0, k = 0; k <= p; k++)
9633 for (
int j = 0; j <= p; j++)
9634 for (
int i = 0; i <= p; i++)
9636 dofs[o++] = shape_x(i)*shape_y(j)*shape_y(k);
9646 #ifndef MFEM_THREAD_SAFE
9661 for (
int o = 0, k = 0; k <= p; k++)
9662 for (
int j = 0; j <= p; j++)
9663 for (
int i = 0; i <= p; i++)
9673 const int p =
Order;
9675 #ifdef MFEM_THREAD_SAFE
9676 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9683 for (
int o = 0, k = 0; k <= p; k++)
9684 for (
int j = 0; j <= p; j++)
9685 for (
int i = 0; i <= p; i++)
9687 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9694 const int p =
Order;
9696 #ifdef MFEM_THREAD_SAFE
9697 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9698 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9705 for (
int o = 0, k = 0; k <= p; k++)
9706 for (
int j = 0; j <= p; j++)
9707 for (
int i = 0; i <= p; i++)
9709 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9710 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9711 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9717 const int p =
Order;
9722 case 0: dofs[0] = 1.0;
break;
9723 case 1: dofs[p] = 1.0;
break;
9724 case 2: dofs[p*(p + 2)] = 1.0;
break;
9725 case 3: dofs[p*(p + 1)] = 1.0;
break;
9726 case 4: dofs[p*(p + 1)*(p + 1)] = 1.0;
break;
9727 case 5: dofs[p + p*(p + 1)*(p + 1)] = 1.0;
break;
9728 case 6: dofs[
Dof - 1] = 1.0;
break;
9729 case 7: dofs[
Dof - p - 1] = 1.0;
break;
9740 #ifndef MFEM_THREAD_SAFE
9750 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
9753 for (
int o = 0, j = 0; j <= p; j++)
9754 for (
int i = 0; i + j <= p; i++)
9756 double w = op[i] + op[j] + op[p-i-j];
9761 for (
int k = 0; k <
Dof; k++)
9768 for (
int o = 0, j = 0; j <= p; j++)
9769 for (
int i = 0; i + j <= p; i++)
9771 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
9782 const int p =
Order;
9784 #ifdef MFEM_THREAD_SAFE
9785 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
Dof);
9792 for (
int o = 0, j = 0; j <= p; j++)
9793 for (
int i = 0; i + j <= p; i++)
9795 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
9804 const int p =
Order;
9806 #ifdef MFEM_THREAD_SAFE
9807 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
9808 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
9816 for (
int o = 0, j = 0; j <= p; j++)
9817 for (
int i = 0; i + j <= p; i++)
9820 du(o,0) = ((dshape_x(i)* shape_l(k)) -
9821 ( shape_x(i)*dshape_l(k)))*shape_y(j);
9822 du(o,1) = ((dshape_y(j)* shape_l(k)) -
9823 ( shape_y(j)*dshape_l(k)))*shape_x(i);
9827 Ti.
Mult(du, dshape);
9835 for (
int i = 0; i <
Dof; i++)
9838 dofs[i] = pow(1.0 - ip.
x - ip.
y,
Order);
9842 for (
int i = 0; i <
Dof; i++)
9845 dofs[i] = pow(ip.
x,
Order);
9849 for (
int i = 0; i <
Dof; i++)
9852 dofs[i] = pow(ip.
y,
Order);
9863 #ifndef MFEM_THREAD_SAFE
9873 for (
int o = 0, j = 0; j <= p; j++)
9874 for (
int i = 0; i + j <= p; i++)
9890 #ifdef MFEM_THREAD_SAFE
9903 case 0: dofs[0] = 1.0;
break;
9904 case 1: dofs[
Order] = 1.0;
break;
9905 case 2: dofs[
Dof-1] = 1.0;
break;
9916 #ifndef MFEM_THREAD_SAFE
9928 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9931 for (
int o = 0, k = 0; k <= p; k++)
9932 for (
int j = 0; j + k <= p; j++)
9933 for (
int i = 0; i + j + k <= p; i++)
9935 double w = op[i] + op[j] + op[k] + op[p-i-j-k];
9940 for (
int m = 0; m <
Dof; m++)
9948 for (
int o = 0, k = 0; k <= p; k++)
9949 for (
int j = 0; j + k <= p; j++)
9950 for (
int i = 0; i + j + k <= p; i++)
9952 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
9963 const int p =
Order;
9965 #ifdef MFEM_THREAD_SAFE
9966 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9975 for (
int o = 0, k = 0; k <= p; k++)
9976 for (
int j = 0; j + k <= p; j++)
9977 for (
int i = 0; i + j + k <= p; i++)
9979 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
9988 const int p =
Order;
9990 #ifdef MFEM_THREAD_SAFE
9991 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9992 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
10001 for (
int o = 0, k = 0; k <= p; k++)
10002 for (
int j = 0; j + k <= p; j++)
10003 for (
int i = 0; i + j + k <= p; i++)
10005 int l = p - i - j - k;
10006 du(o,0) = ((dshape_x(i)* shape_l(l)) -
10007 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
10008 du(o,1) = ((dshape_y(j)* shape_l(l)) -
10009 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
10010 du(o,2) = ((dshape_z(k)* shape_l(l)) -
10011 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
10015 Ti.
Mult(du, dshape);
10023 for (
int i = 0; i <
Dof; i++)
10026 dofs[i] = pow(1.0 - ip.
x - ip.
y - ip.
z,
Order);
10030 for (
int i = 0; i <
Dof; i++)
10033 dofs[i] = pow(ip.
x,
Order);
10037 for (
int i = 0; i <
Dof; i++)
10040 dofs[i] = pow(ip.
y,
Order);
10044 for (
int i = 0; i <
Dof; i++)
10047 dofs[i] = pow(ip.
z,
Order);
10058 #ifndef MFEM_THREAD_SAFE
10068 for (
int o = 0, k = 0; k <= p; k++)
10069 for (
int j = 0; j + k <= p; j++)
10070 for (
int i = 0; i + j + k <= p; i++)
10087 #ifdef MFEM_THREAD_SAFE
10100 case 0: dofs[0] = 1.0;
break;
10101 case 1: dofs[
Order] = 1.0;
break;
10102 case 2: dofs[(
Order*(
Order+3))/2] = 1.0;
break;
10103 case 3: dofs[
Dof-1] = 1.0;
break;
10114 #ifndef MFEM_THREAD_SAFE
10126 for (
int k=0; k<=p; k++)
10129 for (
int j=0; j<=p; j++)
10131 for (
int i=0; i<=j; i++)
10143 for (
int i=0; i<
Dof; i++)
10154 #ifdef MFEM_THREAD_SAFE
10164 for (
int i=0; i<
Dof; i++)
10166 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
10173 #ifdef MFEM_THREAD_SAFE
10187 for (
int i=0; i<
Dof; i++)
10189 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
10190 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
10191 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
10202 #ifndef MFEM_THREAD_SAFE
10214 for (
int k=0; k<=p; k++)
10217 for (
int j=0; j<=p; j++)
10219 for (
int i=0; i<=j; i++)
10231 for (
int i=0; i<
Dof; i++)
10242 #ifdef MFEM_THREAD_SAFE
10252 for (
int i=0; i<
Dof; i++)
10261 #ifdef MFEM_THREAD_SAFE
10275 for (
int i=0; i<
Dof; i++)
10284 const double RT_QuadrilateralElement::nk[8] =
10285 { 0., -1., 1., 0., 0., 1., -1., 0. };
10292 cbasis1d(
poly1d.GetBasis(p + 1, VerifyClosed(cb_type))),
10293 obasis1d(
poly1d.GetBasis(p, VerifyOpen(ob_type))),
10294 dof_map(Dof), dof2nk(Dof)
10298 const int dof2 =
Dof/2;
10300 #ifndef MFEM_THREAD_SAFE
10311 for (
int i = 0; i <= p; i++)
10313 dof_map[1*dof2 + i + 0*(p + 1)] = o++;
10315 for (
int i = 0; i <= p; i++)
10317 dof_map[0*dof2 + (p + 1) + i*(p + 2)] = o++;
10319 for (
int i = 0; i <= p; i++)
10321 dof_map[1*dof2 + (p - i) + (p + 1)*(p + 1)] = o++;
10323 for (
int i = 0; i <= p; i++)
10325 dof_map[0*dof2 + 0 + (p - i)*(p + 2)] = o++;
10329 for (
int j = 0; j <= p; j++)
10330 for (
int i = 1; i <= p; i++)
10332 dof_map[0*dof2 + i + j*(p + 2)] = o++;
10334 for (
int j = 1; j <= p; j++)
10335 for (
int i = 0; i <= p; i++)
10337 dof_map[1*dof2 + i + j*(p + 1)] = o++;
10342 for (
int j = 0; j <= p; j++)
10343 for (
int i = 0; i <= p/2; i++)
10345 int idx = 0*dof2 + i + j*(p + 2);
10346 dof_map[idx] = -1 - dof_map[idx];
10349 for (
int j = p/2 + 1; j <= p; j++)
10351 int idx = 0*dof2 + (p/2 + 1) + j*(p + 2);
10352 dof_map[idx] = -1 - dof_map[idx];
10355 for (
int j = 0; j <= p/2; j++)
10356 for (
int i = 0; i <= p; i++)
10358 int idx = 1*dof2 + i + j*(p + 1);
10359 dof_map[idx] = -1 - dof_map[idx];
10362 for (
int i = 0; i <= p/2; i++)
10364 int idx = 1*dof2 + i + (p/2 + 1)*(p + 1);
10365 dof_map[idx] = -1 - dof_map[idx];
10369 for (
int j = 0; j <= p; j++)
10370 for (
int i = 0; i <= p + 1; i++)
10373 if ((idx = dof_map[o++]) < 0)
10384 for (
int j = 0; j <= p + 1; j++)
10385 for (
int i = 0; i <= p; i++)
10388 if ((idx = dof_map[o++]) < 0)
10404 const int pp1 =
Order;
10406 #ifdef MFEM_THREAD_SAFE
10407 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10410 cbasis1d.
Eval(ip.
x, shape_cx);
10411 obasis1d.
Eval(ip.
x, shape_ox);
10412 cbasis1d.
Eval(ip.
y, shape_cy);
10413 obasis1d.
Eval(ip.
y, shape_oy);
10416 for (
int j = 0; j < pp1; j++)
10417 for (
int i = 0; i <= pp1; i++)
10420 if ((idx = dof_map[o++]) < 0)
10422 idx = -1 - idx, s = -1;
10428 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
10431 for (
int j = 0; j <= pp1; j++)
10432 for (
int i = 0; i < pp1; i++)
10435 if ((idx = dof_map[o++]) < 0)
10437 idx = -1 - idx, s = -1;
10444 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
10451 const int pp1 =
Order;
10453 #ifdef MFEM_THREAD_SAFE
10454 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10455 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
10458 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
10459 obasis1d.
Eval(ip.
x, shape_ox);
10460 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
10461 obasis1d.
Eval(ip.
y, shape_oy);
10464 for (
int j = 0; j < pp1; j++)
10465 for (
int i = 0; i <= pp1; i++)
10468 if ((idx = dof_map[o++]) < 0)
10470 idx = -1 - idx, s = -1;
10476 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
10478 for (
int j = 0; j <= pp1; j++)
10479 for (
int i = 0; i < pp1; i++)
10482 if ((idx = dof_map[o++]) < 0)
10484 idx = -1 - idx, s = -1;
10490 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
10495 const double RT_HexahedronElement::nk[18] =
10496 { 0.,0.,-1., 0.,-1.,0., 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,0.,1. };
10503 cbasis1d(
poly1d.GetBasis(p + 1, VerifyClosed(cb_type))),
10504 obasis1d(
poly1d.GetBasis(p, VerifyOpen(ob_type))),
10505 dof_map(Dof), dof2nk(Dof)
10509 const int dof3 =
Dof/3;
10511 #ifndef MFEM_THREAD_SAFE
10525 for (
int j = 0; j <= p; j++)
10526 for (
int i = 0; i <= p; i++)
10528 dof_map[2*dof3 + i + ((p - j) + 0*(p + 1))*(p + 1)] = o++;
10530 for (
int j = 0; j <= p; j++)
10531 for (
int i = 0; i <= p; i++)
10533 dof_map[1*dof3 + i + (0 + j*(p + 2))*(p + 1)] = o++;
10535 for (
int j = 0; j <= p; j++)
10536 for (
int i = 0; i <= p; i++)
10538 dof_map[0*dof3 + (p + 1) + (i + j*(p + 1))*(p + 2)] = o++;
10540 for (
int j = 0; j <= p; j++)
10541 for (
int i = 0; i <= p; i++)
10543 dof_map[1*dof3 + (p - i) + ((p + 1) + j*(p + 2))*(p + 1)] = o++;
10545 for (
int j = 0; j <= p; j++)
10546 for (
int i = 0; i <= p; i++)
10548 dof_map[0*dof3 + 0 + ((p - i) + j*(p + 1))*(p + 2)] = o++;
10550 for (
int j = 0; j <= p; j++)
10551 for (
int i = 0; i <= p; i++)
10553 dof_map[2*dof3 + i + (j + (p + 1)*(p + 1))*(p + 1)] = o++;
10558 for (
int k = 0; k <= p; k++)
10559 for (
int j = 0; j <= p; j++)
10560 for (
int i = 1; i <= p; i++)
10562 dof_map[0*dof3 + i + (j + k*(p + 1))*(p + 2)] = o++;
10565 for (
int k = 0; k <= p; k++)
10566 for (
int j = 1; j <= p; j++)
10567 for (
int i = 0; i <= p; i++)
10569 dof_map[1*dof3 + i + (j + k*(p + 2))*(p + 1)] = o++;
10572 for (
int k = 1; k <= p; k++)
10573 for (
int j = 0; j <= p; j++)
10574 for (
int i = 0; i <= p; i++)
10576 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
10584 for (
int k = 0; k <= p; k++)
10585 for (
int j = 0; j <= p; j++)
10586 for (
int i = 0; i <= p/2; i++)
10588 int idx = 0*dof3 + i + (j + k*(p + 1))*(p + 2);
10589 dof_map[idx] = -1 - dof_map[idx];
10592 for (
int k = 0; k <= p; k++)
10593 for (
int j = 0; j <= p/2; j++)
10594 for (
int i = 0; i <= p; i++)
10596 int idx = 1*dof3 + i + (j + k*(p + 2))*(p + 1);
10597 dof_map[idx] = -1 - dof_map[idx];
10600 for (
int k = 0; k <= p/2; k++)
10601 for (
int j = 0; j <= p; j++)
10602 for (
int i = 0; i <= p; i++)
10604 int idx = 2*dof3 + i + (j + k*(p + 1))*(p + 1);
10605 dof_map[idx] = -1 - dof_map[idx];
10610 for (
int k = 0; k <= p; k++)
10611 for (
int j = 0; j <= p; j++)
10612 for (
int i = 0; i <= p + 1; i++)
10615 if ((idx = dof_map[o++]) < 0)
10627 for (
int k = 0; k <= p; k++)
10628 for (
int j = 0; j <= p + 1; j++)
10629 for (
int i = 0; i <= p; i++)
10632 if ((idx = dof_map[o++]) < 0)
10644 for (
int k = 0; k <= p + 1; k++)
10645 for (
int j = 0; j <= p; j++)
10646 for (
int i = 0; i <= p; i++)
10649 if ((idx = dof_map[o++]) < 0)
10665 const int pp1 =
Order;
10667 #ifdef MFEM_THREAD_SAFE
10668 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10669 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10672 cbasis1d.
Eval(ip.
x, shape_cx);
10673 obasis1d.
Eval(ip.
x, shape_ox);
10674 cbasis1d.
Eval(ip.
y, shape_cy);
10675 obasis1d.
Eval(ip.
y, shape_oy);
10676 cbasis1d.
Eval(ip.
z, shape_cz);
10677 obasis1d.
Eval(ip.
z, shape_oz);
10681 for (
int k = 0; k < pp1; k++)
10682 for (
int j = 0; j < pp1; j++)
10683 for (
int i = 0; i <= pp1; i++)
10686 if ((idx = dof_map[o++]) < 0)
10688 idx = -1 - idx, s = -1;
10694 shape(idx,0) = s*shape_cx(i)*shape_oy(j)*shape_oz(k);
10699 for (
int k = 0; k < pp1; k++)
10700 for (
int j = 0; j <= pp1; j++)
10701 for (
int i = 0; i < pp1; i++)
10704 if ((idx = dof_map[o++]) < 0)
10706 idx = -1 - idx, s = -1;
10713 shape(idx,1) = s*shape_ox(i)*shape_cy(j)*shape_oz(k);
10717 for (
int k = 0; k <= pp1; k++)
10718 for (
int j = 0; j < pp1; j++)
10719 for (
int i = 0; i < pp1; i++)
10722 if ((idx = dof_map[o++]) < 0)
10724 idx = -1 - idx, s = -1;
10732 shape(idx,2) = s*shape_ox(i)*shape_oy(j)*shape_cz(k);
10739 const int pp1 =
Order;
10741 #ifdef MFEM_THREAD_SAFE
10742 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10743 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10744 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
10747 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
10748 obasis1d.
Eval(ip.
x, shape_ox);
10749 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
10750 obasis1d.
Eval(ip.
y, shape_oy);
10751 cbasis1d.
Eval(ip.
z, shape_cz, dshape_cz);
10752 obasis1d.
Eval(ip.
z, shape_oz);
10756 for (
int k = 0; k < pp1; k++)
10757 for (
int j = 0; j < pp1; j++)
10758 for (
int i = 0; i <= pp1; i++)
10761 if ((idx = dof_map[o++]) < 0)
10763 idx = -1 - idx, s = -1;
10769 divshape(idx) = s*dshape_cx(i)*shape_oy(j)*shape_oz(k);
10772 for (
int k = 0; k < pp1; k++)
10773 for (
int j = 0; j <= pp1; j++)
10774 for (
int i = 0; i < pp1; i++)
10777 if ((idx = dof_map[o++]) < 0)
10779 idx = -1 - idx, s = -1;
10785 divshape(idx) = s*shape_ox(i)*dshape_cy(j)*shape_oz(k);
10788 for (
int k = 0; k <= pp1; k++)
10789 for (
int j = 0; j < pp1; j++)
10790 for (
int i = 0; i < pp1; i++)
10793 if ((idx = dof_map[o++]) < 0)
10795 idx = -1 - idx, s = -1;
10801 divshape(idx) = s*shape_ox(i)*shape_oy(j)*dshape_cz(k);
10806 const double RT_TriangleElement::nk[6] =
10807 { 0., -1., 1., 1., -1., 0. };
10809 const double RT_TriangleElement::c = 1./3.;
10819 #ifndef MFEM_THREAD_SAFE
10829 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10834 for (
int i = 0; i <= p; i++)
10839 for (
int i = 0; i <= p; i++)
10844 for (
int i = 0; i <= p; i++)
10851 for (
int j = 0; j < p; j++)
10852 for (
int i = 0; i + j < p; i++)
10854 double w = iop[i] + iop[j] + iop[p-1-i-j];
10862 for (
int k = 0; k <
Dof; k++)
10868 const double *n_k = nk + 2*dof2nk[k];
10871 for (
int j = 0; j <= p; j++)
10872 for (
int i = 0; i + j <= p; i++)
10874 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10875 T(o++, k) = s*n_k[0];
10876 T(o++, k) = s*n_k[1];
10878 for (
int i = 0; i <= p; i++)
10880 double s = shape_x(i)*shape_y(p-i);
10881 T(o++, k) = s*((ip.
x - c)*n_k[0] + (ip.
y - c)*n_k[1]);
10892 const int p =
Order - 1;
10894 #ifdef MFEM_THREAD_SAFE
10895 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10904 for (
int j = 0; j <= p; j++)
10905 for (
int i = 0; i + j <= p; i++)
10907 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10908 u(o,0) = s; u(o,1) = 0; o++;
10909 u(o,0) = 0; u(o,1) = s; o++;
10911 for (
int i = 0; i <= p; i++)
10913 double s = shape_x(i)*shape_y(p-i);
10914 u(o,0) = (ip.
x - c)*s;
10915 u(o,1) = (ip.
y - c)*s;
10925 const int p =
Order - 1;
10927 #ifdef MFEM_THREAD_SAFE
10928 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10929 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
10938 for (
int j = 0; j <= p; j++)
10939 for (
int i = 0; i + j <= p; i++)
10942 divu(o++) = (dshape_x(i)*shape_l(k) -
10943 shape_x(i)*dshape_l(k))*shape_y(j);
10944 divu(o++) = (dshape_y(j)*shape_l(k) -
10945 shape_y(j)*dshape_l(k))*shape_x(i);
10947 for (
int i = 0; i <= p; i++)
10950 divu(o++) = ((shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j) +
10951 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i));
10954 Ti.
Mult(divu, divshape);
10958 const double RT_TetrahedronElement::nk[12] =
10959 { 1,1,1, -1,0,0, 0,-1,0, 0,0,-1 };
10962 const double RT_TetrahedronElement::c = 1./4.;
10972 #ifndef MFEM_THREAD_SAFE
10984 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10990 for (
int j = 0; j <= p; j++)
10991 for (
int i = 0; i + j <= p; i++)
10993 double w = bop[i] + bop[j] + bop[p-i-j];
10997 for (
int j = 0; j <= p; j++)
10998 for (
int i = 0; i + j <= p; i++)
11000 double w = bop[i] + bop[j] + bop[p-i-j];
11004 for (
int j = 0; j <= p; j++)
11005 for (
int i = 0; i + j <= p; i++)
11007 double w = bop[i] + bop[j] + bop[p-i-j];
11011 for (
int j = 0; j <= p; j++)
11012 for (
int i = 0; i + j <= p; i++)
11014 double w = bop[i] + bop[j] + bop[p-i-j];
11020 for (
int k = 0; k < p; k++)
11021 for (
int j = 0; j + k < p; j++)
11022 for (
int i = 0; i + j + k < p; i++)
11024 double w = iop[i] + iop[j] + iop[k] + iop[p-1-i-j-k];
11034 for (
int m = 0; m <
Dof; m++)
11041 const double *nm = nk + 3*dof2nk[m];
11044 for (
int k = 0; k <= p; k++)
11045 for (
int j = 0; j + k <= p; j++)
11046 for (
int i = 0; i + j + k <= p; i++)
11048 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11049 T(o++, m) = s * nm[0];
11050 T(o++, m) = s * nm[1];
11051 T(o++, m) = s * nm[2];
11053 for (
int j = 0; j <= p; j++)
11054 for (
int i = 0; i + j <= p; i++)
11056 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11057 T(o++, m) = s*((ip.
x - c)*nm[0] + (ip.
y - c)*nm[1] +
11069 const int p =
Order - 1;
11071 #ifdef MFEM_THREAD_SAFE
11072 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11082 for (
int k = 0; k <= p; k++)
11083 for (
int j = 0; j + k <= p; j++)
11084 for (
int i = 0; i + j + k <= p; i++)
11086 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11087 u(o,0) = s; u(o,1) = 0; u(o,2) = 0; o++;
11088 u(o,0) = 0; u(o,1) = s; u(o,2) = 0; o++;
11089 u(o,0) = 0; u(o,1) = 0; u(o,2) = s; o++;
11091 for (
int j = 0; j <= p; j++)
11092 for (
int i = 0; i + j <= p; i++)
11094 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11095 u(o,0) = (ip.
x - c)*s; u(o,1) = (ip.
y - c)*s; u(o,2) = (ip.
z - c)*s;
11105 const int p =
Order - 1;
11107 #ifdef MFEM_THREAD_SAFE
11108 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11109 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
11119 for (
int k = 0; k <= p; k++)
11120 for (
int j = 0; j + k <= p; j++)
11121 for (
int i = 0; i + j + k <= p; i++)
11123 int l = p - i - j - k;
11124 divu(o++) = (dshape_x(i)*shape_l(l) -
11125 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
11126 divu(o++) = (dshape_y(j)*shape_l(l) -
11127 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
11128 divu(o++) = (dshape_z(k)*shape_l(l) -
11129 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
11131 for (
int j = 0; j <= p; j++)
11132 for (
int i = 0; i + j <= p; i++)
11136 (shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j)*shape_z(k) +
11137 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i)*shape_z(k) +
11138 (shape_z(k) + (ip.
z - c)*dshape_z(k))*shape_x(i)*shape_y(j);
11141 Ti.
Mult(divu, divshape);
11145 const double ND_HexahedronElement::tk[18] =
11146 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,0.,0., 0.,-1.,0., 0.,0.,-1. };
11149 const int cb_type,
const int ob_type)
11158 const int dof3 =
Dof/3;
11160 #ifndef MFEM_THREAD_SAFE
11174 for (
int i = 0; i < p; i++)
11176 dof_map[0*dof3 + i + (0 + 0*(p + 1))*p] = o++;
11178 for (
int i = 0; i < p; i++)
11180 dof_map[1*dof3 + p + (i + 0*p)*(p + 1)] = o++;
11182 for (
int i = 0; i < p; i++)
11184 dof_map[0*dof3 + i + (p + 0*(p + 1))*p] = o++;
11186 for (
int i = 0; i < p; i++)
11188 dof_map[1*dof3 + 0 + (i + 0*p)*(p + 1)] = o++;
11190 for (
int i = 0; i < p; i++)
11192 dof_map[0*dof3 + i + (0 + p*(p + 1))*p] = o++;
11194 for (
int i = 0; i < p; i++)
11196 dof_map[1*dof3 + p + (i + p*p)*(p + 1)] = o++;
11198 for (
int i = 0; i < p; i++)
11200 dof_map[0*dof3 + i + (p + p*(p + 1))*p] = o++;
11202 for (
int i = 0; i < p; i++)
11204 dof_map[1*dof3 + 0 + (i + p*p)*(p + 1)] = o++;
11206 for (
int i = 0; i < p; i++)
11208 dof_map[2*dof3 + 0 + (0 + i*(p + 1))*(p + 1)] = o++;
11210 for (
int i = 0; i < p; i++)
11212 dof_map[2*dof3 + p + (0 + i*(p + 1))*(p + 1)] = o++;
11214 for (
int i = 0; i < p; i++)
11216 dof_map[2*dof3 + p + (p + i*(p + 1))*(p + 1)] = o++;
11218 for (
int i = 0; i < p; i++)
11220 dof_map[2*dof3 + 0 + (p + i*(p + 1))*(p + 1)] = o++;
11225 for (
int j = 1; j < p; j++)
11226 for (
int i = 0; i < p; i++)
11228 dof_map[0*dof3 + i + ((p - j) + 0*(p + 1))*p] = o++;
11230 for (
int j = 0; j < p; j++)
11231 for (
int i = 1; i < p; i++)
11233 dof_map[1*dof3 + i + ((p - 1 - j) + 0*p)*(p + 1)] = -1 - (o++);
11236 for (
int k = 1; k < p; k++)
11237 for (
int i = 0; i < p; i++)
11239 dof_map[0*dof3 + i + (0 + k*(p + 1))*p] = o++;
11241 for (
int k = 0; k < p; k++)
11242 for (
int i = 1; i < p; i++ )
11244 dof_map[2*dof3 + i + (0 + k*(p + 1))*(p + 1)] = o++;
11247 for (
int k = 1; k < p; k++)
11248 for (
int j = 0; j < p; j++)
11250 dof_map[1*dof3 + p + (j + k*p)*(p + 1)] = o++;
11252 for (
int k = 0; k < p; k++)
11253 for (
int j = 1; j < p; j++)
11255 dof_map[2*dof3 + p + (j + k*(p + 1))*(p + 1)] = o++;
11258 for (
int k = 1; k < p; k++)
11259 for (
int i = 0; i < p; i++)
11261 dof_map[0*dof3 + (p - 1 - i) + (p + k*(p + 1))*p] = -1 - (o++);
11263 for (
int k = 0; k < p; k++)
11264 for (
int i = 1; i < p; i++)
11266 dof_map[2*dof3 + (p - i) + (p + k*(p + 1))*(p + 1)] = o++;
11269 for (
int k = 1; k < p; k++)
11270 for (
int j = 0; j < p; j++)
11272 dof_map[1*dof3 + 0 + ((p - 1 - j) + k*p)*(p + 1)] = -1 - (o++);
11274 for (
int k = 0; k < p; k++)
11275 for (
int j = 1; j < p; j++)
11277 dof_map[2*dof3 + 0 + ((p - j) + k*(p + 1))*(p + 1)] = o++;
11280 for (
int j = 1; j < p; j++)
11281 for (
int i = 0; i < p; i++)
11283 dof_map[0*dof3 + i + (j + p*(p + 1))*p] = o++;
11285 for (
int j = 0; j < p; j++)
11286 for (
int i = 1; i < p; i++)
11288 dof_map[1*dof3 + i + (j + p*p)*(p + 1)] = o++;
11293 for (
int k = 1; k < p; k++)
11294 for (
int j = 1; j < p; j++)
11295 for (
int i = 0; i < p; i++)
11297 dof_map[0*dof3 + i + (j + k*(p + 1))*p] = o++;
11300 for (
int k = 1; k < p; k++)
11301 for (
int j = 0; j < p; j++)
11302 for (
int i = 1; i < p; i++)
11304 dof_map[1*dof3 + i + (j + k*p)*(p + 1)] = o++;
11307 for (
int k = 0; k < p; k++)
11308 for (
int j = 1; j < p; j++)
11309 for (
int i = 1; i < p; i++)
11311 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
11317 for (
int k = 0; k <= p; k++)
11318 for (
int j = 0; j <= p; j++)
11319 for (
int i = 0; i < p; i++)
11322 if ((idx =
dof_map[o++]) < 0)
11324 dof2tk[idx = -1 - idx] = 3;
11333 for (
int k = 0; k <= p; k++)
11334 for (
int j = 0; j < p; j++)
11335 for (
int i = 0; i <= p; i++)
11338 if ((idx =
dof_map[o++]) < 0)
11340 dof2tk[idx = -1 - idx] = 4;
11349 for (
int k = 0; k < p; k++)
11350 for (
int j = 0; j <= p; j++)
11351 for (
int i = 0; i <= p; i++)
11354 if ((idx =
dof_map[o++]) < 0)
11356 dof2tk[idx = -1 - idx] = 5;
11369 const int p =
Order;
11371 #ifdef MFEM_THREAD_SAFE
11372 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11373 Vector shape_cz(p + 1), shape_oz(p);
11385 for (
int k = 0; k <= p; k++)
11386 for (
int j = 0; j <= p; j++)
11387 for (
int i = 0; i < p; i++)
11390 if ((idx =
dof_map[o++]) < 0)
11392 idx = -1 - idx, s = -1;
11398 shape(idx,0) = s*shape_ox(i)*shape_cy(j)*shape_cz(k);
11403 for (
int k = 0; k <= p; k++)
11404 for (
int j = 0; j < p; j++)
11405 for (
int i = 0; i <= p; i++)
11408 if ((idx =
dof_map[o++]) < 0)
11410 idx = -1 - idx, s = -1;
11417 shape(idx,1) = s*shape_cx(i)*shape_oy(j)*shape_cz(k);
11421 for (
int k = 0; k < p; k++)
11422 for (
int j = 0; j <= p; j++)
11423 for (
int i = 0; i <= p; i++)
11426 if ((idx =
dof_map[o++]) < 0)
11428 idx = -1 - idx, s = -1;
11436 shape(idx,2) = s*shape_cx(i)*shape_cy(j)*shape_oz(k);
11443 const int p =
Order;
11445 #ifdef MFEM_THREAD_SAFE
11446 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11447 Vector shape_cz(p + 1), shape_oz(p);
11448 Vector dshape_cx(p + 1), dshape_cy(p + 1), dshape_cz(p + 1);
11460 for (
int k = 0; k <= p; k++)
11461 for (
int j = 0; j <= p; j++)
11462 for (
int i = 0; i < p; i++)
11465 if ((idx =
dof_map[o++]) < 0)
11467 idx = -1 - idx, s = -1;
11473 curl_shape(idx,0) = 0.;
11474 curl_shape(idx,1) = s*shape_ox(i)* shape_cy(j)*dshape_cz(k);
11475 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j)* shape_cz(k);
11478 for (
int k = 0; k <= p; k++)
11479 for (
int j = 0; j < p; j++)
11480 for (
int i = 0; i <= p; i++)
11483 if ((idx =
dof_map[o++]) < 0)
11485 idx = -1 - idx, s = -1;
11491 curl_shape(idx,0) = -s* shape_cx(i)*shape_oy(j)*dshape_cz(k);
11492 curl_shape(idx,1) = 0.;
11493 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j)* shape_cz(k);
11496 for (
int k = 0; k < p; k++)
11497 for (
int j = 0; j <= p; j++)
11498 for (
int i = 0; i <= p; i++)
11501 if ((idx =
dof_map[o++]) < 0)
11503 idx = -1 - idx, s = -1;
11509 curl_shape(idx,0) = s* shape_cx(i)*dshape_cy(j)*shape_oz(k);
11510 curl_shape(idx,1) = -s*dshape_cx(i)* shape_cy(j)*shape_oz(k);
11511 curl_shape(idx,2) = 0.;
11536 const bool closed)
const
11540 for (
int i = 0; i < closed ?
dof2quad_array.Size() : dof2quad_array_open.Size();
11544 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
11548 const int ndof = closed ?
Order + 1 :
Order;
11549 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
Dim) + 0.5);
11559 Vector val(ndof), grad(ndof);
11560 for (
int i = 0; i < nqpt; i++)
11574 for (
int j = 0; j < ndof; j++)
11576 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
11577 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
11587 dof2quad_array_open.Append(d2q);
11593 const double ND_QuadrilateralElement::tk[8] =
11594 { 1.,0., 0.,1., -1.,0., 0.,-1. };
11607 const int dof2 =
Dof/2;
11609 #ifndef MFEM_THREAD_SAFE
11620 for (
int i = 0; i < p; i++)
11622 dof_map[0*dof2 + i + 0*p] = o++;
11624 for (
int j = 0; j < p; j++)
11626 dof_map[1*dof2 + p + j*(p + 1)] = o++;
11628 for (
int i = 0; i < p; i++)
11630 dof_map[0*dof2 + (p - 1 - i) + p*p] = -1 - (o++);
11632 for (
int j = 0; j < p; j++)
11634 dof_map[1*dof2 + 0 + (p - 1 - j)*(p + 1)] = -1 - (o++);
11639 for (
int j = 1; j < p; j++)
11640 for (
int i = 0; i < p; i++)
11642 dof_map[0*dof2 + i + j*p] = o++;
11645 for (
int j = 0; j < p; j++)
11646 for (
int i = 1; i < p; i++)
11648 dof_map[1*dof2 + i + j*(p + 1)] = o++;
11654 for (
int j = 0; j <= p; j++)
11655 for (
int i = 0; i < p; i++)
11658 if ((idx =
dof_map[o++]) < 0)
11660 dof2tk[idx = -1 - idx] = 2;
11669 for (
int j = 0; j < p; j++)
11670 for (
int i = 0; i <= p; i++)
11673 if ((idx =
dof_map[o++]) < 0)
11675 dof2tk[idx = -1 - idx] = 3;
11688 const int p =
Order;
11690 #ifdef MFEM_THREAD_SAFE
11691 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11701 for (
int j = 0; j <= p; j++)
11702 for (
int i = 0; i < p; i++)
11705 if ((idx =
dof_map[o++]) < 0)
11707 idx = -1 - idx, s = -1;
11713 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
11717 for (
int j = 0; j < p; j++)
11718 for (
int i = 0; i <= p; i++)
11721 if ((idx =
dof_map[o++]) < 0)
11723 idx = -1 - idx, s = -1;
11730 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
11737 const int p =
Order;
11739 #ifdef MFEM_THREAD_SAFE
11740 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11741 Vector dshape_cx(p + 1), dshape_cy(p + 1);
11751 for (
int j = 0; j <= p; j++)
11752 for (
int i = 0; i < p; i++)
11755 if ((idx =
dof_map[o++]) < 0)
11757 idx = -1 - idx, s = -1;
11763 curl_shape(idx,0) = -s*shape_ox(i)*dshape_cy(j);
11766 for (
int j = 0; j < p; j++)
11767 for (
int i = 0; i <= p; i++)
11770 if ((idx =
dof_map[o++]) < 0)
11772 idx = -1 - idx, s = -1;
11778 curl_shape(idx,0) = s*dshape_cx(i)*shape_oy(j);
11783 const double ND_TetrahedronElement::tk[18] =
11784 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,1.,0., -1.,0.,1., 0.,-1.,1. };
11786 const double ND_TetrahedronElement::c = 1./4.;
11796 const int pm1 = p - 1, pm2 = p - 2, pm3 = p - 3;
11798 #ifndef MFEM_THREAD_SAFE
11809 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11814 for (
int i = 0; i < p; i++)
11819 for (
int i = 0; i < p; i++)
11824 for (
int i = 0; i < p; i++)
11829 for (
int i = 0; i < p; i++)
11834 for (
int i = 0; i < p; i++)
11839 for (
int i = 0; i < p; i++)
11846 for (
int j = 0; j <= pm2; j++)
11847 for (
int i = 0; i + j <= pm2; i++)
11849 double w = fop[i] + fop[j] + fop[pm2-i-j];
11855 for (
int j = 0; j <= pm2; j++)
11856 for (
int i = 0; i + j <= pm2; i++)
11858 double w = fop[i] + fop[j] + fop[pm2-i-j];
11864 for (
int j = 0; j <= pm2; j++)
11865 for (
int i = 0; i + j <= pm2; i++)
11867 double w = fop[i] + fop[j] + fop[pm2-i-j];
11873 for (
int j = 0; j <= pm2; j++)
11874 for (
int i = 0; i + j <= pm2; i++)
11876 double w = fop[i] + fop[j] + fop[pm2-i-j];
11884 for (
int k = 0; k <= pm3; k++)
11885 for (
int j = 0; j + k <= pm3; j++)
11886 for (
int i = 0; i + j + k <= pm3; i++)
11888 double w = iop[i] + iop[j] + iop[k] + iop[pm3-i-j-k];
11898 for (
int m = 0; m <
Dof; m++)
11901 const double *tm = tk + 3*dof2tk[m];
11909 for (
int k = 0; k <= pm1; k++)
11910 for (
int j = 0; j + k <= pm1; j++)
11911 for (
int i = 0; i + j + k <= pm1; i++)
11913 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
11914 T(o++, m) = s * tm[0];
11915 T(o++, m) = s * tm[1];
11916 T(o++, m) = s * tm[2];
11918 for (
int k = 0; k <= pm1; k++)
11919 for (
int j = 0; j + k <= pm1; j++)
11921 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
11922 T(o++, m) = s*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
11923 T(o++, m) = s*((ip.
z - c)*tm[0] - (ip.
x - c)*tm[2]);
11925 for (
int k = 0; k <= pm1; k++)
11928 shape_y(pm1-k)*shape_z(k)*((ip.
z - c)*tm[1] - (ip.
y - c)*tm[2]);
11939 const int pm1 =
Order - 1;
11941 #ifdef MFEM_THREAD_SAFE
11942 const int p =
Order;
11943 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11953 for (
int k = 0; k <= pm1; k++)
11954 for (
int j = 0; j + k <= pm1; j++)
11955 for (
int i = 0; i + j + k <= pm1; i++)
11957 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
11958 u(n,0) = s; u(n,1) = 0.; u(n,2) = 0.; n++;
11959 u(n,0) = 0.; u(n,1) = s; u(n,2) = 0.; n++;
11960 u(n,0) = 0.; u(n,1) = 0.; u(n,2) = s; n++;
11962 for (
int k = 0; k <= pm1; k++)
11963 for (
int j = 0; j + k <= pm1; j++)
11965 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
11966 u(n,0) = s*(ip.
y - c); u(n,1) = -s*(ip.
x - c); u(n,2) = 0.; n++;
11967 u(n,0) = s*(ip.
z - c); u(n,1) = 0.; u(n,2) = -s*(ip.
x - c); n++;
11969 for (
int k = 0; k <= pm1; k++)
11971 double s = shape_y(pm1-k)*shape_z(k);
11972 u(n,0) = 0.; u(n,1) = s*(ip.
z - c); u(n,2) = -s*(ip.
y - c); n++;
11981 const int pm1 =
Order - 1;
11983 #ifdef MFEM_THREAD_SAFE
11984 const int p =
Order;
11985 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11986 Vector dshape_x(p), dshape_y(p), dshape_z(p), dshape_l(p);
11996 for (
int k = 0; k <= pm1; k++)
11997 for (
int j = 0; j + k <= pm1; j++)
11998 for (
int i = 0; i + j + k <= pm1; i++)
12001 const double dx = (dshape_x(i)*shape_l(l) -
12002 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
12003 const double dy = (dshape_y(j)*shape_l(l) -
12004 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
12005 const double dz = (dshape_z(k)*shape_l(l) -
12006 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
12008 u(n,0) = 0.; u(n,1) = dz; u(n,2) = -dy; n++;
12009 u(n,0) = -dz; u(n,1) = 0.; u(n,2) = dx; n++;
12010 u(n,0) = dy; u(n,1) = -dx; u(n,2) = 0.; n++;
12012 for (
int k = 0; k <= pm1; k++)
12013 for (
int j = 0; j + k <= pm1; j++)
12015 int i = pm1 - j - k;
12018 u(n,0) = shape_x(i)*(ip.
x - c)*shape_y(j)*dshape_z(k);
12019 u(n,1) = shape_x(i)*shape_y(j)*(ip.
y - c)*dshape_z(k);
12021 -((dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k) +
12022 (dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_x(i)*shape_z(k));
12025 u(n,0) = -shape_x(i)*(ip.
x - c)*dshape_y(j)*shape_z(k);
12026 u(n,1) = (shape_x(i)*shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)) +
12027 (dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k));
12028 u(n,2) = -shape_x(i)*dshape_y(j)*shape_z(k)*(ip.
z - c);
12031 for (
int k = 0; k <= pm1; k++)
12035 u(n,0) = -((dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_z(k) +
12036 shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)));
12041 Ti.
Mult(u, curl_shape);
12045 const double ND_TriangleElement::tk[8] =
12046 { 1.,0., -1.,1., 0.,-1., 0.,1. };
12048 const double ND_TriangleElement::c = 1./3.;
12058 const int pm1 = p - 1, pm2 = p - 2;
12060 #ifndef MFEM_THREAD_SAFE
12070 Vector shape_x(p), shape_y(p), shape_l(p);
12075 for (
int i = 0; i < p; i++)
12080 for (
int i = 0; i < p; i++)
12085 for (
int i = 0; i < p; i++)
12092 for (
int j = 0; j <= pm2; j++)
12093 for (
int i = 0; i + j <= pm2; i++)
12095 double w = iop[i] + iop[j] + iop[pm2-i-j];
12103 for (
int m = 0; m <
Dof; m++)
12106 const double *tm = tk + 2*dof2tk[m];
12113 for (
int j = 0; j <= pm1; j++)
12114 for (
int i = 0; i + j <= pm1; i++)
12116 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
12117 T(n++, m) = s * tm[0];
12118 T(n++, m) = s * tm[1];
12120 for (
int j = 0; j <= pm1; j++)
12123 shape_x(pm1-j)*shape_y(j)*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
12134 const int pm1 =
Order - 1;
12136 #ifdef MFEM_THREAD_SAFE
12137 const int p =
Order;
12138 Vector shape_x(p), shape_y(p), shape_l(p);
12147 for (
int j = 0; j <= pm1; j++)
12148 for (
int i = 0; i + j <= pm1; i++)
12150 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
12151 u(n,0) = s; u(n,1) = 0; n++;
12152 u(n,0) = 0; u(n,1) = s; n++;
12154 for (
int j = 0; j <= pm1; j++)
12156 double s = shape_x(pm1-j)*shape_y(j);
12157 u(n,0) = s*(ip.
y - c);
12158 u(n,1) = -s*(ip.
x - c);
12168 const int pm1 =
Order - 1;
12170 #ifdef MFEM_THREAD_SAFE
12171 const int p =
Order;
12172 Vector shape_x(p), shape_y(p), shape_l(p);
12173 Vector dshape_x(p), dshape_y(p), dshape_l(p);
12182 for (
int j = 0; j <= pm1; j++)
12183 for (
int i = 0; i + j <= pm1; i++)
12186 const double dx = (dshape_x(i)*shape_l(l) -
12187 shape_x(i)*dshape_l(l)) * shape_y(j);
12188 const double dy = (dshape_y(j)*shape_l(l) -
12189 shape_y(j)*dshape_l(l)) * shape_x(i);
12195 for (
int j = 0; j <= pm1; j++)
12199 curlu(n++) = -((dshape_x(i)*(ip.
x - c) + shape_x(i)) * shape_y(j) +
12200 (dshape_y(j)*(ip.
y - c) + shape_y(j)) * shape_x(i));
12204 Ti.
Mult(curlu, curl2d);
12208 const double ND_SegmentElement::tk[1] = { 1. };
12213 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(ob_type))),
12219 for (
int i = 0; i < p; i++)
12246 kv[0]->CalcShape(shape,
ijk[0], ip.
x);
12249 for (
int i = 0; i <=
Order; i++)
12251 sum += (shape(i) *=
weights(i));
12263 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
12265 double sum = 0.0, dsum = 0.0;
12266 for (
int i = 0; i <=
Order; i++)
12269 dsum += ( grad(i) *=
weights(i));
12273 add(sum, grad, -dsum*sum*sum,
shape_x, grad);
12283 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
12284 kv[0]->CalcD2Shape(hess,
ijk[0], ip.
x);
12286 double sum = 0.0, dsum = 0.0, d2sum = 0.0;
12287 for (
int i = 0; i <=
Order; i++)
12290 dsum += ( grad(i) *=
weights(i));
12291 d2sum += ( hess(i) *=
weights(i));
12295 add(sum, hess, -2*dsum*sum*sum, grad, hess);
12296 add(1.0, hess, (-d2sum + 2*dsum*dsum*sum)*sum*sum,
shape_x, hess);
12325 for (
int o = 0, j = 0; j <=
Orders[1]; j++)
12327 const double sy =
shape_y(j);
12328 for (
int i = 0; i <=
Orders[0]; i++, o++)
12340 double sum, dsum[2];
12348 sum = dsum[0] = dsum[1] = 0.0;
12349 for (
int o = 0, j = 0; j <=
Orders[1]; j++)
12352 for (
int i = 0; i <=
Orders[0]; i++, o++)
12362 dsum[0] *= sum*sum;
12363 dsum[1] *= sum*sum;
12365 for (
int o = 0; o <
Dof; o++)
12367 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
12368 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
12375 double sum, dsum[2], d2sum[3];
12386 sum = dsum[0] = dsum[1] = 0.0;
12387 d2sum[0] = d2sum[1] = d2sum[2] = 0.0;
12388 for (
int o = 0, j = 0; j <=
Orders[1]; j++)
12391 for (
int i = 0; i <=
Orders[0]; i++, o++)
12394 sum += (
u(o) = sx*sy*
weights(o) );
12396 dsum[0] += (
du(o,0) = dsx*sy*
weights(o) );
12397 dsum[1] += (
du(o,1) = sx*dsy*
weights(o) );
12399 d2sum[0] += ( hessian(o,0) = d2sx*sy*
weights(o) );
12400 d2sum[1] += ( hessian(o,1) = dsx*dsy*
weights(o) );
12401 d2sum[2] += ( hessian(o,2) = sx*d2sy*
weights(o) );
12413 for (
int o = 0; o <
Dof; o++)
12415 hessian(o,0) = hessian(o,0)*sum
12416 - 2*
du(o,0)*sum*dsum[0]
12417 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
12419 hessian(o,1) = hessian(o,1)*sum
12420 -
du(o,0)*sum*dsum[1]
12421 -
du(o,1)*sum*dsum[0]
12422 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
12424 hessian(o,2) = hessian(o,2)*sum
12425 - 2*
du(o,1)*sum*dsum[1]
12426 + u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[2]);
12463 for (
int o = 0, k = 0; k <=
Orders[2]; k++)
12465 const double sz =
shape_z(k);
12466 for (
int j = 0; j <=
Orders[1]; j++)
12468 const double sy_sz =
shape_y(j)*sz;
12469 for (
int i = 0; i <=
Orders[0]; i++, o++)
12482 double sum, dsum[3];
12492 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
12493 for (
int o = 0, k = 0; k <=
Orders[2]; k++)
12496 for (
int j = 0; j <=
Orders[1]; j++)
12498 const double sy_sz =
shape_y(j)* sz;
12499 const double dsy_sz =
dshape_y(j)* sz;
12500 const double sy_dsz =
shape_y(j)*dsz;
12501 for (
int i = 0; i <=
Orders[0]; i++, o++)
12513 dsum[0] *= sum*sum;
12514 dsum[1] *= sum*sum;
12515 dsum[2] *= sum*sum;
12517 for (
int o = 0; o <
Dof; o++)
12519 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
12520 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
12521 dshape(o,2) = dshape(o,2)*sum -
u(o)*dsum[2];
12528 double sum, dsum[3], d2sum[6];
12542 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
12543 d2sum[0] = d2sum[1] = d2sum[2] = d2sum[3] = d2sum[4] = d2sum[5] = 0.0;
12545 for (
int o = 0, k = 0; k <=
Orders[2]; k++)
12548 for (
int j = 0; j <=
Orders[1]; j++)
12551 for (
int i = 0; i <=
Orders[0]; i++, o++)
12554 sum += (
u(o) = sx*sy*sz*
weights(o) );
12556 dsum[0] += (
du(o,0) = dsx*sy*sz*
weights(o) );
12557 dsum[1] += (
du(o,1) = sx*dsy*sz*
weights(o) );
12558 dsum[2] += (
du(o,2) = sx*sy*dsz*
weights(o) );
12560 d2sum[0] += ( hessian(o,0) = d2sx*sy*sz*
weights(o) );
12561 d2sum[1] += ( hessian(o,1) = dsx*dsy*sz*
weights(o) );
12562 d2sum[2] += ( hessian(o,2) = dsx*sy*dsz*
weights(o) );
12564 d2sum[3] += ( hessian(o,3) = sx*dsy*dsz*
weights(o) );
12566 d2sum[4] += ( hessian(o,4) = sx*sy*d2sz*
weights(o) );
12567 d2sum[5] += ( hessian(o,5) = sx*d2sy*sz*
weights(o) );
12585 for (
int o = 0; o <
Dof; o++)
12587 hessian(o,0) = hessian(o,0)*sum
12588 - 2*
du(o,0)*sum*dsum[0]
12589 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
12591 hessian(o,1) = hessian(o,1)*sum
12592 -
du(o,0)*sum*dsum[1]
12593 -
du(o,1)*sum*dsum[0]
12594 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
12596 hessian(o,2) = hessian(o,2)*sum
12597 -
du(o,0)*sum*dsum[2]
12598 -
du(o,2)*sum*dsum[0]
12599 + u[o]*sum*(2*dsum[0]*dsum[2] - d2sum[2]);
12601 hessian(o,3) = hessian(o,3)*sum
12602 -
du(o,1)*sum*dsum[2]
12603 -
du(o,2)*sum*dsum[1]
12604 + u[o]*sum*(2*dsum[1]*dsum[2] - d2sum[3]);
12606 hessian(o,4) = hessian(o,4)*sum
12607 - 2*
du(o,2)*sum*dsum[2]
12608 + u[o]*sum*(2*dsum[2]*dsum[2] - d2sum[4]);
12610 hessian(o,5) = hessian(o,5)*sum
12611 - 2*
du(o,1)*sum*dsum[1]
12612 + 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 Finite Elements.
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
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()
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
int Size() const
Logical size of the array.
For scalar fields; preserves point values.
void Get(double *p, const int dim) const
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
RT2TriangleFiniteElement()
int GetDim() const
Returns the reference space dimension for the finite element.
GaussQuad2DFiniteElement()
virtual void ProjectDelta(int vertex, Vector &dofs) const
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...
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)
CrouzeixRaviartQuadFiniteElement()
virtual void ProjectDelta(int vertex, 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...
Linear3DFiniteElement()
Construct a linear FE on tetrahedron.
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)
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()
No derivatives implemented.
virtual void ProjectDelta(int vertex, Vector &dofs) const
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
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 a biquadratic FE on quadrilateral.
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
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)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
H1Pos_SegmentElement(const int 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...
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
void SetRow(int r, const double *row)
void InvRightScaling(const Vector &s)
InvRightScaling: this = this * diag(1./s);.
Geometry::Type GeomType
Geometry::Type of the reference element.
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
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 void ProjectDelta(int vertex, Vector &dofs) const
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
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)
void GivePolyPoints(const int np, double *pts, const int type)
L2Pos_TetrahedronElement(const int 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 ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
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
virtual void Project(Coefficient &coeff, 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...
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...
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)
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
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)
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)
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
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()
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
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...
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 a biquadratic FE on quadrilateral.
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 a quadratic FE on tetrahedron.
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.
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
static void CalcLegendre(const int p, const double x, double *u)
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Nodal interpolation.
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.
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)
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
double * GetData() const
Return a pointer to the beginning of the Vector data.
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
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...
Implements CalcDivShape methods.
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 a linear FE on triangle.
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
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
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
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)
ND_TriangleElement(const int 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)
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 terms in the expansion of the binomial (x + y)^p.
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)
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 a cubic FE on tetrahedron.
Linear1DFiniteElement()
Construct a linear FE on interval.
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...
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 Mult(const Vector &x, Vector &y) const
Matrix vector multiplication with the inverse of dense matrix.
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
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()
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)
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...
Implements CalcCurlShape methods.
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)
int Dof
Number of degrees of freedom.
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 a quadratic FE on interval.
virtual void ProjectDelta(int vertex, Vector &dofs) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
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...
For scalar fields; preserves volume integrals.
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)
void AddMult_a_VWt(const double a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
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)
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)
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()
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)
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
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
static int VerifyOpen(int b_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...
L2Pos_QuadrilateralElement(const int p)
P1TetNonConfFiniteElement()
P0SegmentFiniteElement(int Ord=0)
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.
Class for linear FE on tetrahedron.
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Nedelec1HexFiniteElement()
void Set2(const double x1, const double x2)
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...
Class for linear FE on 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)
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 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)
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 trans(const Vector &x, Vector &p)
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)
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
"Interpolation" defined through local L2-projection.
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)
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...
int Dim
Dimension of reference space.
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
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
int Orders[Geometry::MaxDim]
Anisotropic orders.
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...
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
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)
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...
~LagrangeHexFiniteElement()
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
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...
Base class Coefficient that may optionally depend on time.
virtual void ProjectDelta(int vertex, Vector &dofs) 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...
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 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
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)
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
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
L2Pos_TriangleElement TriangleFE
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
virtual void ProjectDelta(int vertex, Vector &dofs) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Linear2DFiniteElement TriangleFE
Class for bilinear FE on quadrilateral.
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 a quadratic FE on interval.
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
virtual const DofToQuad & GetDofToQuad(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...
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)
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)
Class for integration point with weight.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
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
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
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)
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)
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
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 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
RefinedLinear2DFiniteElement()
Construct a quadratic FE on triangle.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
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)
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 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 a biquadratic FE on quadrilateral.
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) 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...
P0TriangleFiniteElement()
Construct P0 triangle finite element.
static int VerifyNodal(int b_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 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)
RT_TriangleElement(const int 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
L2Pos_SegmentElement(const int 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
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)
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
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 a quadratic FE on triangle.
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 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
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()
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
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...
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
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
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)
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
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()
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
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)
int Order
Order/degree of the shape functions.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) 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...
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)
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 CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
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 a tri-linear FE on cube.
virtual void ProjectDelta(int vertex, Vector &dofs) 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...
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)
BiLinear2DFiniteElement()
Construct a bilinear FE on quadrilateral.
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)
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) 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...
virtual void ProjectDelta(int vertex, Vector &dofs) const
virtual void ProjectDelta(int vertex, 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...
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