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
209 mfem_error(
"FiniteElement::GetDofToQuad(...) is not implemented for "
231 #ifdef MFEM_THREAD_SAFE
238 for (
int i = 0; i < fine_fe.
Dof; i++)
243 for (
int j = 0; j <
Dof; j++)
244 if (fabs(I(i,j) =
c_shape(j)) < 1.0e-12)
269 Vector fine_shape(fs), coarse_shape(cs);
270 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
287 fine_mass_inv.
Mult(fine_coarse_mass, I);
305 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
319 #ifdef MFEM_THREAD_SAFE
323 for (
int i = 0; i < nqpt; i++)
327 for (
int j = 0; j <
Dof; j++)
329 d2q->
B[i+nqpt*j] = d2q->
Bt[j+Dof*i] =
c_shape(j);
332 for (
int d = 0; d <
Dim; d++)
334 for (
int j = 0; j <
Dof; j++)
336 d2q->
G[i+nqpt*(d+Dim*j)] = d2q->
Gt[j+Dof*(i+nqpt*d)] =
vshape(j,d);
354 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
359 const int ndof =
Order + 1;
360 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
Dim) + 0.5);
370 Vector val(ndof), grad(ndof);
371 for (
int i = 0; i < nqpt; i++)
376 for (
int j = 0; j < ndof; j++)
378 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
379 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
396 for (
int i = 0; i <
Dof; i++)
399 for (
int j = 0; j < fe.
GetDof(); j++)
401 curl(i,j) = curl_shape(j,0);
428 #ifdef MFEM_THREAD_SAFE
434 for (
int j = 0; j <
Dof; j++)
454 for (
int i = 0; i <
Dof; i++)
460 dofs(i) = coeff.
Eval (Trans, ip);
463 dofs(i) *= Trans.
Weight();
474 for (
int i = 0; i <
Dof; i++)
478 vc.
Eval (x, Trans, ip);
483 for (
int j = 0; j < x.Size(); j++)
485 dofs(Dof*j+i) = x(j);
497 for (
int k = 0; k <
Dof; k++)
502 for (
int r = 0; r < MQ.Height(); r++)
504 for (
int d = 0; d < MQ.Width(); d++)
506 dofs(k+Dof*(d+MQ.Width()*r)) = MQ(r,d);
522 for (
int k = 0; k <
Dof; k++)
525 for (
int j = 0; j < shape.Size(); j++)
527 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
536 for (
int k = 0; k <
Dof; k++)
547 I(k+d*Dof,j) =
vshape(j,d);
563 for (
int k = 0; k <
Dof; k++)
569 Mult(dshape, Jinv, grad_k);
574 for (
int j = 0; j < grad_k.Height(); j++)
575 for (
int d = 0; d <
Dim; d++)
577 grad(k+d*Dof,j) = grad_k(j,d);
590 for (
int k = 0; k <
Dof; k++)
598 for (
int j = 0; j < div_shape.Size(); j++)
600 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j)/detJ;
605 for (
int j = 0; j < div_shape.Size(); j++)
607 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j);
617 for (
int i = 0; i <
Dof; i++)
621 dofs(i) = coeff.
Eval(Trans, ip);
631 for (
int i = 0; i <
Dof; i++)
635 vc.
Eval (x, Trans, ip);
636 for (
int j = 0; j < x.Size(); j++)
638 dofs(Dof*j+i) = x(j);
665 pos_mass_inv.
Mult(mixed_mass, I);
670 void VectorFiniteElement::CalcShape (
673 mfem_error (
"Error: Cannot use scalar CalcShape(...) function with\n"
674 " VectorFiniteElements!");
677 void VectorFiniteElement::CalcDShape (
678 const IntegrationPoint &ip, DenseMatrix &dshape )
const
680 mfem_error (
"Error: Cannot use scalar CalcDShape(...) function with\n"
681 " VectorFiniteElements!");
713 MFEM_ABORT(
"Invalid dimension, Dim = " <<
Dim);
717 MFEM_ABORT(
"Invalid MapType = " <<
MapType);
725 #ifdef MFEM_THREAD_SAFE
730 shape *= (1.0 / Trans.
Weight());
737 #ifdef MFEM_THREAD_SAFE
750 MFEM_ASSERT(vc.
GetVDim() == sdim,
"");
752 const bool square_J = (
Dim == sdim);
754 for (
int k = 0; k <
Dof; k++)
760 if (!square_J) { dofs(k) /= Trans.
Weight(); }
771 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
772 const bool square_J = (
Dim == sdim);
774 Vector nk_phys(sdim), dofs_k(MQ.Height());
775 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
777 for (
int k = 0; k <
Dof; k++)
783 if (!square_J) { nk_phys /= T.
Weight(); }
784 MQ.Mult(nk_phys, dofs_k);
785 for (
int r = 0; r < MQ.Height(); r++)
787 dofs(k+Dof*r) = dofs_k(r);
803 for (
int k = 0; k <
Dof; k++)
812 double w = 1.0/Trans.
Weight();
813 for (
int d = 0; d <
Dim; d++)
819 for (
int j = 0; j < shape.Size(); j++)
826 for (
int d = 0; d < sdim; d++)
828 I(k,j+d*shape.Size()) = s*vk[d];
835 mfem_error(
"VectorFiniteElement::Project_RT (fe version)");
845 mfem_error(
"VectorFiniteElement::ProjectGrad_RT works only in 2D!");
853 for (
int k = 0; k <
Dof; k++)
856 tk[0] = nk[d2n[k]*
Dim+1];
857 tk[1] = -nk[d2n[k]*
Dim];
858 dshape.Mult(tk, grad_k);
859 for (
int j = 0; j < grad_k.Size(); j++)
861 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
870 #ifdef MFEM_THREAD_SAFE
883 for (
int k = 0; k <
Dof; k++)
890 J *= 1.0 / Trans.
Weight();
897 for (
int j = 0; j < curl_k.Size(); j++)
899 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
912 for (
int k = 0; k <
Dof; k++)
915 curl_shape.Mult(nk + d2n[k]*
Dim, curl_k);
916 for (
int j = 0; j < curl_k.Size(); j++)
918 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
930 for (
int k = 0; k <
Dof; k++)
947 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
949 Vector tk_phys(sdim), dofs_k(MQ.Height());
950 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
952 for (
int k = 0; k <
Dof; k++)
958 MQ.Mult(tk_phys, dofs_k);
959 for (
int r = 0; r < MQ.Height(); r++)
961 dofs(k+Dof*r) = dofs_k(r);
977 for (
int k = 0; k <
Dof; k++)
986 double w = 1.0/Trans.
Weight();
987 for (
int d = 0; d < sdim; d++)
993 for (
int j = 0; j < shape.Size(); j++)
1000 for (
int d = 0; d < sdim; d++)
1002 I(k, j + d*shape.Size()) = s*vk[d];
1009 mfem_error(
"VectorFiniteElement::Project_ND (fe version)");
1023 for (
int k = 0; k <
Dof; k++)
1026 dshape.Mult(tk + d2t[k]*
Dim, grad_k);
1027 for (
int j = 0; j < grad_k.Size(); j++)
1029 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1043 #ifdef MFEM_THREAD_SAFE
1053 for (
int k = 0; k <
Dof; k++)
1064 for (
int i = 0; i <
Dim; i++)
1066 Ikj +=
vshape(j, i) * vk[i];
1068 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1080 #ifdef MFEM_THREAD_SAFE
1090 for (
int k = 0; k <
Dof; k++)
1101 for (
int i = 0; i <
Dim; i++)
1103 Ikj +=
vshape(j, i) * vk[i];
1105 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1118 #ifdef MFEM_THREAD_SAFE
1124 const double weight = Trans.
Weight();
1125 for (
int j = 0; j <
Dof; j++)
1134 for (
int k = 0; k <
Dof; k++)
1137 for (
int d = 0; d <
Dim; d++)
1139 R_jk +=
vshape(k,d)*pt_data[d];
1161 #ifdef MFEM_THREAD_SAFE
1167 for (
int j = 0; j <
Dof; j++)
1174 Jinv.
Mult(tk+
Dim*d2t[j], pt_data);
1175 for (
int k = 0; k <
Dof; k++)
1178 for (
int d = 0; d <
Dim; d++)
1180 R_jk +=
vshape(k,d)*pt_data[d];
1223 shape(0) = 1. - ip.
x;
1248 shape(0) = 1. - ip.
x - ip.
y;
1256 dshape(0,0) = -1.; dshape(0,1) = -1.;
1257 dshape(1,0) = 1.; dshape(1,1) = 0.;
1258 dshape(2,0) = 0.; dshape(2,1) = 1.;
1277 shape(0) = (1. - ip.
x) * (1. - ip.
y) ;
1278 shape(1) = ip.
x * (1. - ip.
y) ;
1279 shape(2) = ip.
x * ip.
y ;
1280 shape(3) = (1. - ip.
x) * ip.
y ;
1286 dshape(0,0) = -1. + ip.
y; dshape(0,1) = -1. + ip.
x ;
1287 dshape(1,0) = 1. - ip.
y; dshape(1,1) = -ip.
x ;
1288 dshape(2,0) = ip.
y ; dshape(2,1) = ip.
x ;
1289 dshape(3,0) = -ip.
y ; dshape(3,1) = 1. - ip.
x ;
1295 h(0,0) = 0.; h(0,1) = 1.; h(0,2) = 0.;
1296 h(1,0) = 0.; h(1,1) = -1.; h(1,2) = 0.;
1297 h(2,0) = 0.; h(2,1) = 1.; h(2,2) = 0.;
1298 h(3,0) = 0.; h(3,1) = -1.; h(3,2) = 0.;
1316 const double x = ip.
x, y = ip.
y;
1318 shape(0) = 5./3. - 2. * (x + y);
1319 shape(1) = 2. * (x - 1./6.);
1320 shape(2) = 2. * (y - 1./6.);
1326 dshape(0,0) = -2.; dshape(0,1) = -2.;
1327 dshape(1,0) = 2.; dshape(1,1) = 0.;
1328 dshape(2,0) = 0.; dshape(2,1) = 2.;
1333 dofs(vertex) = 2./3.;
1334 dofs((vertex+1)%3) = 1./6.;
1335 dofs((vertex+2)%3) = 1./6.;
1340 const double GaussBiLinear2DFiniteElement::p[] =
1341 { 0.2113248654051871177454256, 0.7886751345948128822545744 };
1359 const double x = ip.
x, y = ip.
y;
1361 shape(0) = 3. * (p[1] - x) * (p[1] - y);
1362 shape(1) = 3. * (x - p[0]) * (p[1] - y);
1363 shape(2) = 3. * (x - p[0]) * (y - p[0]);
1364 shape(3) = 3. * (p[1] - x) * (y - p[0]);
1370 const double x = ip.
x, y = ip.
y;
1372 dshape(0,0) = 3. * (y - p[1]); dshape(0,1) = 3. * (x - p[1]);
1373 dshape(1,0) = 3. * (p[1] - y); dshape(1,1) = 3. * (p[0] - x);
1374 dshape(2,0) = 3. * (y - p[0]); dshape(2,1) = 3. * (x - p[0]);
1375 dshape(3,0) = 3. * (p[0] - y); dshape(3,1) = 3. * (p[1] - x);
1381 dofs(vertex) = p[1]*p[1];
1382 dofs((vertex+1)%4) = p[0]*p[1];
1383 dofs((vertex+2)%4) = p[0]*p[0];
1384 dofs((vertex+3)%4) = p[0]*p[1];
1405 shape(0) = 1. - ip.
x - ip.
y;
1413 dshape(0,0) = -1.; dshape(0,1) = -1.;
1414 dshape(1,0) = 1.; dshape(1,1) = 0.;
1415 dshape(2,0) = 0.; dshape(2,1) = 1.;
1431 double l1 = 1.0 - x, l2 = x, l3 = 2. * x - 1.;
1433 shape(0) = l1 * (-l3);
1435 shape(2) = 4. * l1 * l2;
1443 dshape(0,0) = 4. * x - 3.;
1444 dshape(1,0) = 4. * x - 1.;
1445 dshape(2,0) = 4. - 8. * x;
1460 const double x = ip.
x, x1 = 1. - x;
1464 shape(2) = 2. * x * x1;
1470 const double x = ip.
x;
1472 dshape(0,0) = 2. * x - 2.;
1473 dshape(1,0) = 2. * x;
1474 dshape(2,0) = 2. - 4. * x;
1497 double x = ip.
x, y = ip.
y;
1498 double l1 = 1.-x-y, l2 = x, l3 = y;
1500 shape(0) = l1 * (2. * l1 - 1.);
1501 shape(1) = l2 * (2. * l2 - 1.);
1502 shape(2) = l3 * (2. * l3 - 1.);
1503 shape(3) = 4. * l1 * l2;
1504 shape(4) = 4. * l2 * l3;
1505 shape(5) = 4. * l3 * l1;
1511 double x = ip.
x, y = ip.
y;
1514 dshape(0,1) = 4. * (x + y) - 3.;
1516 dshape(1,0) = 4. * x - 1.;
1520 dshape(2,1) = 4. * y - 1.;
1522 dshape(3,0) = -4. * (2. * x + y - 1.);
1523 dshape(3,1) = -4. * x;
1525 dshape(4,0) = 4. * y;
1526 dshape(4,1) = 4. * x;
1528 dshape(5,0) = -4. * y;
1529 dshape(5,1) = -4. * (x + 2. * y - 1.);
1569 case 0: dofs(3) = 0.25; dofs(5) = 0.25;
break;
1570 case 1: dofs(3) = 0.25; dofs(4) = 0.25;
break;
1571 case 2: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1577 const double GaussQuad2DFiniteElement::p[] =
1578 { 0.0915762135097707434595714634022015, 0.445948490915964886318329253883051 };
1596 for (
int i = 0; i < 6; i++)
1613 const double x = ip.
x, y = ip.
y;
1627 const double x = ip.
x, y = ip.
y;
1628 D(0,0) = 0.; D(0,1) = 0.;
1629 D(1,0) = 1.; D(1,1) = 0.;
1630 D(2,0) = 0.; D(2,1) = 1.;
1631 D(3,0) = 2. * x; D(3,1) = 0.;
1632 D(4,0) = y; D(4,1) = x;
1633 D(5,0) = 0.; D(5,1) = 2. * y;
1665 double x = ip.
x, y = ip.
y;
1666 double l1x, l2x, l3x, l1y, l2y, l3y;
1668 l1x = (x - 1.) * (2. * x - 1);
1669 l2x = 4. * x * (1. - x);
1670 l3x = x * (2. * x - 1.);
1671 l1y = (y - 1.) * (2. * y - 1);
1672 l2y = 4. * y * (1. - y);
1673 l3y = y * (2. * y - 1.);
1675 shape(0) = l1x * l1y;
1676 shape(4) = l2x * l1y;
1677 shape(1) = l3x * l1y;
1678 shape(7) = l1x * l2y;
1679 shape(8) = l2x * l2y;
1680 shape(5) = l3x * l2y;
1681 shape(3) = l1x * l3y;
1682 shape(6) = l2x * l3y;
1683 shape(2) = l3x * l3y;
1689 double x = ip.
x, y = ip.
y;
1690 double l1x, l2x, l3x, l1y, l2y, l3y;
1691 double d1x, d2x, d3x, d1y, d2y, d3y;
1693 l1x = (x - 1.) * (2. * x - 1);
1694 l2x = 4. * x * (1. - x);
1695 l3x = x * (2. * x - 1.);
1696 l1y = (y - 1.) * (2. * y - 1);
1697 l2y = 4. * y * (1. - y);
1698 l3y = y * (2. * y - 1.);
1707 dshape(0,0) = d1x * l1y;
1708 dshape(0,1) = l1x * d1y;
1710 dshape(4,0) = d2x * l1y;
1711 dshape(4,1) = l2x * d1y;
1713 dshape(1,0) = d3x * l1y;
1714 dshape(1,1) = l3x * d1y;
1716 dshape(7,0) = d1x * l2y;
1717 dshape(7,1) = l1x * d2y;
1719 dshape(8,0) = d2x * l2y;
1720 dshape(8,1) = l2x * d2y;
1722 dshape(5,0) = d3x * l2y;
1723 dshape(5,1) = l3x * d2y;
1725 dshape(3,0) = d1x * l3y;
1726 dshape(3,1) = l1x * d3y;
1728 dshape(6,0) = d2x * l3y;
1729 dshape(6,1) = l2x * d3y;
1731 dshape(2,0) = d3x * l3y;
1732 dshape(2,1) = l3x * d3y;
1744 case 0: dofs(4) = 0.25; dofs(7) = 0.25;
break;
1745 case 1: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1746 case 2: dofs(5) = 0.25; dofs(6) = 0.25;
break;
1747 case 3: dofs(6) = 0.25; dofs(7) = 0.25;
break;
1779 double x = ip.
x, y = ip.
y;
1780 double l1x, l2x, l3x, l1y, l2y, l3y;
1782 l1x = (1. - x) * (1. - x);
1783 l2x = 2. * x * (1. - x);
1785 l1y = (1. - y) * (1. - y);
1786 l2y = 2. * y * (1. - y);
1789 shape(0) = l1x * l1y;
1790 shape(4) = l2x * l1y;
1791 shape(1) = l3x * l1y;
1792 shape(7) = l1x * l2y;
1793 shape(8) = l2x * l2y;
1794 shape(5) = l3x * l2y;
1795 shape(3) = l1x * l3y;
1796 shape(6) = l2x * l3y;
1797 shape(2) = l3x * l3y;
1803 double x = ip.
x, y = ip.
y;
1804 double l1x, l2x, l3x, l1y, l2y, l3y;
1805 double d1x, d2x, d3x, d1y, d2y, d3y;
1807 l1x = (1. - x) * (1. - x);
1808 l2x = 2. * x * (1. - x);
1810 l1y = (1. - y) * (1. - y);
1811 l2y = 2. * y * (1. - y);
1821 dshape(0,0) = d1x * l1y;
1822 dshape(0,1) = l1x * d1y;
1824 dshape(4,0) = d2x * l1y;
1825 dshape(4,1) = l2x * d1y;
1827 dshape(1,0) = d3x * l1y;
1828 dshape(1,1) = l3x * d1y;
1830 dshape(7,0) = d1x * l2y;
1831 dshape(7,1) = l1x * d2y;
1833 dshape(8,0) = d2x * l2y;
1834 dshape(8,1) = l2x * d2y;
1836 dshape(5,0) = d3x * l2y;
1837 dshape(5,1) = l3x * d2y;
1839 dshape(3,0) = d1x * l3y;
1840 dshape(3,1) = l1x * d3y;
1842 dshape(6,0) = d2x * l3y;
1843 dshape(6,1) = l2x * d3y;
1845 dshape(2,0) = d3x * l3y;
1846 dshape(2,1) = l3x * d3y;
1854 Vector xx(&tr_ip.
x, 2), shape(s, 9);
1856 for (
int i = 0; i < 9; i++)
1860 for (
int j = 0; j < 9; j++)
1861 if (fabs(I(i,j) = s[j]) < 1.0e-12)
1866 for (
int i = 0; i < 9; i++)
1868 double *d = &I(0,i);
1869 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
1870 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
1871 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
1872 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
1873 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
1874 0.25 * (d[0] + d[1] + d[2] + d[3]);
1883 for (
int i = 0; i < 9; i++)
1887 d[i] = coeff.
Eval(Trans, ip);
1889 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
1890 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
1891 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
1892 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
1893 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
1894 0.25 * (d[0] + d[1] + d[2] + d[3]);
1904 for (
int i = 0; i < 9; i++)
1908 vc.
Eval (x, Trans, ip);
1909 for (
int j = 0; j < x.Size(); j++)
1914 for (
int j = 0; j < x.Size(); j++)
1916 double *d = &dofs(9*j);
1918 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
1919 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
1920 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
1921 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
1922 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
1923 0.25 * (d[0] + d[1] + d[2] + d[3]);
1931 const double p1 = 0.5*(1.-sqrt(3./5.));
1956 const double a = sqrt(5./3.);
1957 const double p1 = 0.5*(1.-sqrt(3./5.));
1959 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
1960 double l1x, l2x, l3x, l1y, l2y, l3y;
1962 l1x = (x - 1.) * (2. * x - 1);
1963 l2x = 4. * x * (1. - x);
1964 l3x = x * (2. * x - 1.);
1965 l1y = (y - 1.) * (2. * y - 1);
1966 l2y = 4. * y * (1. - y);
1967 l3y = y * (2. * y - 1.);
1969 shape(0) = l1x * l1y;
1970 shape(4) = l2x * l1y;
1971 shape(1) = l3x * l1y;
1972 shape(7) = l1x * l2y;
1973 shape(8) = l2x * l2y;
1974 shape(5) = l3x * l2y;
1975 shape(3) = l1x * l3y;
1976 shape(6) = l2x * l3y;
1977 shape(2) = l3x * l3y;
1983 const double a = sqrt(5./3.);
1984 const double p1 = 0.5*(1.-sqrt(3./5.));
1986 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
1987 double l1x, l2x, l3x, l1y, l2y, l3y;
1988 double d1x, d2x, d3x, d1y, d2y, d3y;
1990 l1x = (x - 1.) * (2. * x - 1);
1991 l2x = 4. * x * (1. - x);
1992 l3x = x * (2. * x - 1.);
1993 l1y = (y - 1.) * (2. * y - 1);
1994 l2y = 4. * y * (1. - y);
1995 l3y = y * (2. * y - 1.);
1997 d1x = a * (4. * x - 3.);
1998 d2x = a * (4. - 8. * x);
1999 d3x = a * (4. * x - 1.);
2000 d1y = a * (4. * y - 3.);
2001 d2y = a * (4. - 8. * y);
2002 d3y = a * (4. * y - 1.);
2004 dshape(0,0) = d1x * l1y;
2005 dshape(0,1) = l1x * d1y;
2007 dshape(4,0) = d2x * l1y;
2008 dshape(4,1) = l2x * d1y;
2010 dshape(1,0) = d3x * l1y;
2011 dshape(1,1) = l3x * d1y;
2013 dshape(7,0) = d1x * l2y;
2014 dshape(7,1) = l1x * d2y;
2016 dshape(8,0) = d2x * l2y;
2017 dshape(8,1) = l2x * d2y;
2019 dshape(5,0) = d3x * l2y;
2020 dshape(5,1) = l3x * d2y;
2022 dshape(3,0) = d1x * l3y;
2023 dshape(3,1) = l1x * d3y;
2025 dshape(6,0) = d2x * l3y;
2026 dshape(6,1) = l2x * d3y;
2028 dshape(2,0) = d3x * l3y;
2029 dshape(2,1) = l3x * d3y;
2072 double x = ip.
x, y = ip.
y;
2074 double w1x, w2x, w3x, w1y, w2y, w3y;
2075 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2077 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2078 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2080 l0x = (- 4.5) * w1x * w2x * w3x;
2081 l1x = ( 13.5) * x * w2x * w3x;
2082 l2x = (-13.5) * x * w1x * w3x;
2083 l3x = ( 4.5) * x * w1x * w2x;
2085 l0y = (- 4.5) * w1y * w2y * w3y;
2086 l1y = ( 13.5) * y * w2y * w3y;
2087 l2y = (-13.5) * y * w1y * w3y;
2088 l3y = ( 4.5) * y * w1y * w2y;
2090 shape(0) = l0x * l0y;
2091 shape(1) = l3x * l0y;
2092 shape(2) = l3x * l3y;
2093 shape(3) = l0x * l3y;
2094 shape(4) = l1x * l0y;
2095 shape(5) = l2x * l0y;
2096 shape(6) = l3x * l1y;
2097 shape(7) = l3x * l2y;
2098 shape(8) = l2x * l3y;
2099 shape(9) = l1x * l3y;
2100 shape(10) = l0x * l2y;
2101 shape(11) = l0x * l1y;
2102 shape(12) = l1x * l1y;
2103 shape(13) = l2x * l1y;
2104 shape(14) = l1x * l2y;
2105 shape(15) = l2x * l2y;
2111 double x = ip.
x, y = ip.
y;
2113 double w1x, w2x, w3x, w1y, w2y, w3y;
2114 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2115 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2117 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2118 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2120 l0x = (- 4.5) * w1x * w2x * w3x;
2121 l1x = ( 13.5) * x * w2x * w3x;
2122 l2x = (-13.5) * x * w1x * w3x;
2123 l3x = ( 4.5) * x * w1x * w2x;
2125 l0y = (- 4.5) * w1y * w2y * w3y;
2126 l1y = ( 13.5) * y * w2y * w3y;
2127 l2y = (-13.5) * y * w1y * w3y;
2128 l3y = ( 4.5) * y * w1y * w2y;
2130 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2131 d1x = 9. + (-45. + 40.5 * x) * x;
2132 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2133 d3x = 1. + (- 9. + 13.5 * x) * x;
2135 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2136 d1y = 9. + (-45. + 40.5 * y) * y;
2137 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2138 d3y = 1. + (- 9. + 13.5 * y) * y;
2140 dshape( 0,0) = d0x * l0y; dshape( 0,1) = l0x * d0y;
2141 dshape( 1,0) = d3x * l0y; dshape( 1,1) = l3x * d0y;
2142 dshape( 2,0) = d3x * l3y; dshape( 2,1) = l3x * d3y;
2143 dshape( 3,0) = d0x * l3y; dshape( 3,1) = l0x * d3y;
2144 dshape( 4,0) = d1x * l0y; dshape( 4,1) = l1x * d0y;
2145 dshape( 5,0) = d2x * l0y; dshape( 5,1) = l2x * d0y;
2146 dshape( 6,0) = d3x * l1y; dshape( 6,1) = l3x * d1y;
2147 dshape( 7,0) = d3x * l2y; dshape( 7,1) = l3x * d2y;
2148 dshape( 8,0) = d2x * l3y; dshape( 8,1) = l2x * d3y;
2149 dshape( 9,0) = d1x * l3y; dshape( 9,1) = l1x * d3y;
2150 dshape(10,0) = d0x * l2y; dshape(10,1) = l0x * d2y;
2151 dshape(11,0) = d0x * l1y; dshape(11,1) = l0x * d1y;
2152 dshape(12,0) = d1x * l1y; dshape(12,1) = l1x * d1y;
2153 dshape(13,0) = d2x * l1y; dshape(13,1) = l2x * d1y;
2154 dshape(14,0) = d1x * l2y; dshape(14,1) = l1x * d2y;
2155 dshape(15,0) = d2x * l2y; dshape(15,1) = l2x * d2y;
2161 double x = ip.
x, y = ip.
y;
2163 double w1x, w2x, w3x, w1y, w2y, w3y;
2164 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2165 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2166 double h0x, h1x, h2x, h3x, h0y, h1y, h2y, h3y;
2168 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2169 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2171 l0x = (- 4.5) * w1x * w2x * w3x;
2172 l1x = ( 13.5) * x * w2x * w3x;
2173 l2x = (-13.5) * x * w1x * w3x;
2174 l3x = ( 4.5) * x * w1x * w2x;
2176 l0y = (- 4.5) * w1y * w2y * w3y;
2177 l1y = ( 13.5) * y * w2y * w3y;
2178 l2y = (-13.5) * y * w1y * w3y;
2179 l3y = ( 4.5) * y * w1y * w2y;
2181 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2182 d1x = 9. + (-45. + 40.5 * x) * x;
2183 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2184 d3x = 1. + (- 9. + 13.5 * x) * x;
2186 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2187 d1y = 9. + (-45. + 40.5 * y) * y;
2188 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2189 d3y = 1. + (- 9. + 13.5 * y) * y;
2191 h0x = -27. * x + 18.;
2192 h1x = 81. * x - 45.;
2193 h2x = -81. * x + 36.;
2196 h0y = -27. * y + 18.;
2197 h1y = 81. * y - 45.;
2198 h2y = -81. * y + 36.;
2201 h( 0,0) = h0x * l0y; h( 0,1) = d0x * d0y; h( 0,2) = l0x * h0y;
2202 h( 1,0) = h3x * l0y; h( 1,1) = d3x * d0y; h( 1,2) = l3x * h0y;
2203 h( 2,0) = h3x * l3y; h( 2,1) = d3x * d3y; h( 2,2) = l3x * h3y;
2204 h( 3,0) = h0x * l3y; h( 3,1) = d0x * d3y; h( 3,2) = l0x * h3y;
2205 h( 4,0) = h1x * l0y; h( 4,1) = d1x * d0y; h( 4,2) = l1x * h0y;
2206 h( 5,0) = h2x * l0y; h( 5,1) = d2x * d0y; h( 5,2) = l2x * h0y;
2207 h( 6,0) = h3x * l1y; h( 6,1) = d3x * d1y; h( 6,2) = l3x * h1y;
2208 h( 7,0) = h3x * l2y; h( 7,1) = d3x * d2y; h( 7,2) = l3x * h2y;
2209 h( 8,0) = h2x * l3y; h( 8,1) = d2x * d3y; h( 8,2) = l2x * h3y;
2210 h( 9,0) = h1x * l3y; h( 9,1) = d1x * d3y; h( 9,2) = l1x * h3y;
2211 h(10,0) = h0x * l2y; h(10,1) = d0x * d2y; h(10,2) = l0x * h2y;
2212 h(11,0) = h0x * l1y; h(11,1) = d0x * d1y; h(11,2) = l0x * h1y;
2213 h(12,0) = h1x * l1y; h(12,1) = d1x * d1y; h(12,2) = l1x * h1y;
2214 h(13,0) = h2x * l1y; h(13,1) = d2x * d1y; h(13,2) = l2x * h1y;
2215 h(14,0) = h1x * l2y; h(14,1) = d1x * d2y; h(14,2) = l1x * h2y;
2216 h(15,0) = h2x * l2y; h(15,1) = d2x * d2y; h(15,2) = l2x * h2y;
2235 l3 = (0.33333333333333333333-x),
2236 l4 = (0.66666666666666666667-x);
2238 shape(0) = 4.5 * l2 * l3 * l4;
2239 shape(1) = 4.5 * l1 * l3 * l4;
2240 shape(2) = 13.5 * l1 * l2 * l4;
2241 shape(3) = -13.5 * l1 * l2 * l3;
2249 dshape(0,0) = -5.5 + x * (18. - 13.5 * x);
2250 dshape(1,0) = 1. - x * (9. - 13.5 * x);
2251 dshape(2,0) = 9. - x * (45. - 40.5 * x);
2252 dshape(3,0) = -4.5 + x * (36. - 40.5 * x);
2284 double x = ip.
x, y = ip.
y;
2285 double l1 = (-1. + x + y),
2289 shape(0) = -0.5*l1*(3.*l1 + 1.)*(3.*l1 + 2.);
2290 shape(1) = 0.5*x*(lx - 1.)*lx;
2291 shape(2) = 0.5*y*(-1. + ly)*ly;
2292 shape(3) = 4.5*x*l1*(3.*l1 + 1.);
2293 shape(4) = -4.5*x*lx*l1;
2294 shape(5) = 4.5*x*lx*y;
2295 shape(6) = 4.5*x*y*ly;
2296 shape(7) = -4.5*y*l1*ly;
2297 shape(8) = 4.5*y*l1*(1. + 3.*l1);
2298 shape(9) = -27.*x*y*l1;
2304 double x = ip.
x, y = ip.
y;
2306 dshape(0,0) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2307 dshape(1,0) = 1. + 4.5*x*(-2. + 3.*x);
2309 dshape(3,0) = 4.5*(2. + 9.*x*x - 5.*y + 3.*y*y + 2.*x*(-5. + 6.*y));
2310 dshape(4,0) = -4.5*(1. - 1.*y + x*(-8. + 9.*x + 6.*y));
2311 dshape(5,0) = 4.5*(-1. + 6.*x)*y;
2312 dshape(6,0) = 4.5*y*(-1. + 3.*y);
2313 dshape(7,0) = 4.5*(1. - 3.*y)*y;
2314 dshape(8,0) = 4.5*y*(-5. + 6.*x + 6.*y);
2315 dshape(9,0) = -27.*y*(-1. + 2.*x + y);
2317 dshape(0,1) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2319 dshape(2,1) = 1. + 4.5*y*(-2. + 3.*y);
2320 dshape(3,1) = 4.5*x*(-5. + 6.*x + 6.*y);
2321 dshape(4,1) = 4.5*(1. - 3.*x)*x;
2322 dshape(5,1) = 4.5*x*(-1. + 3.*x);
2323 dshape(6,1) = 4.5*x*(-1. + 6.*y);
2324 dshape(7,1) = -4.5*(1. + x*(-1. + 6.*y) + y*(-8. + 9.*y));
2325 dshape(8,1) = 4.5*(2. + 3.*x*x + y*(-10. + 9.*y) + x*(-5. + 12.*y));
2326 dshape(9,1) = -27.*x*(-1. + x + 2.*y);
2332 double x = ip.
x, y = ip.
y;
2334 h(0,0) = 18.-27.*(x+y);
2335 h(0,1) = 18.-27.*(x+y);
2336 h(0,2) = 18.-27.*(x+y);
2346 h(3,0) = -45.+81.*x+54.*y;
2347 h(3,1) = -22.5+54.*x+27.*y;
2350 h(4,0) = 36.-81.*x-27.*y;
2355 h(5,1) = -4.5+27.*x;
2359 h(6,1) = -4.5+27.*y;
2364 h(7,2) = 36.-27.*x-81.*y;
2367 h(8,1) = -22.5+27.*x+54.*y;
2368 h(8,2) = -45.+54.*x+81.*y;
2371 h(9,1) = 27.-54.*(x+y);
2444 double x = ip.
x, y = ip.
y, z = ip.
z;
2446 shape(0) = -((-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z)*
2447 (-1 + 3*x + 3*y + 3*z))/2.;
2448 shape(4) = (9*x*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2449 shape(5) = (-9*x*(-1 + 3*x)*(-1 + x + y + z))/2.;
2450 shape(1) = (x*(2 + 9*(-1 + x)*x))/2.;
2451 shape(6) = (9*y*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2452 shape(19) = -27*x*y*(-1 + x + y + z);
2453 shape(10) = (9*x*(-1 + 3*x)*y)/2.;
2454 shape(7) = (-9*y*(-1 + 3*y)*(-1 + x + y + z))/2.;
2455 shape(11) = (9*x*y*(-1 + 3*y))/2.;
2456 shape(2) = (y*(2 + 9*(-1 + y)*y))/2.;
2457 shape(8) = (9*z*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2458 shape(18) = -27*x*z*(-1 + x + y + z);
2459 shape(12) = (9*x*(-1 + 3*x)*z)/2.;
2460 shape(17) = -27*y*z*(-1 + x + y + z);
2461 shape(16) = 27*x*y*z;
2462 shape(14) = (9*y*(-1 + 3*y)*z)/2.;
2463 shape(9) = (-9*z*(-1 + x + y + z)*(-1 + 3*z))/2.;
2464 shape(13) = (9*x*z*(-1 + 3*z))/2.;
2465 shape(15) = (9*y*z*(-1 + 3*z))/2.;
2466 shape(3) = (z*(2 + 9*(-1 + z)*z))/2.;
2472 double x = ip.
x, y = ip.
y, z = ip.
z;
2474 dshape(0,0) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2475 x*(-4 + 6*y + 6*z)))/2.;
2476 dshape(0,1) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2477 x*(-4 + 6*y + 6*z)))/2.;
2478 dshape(0,2) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2479 x*(-4 + 6*y + 6*z)))/2.;
2480 dshape(4,0) = (9*(9*pow(x,2) + (-1 + y + z)*(-2 + 3*y + 3*z) +
2481 2*x*(-5 + 6*y + 6*z)))/2.;
2482 dshape(4,1) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2483 dshape(4,2) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2484 dshape(5,0) = (-9*(1 - y - z + x*(-8 + 9*x + 6*y + 6*z)))/2.;
2485 dshape(5,1) = (9*(1 - 3*x)*x)/2.;
2486 dshape(5,2) = (9*(1 - 3*x)*x)/2.;
2487 dshape(1,0) = 1 + (9*x*(-2 + 3*x))/2.;
2490 dshape(6,0) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2491 dshape(6,1) = (9*(2 + 3*pow(x,2) - 10*y - 5*z + 3*(y + z)*(3*y + z) +
2492 x*(-5 + 12*y + 6*z)))/2.;
2493 dshape(6,2) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2494 dshape(19,0) = -27*y*(-1 + 2*x + y + z);
2495 dshape(19,1) = -27*x*(-1 + x + 2*y + z);
2496 dshape(19,2) = -27*x*y;
2497 dshape(10,0) = (9*(-1 + 6*x)*y)/2.;
2498 dshape(10,1) = (9*x*(-1 + 3*x))/2.;
2500 dshape(7,0) = (9*(1 - 3*y)*y)/2.;
2501 dshape(7,1) = (-9*(1 + x*(-1 + 6*y) - z + y*(-8 + 9*y + 6*z)))/2.;
2502 dshape(7,2) = (9*(1 - 3*y)*y)/2.;
2503 dshape(11,0) = (9*y*(-1 + 3*y))/2.;
2504 dshape(11,1) = (9*x*(-1 + 6*y))/2.;
2507 dshape(2,1) = 1 + (9*y*(-2 + 3*y))/2.;
2509 dshape(8,0) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2510 dshape(8,1) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2511 dshape(8,2) = (9*(2 + 3*pow(x,2) - 5*y - 10*z + 3*(y + z)*(y + 3*z) +
2512 x*(-5 + 6*y + 12*z)))/2.;
2513 dshape(18,0) = -27*z*(-1 + 2*x + y + z);
2514 dshape(18,1) = -27*x*z;
2515 dshape(18,2) = -27*x*(-1 + x + y + 2*z);
2516 dshape(12,0) = (9*(-1 + 6*x)*z)/2.;
2518 dshape(12,2) = (9*x*(-1 + 3*x))/2.;
2519 dshape(17,0) = -27*y*z;
2520 dshape(17,1) = -27*z*(-1 + x + 2*y + z);
2521 dshape(17,2) = -27*y*(-1 + x + y + 2*z);
2522 dshape(16,0) = 27*y*z;
2523 dshape(16,1) = 27*x*z;
2524 dshape(16,2) = 27*x*y;
2526 dshape(14,1) = (9*(-1 + 6*y)*z)/2.;
2527 dshape(14,2) = (9*y*(-1 + 3*y))/2.;
2528 dshape(9,0) = (9*(1 - 3*z)*z)/2.;
2529 dshape(9,1) = (9*(1 - 3*z)*z)/2.;
2530 dshape(9,2) = (9*(-1 + x + y + 8*z - 6*(x + y)*z - 9*pow(z,2)))/2.;
2531 dshape(13,0) = (9*z*(-1 + 3*z))/2.;
2533 dshape(13,2) = (9*x*(-1 + 6*z))/2.;
2535 dshape(15,1) = (9*z*(-1 + 3*z))/2.;
2536 dshape(15,2) = (9*y*(-1 + 6*z))/2.;
2539 dshape(3,2) = 1 + (9*z*(-2 + 3*z))/2.;
2605 shape(0) = 1. - ip.
x - ip.
y - ip.
z;
2614 if (dshape.
Height() == 4)
2616 double *A = &dshape(0,0);
2617 A[0] = -1.; A[4] = -1.; A[8] = -1.;
2618 A[1] = 1.; A[5] = 0.; A[9] = 0.;
2619 A[2] = 0.; A[6] = 1.; A[10] = 0.;
2620 A[3] = 0.; A[7] = 0.; A[11] = 1.;
2624 dshape(0,0) = -1.; dshape(0,1) = -1.; dshape(0,2) = -1.;
2625 dshape(1,0) = 1.; dshape(1,1) = 0.; dshape(1,2) = 0.;
2626 dshape(2,0) = 0.; dshape(2,1) = 1.; dshape(2,2) = 0.;
2627 dshape(3,0) = 0.; dshape(3,1) = 0.; dshape(3,2) = 1.;
2634 static int face_dofs[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
2637 *dofs = face_dofs[face];
2679 double L0, L1, L2, L3;
2681 L0 = 1. - ip.
x - ip.
y - ip.
z;
2686 shape(0) = L0 * ( 2.0 * L0 - 1.0 );
2687 shape(1) = L1 * ( 2.0 * L1 - 1.0 );
2688 shape(2) = L2 * ( 2.0 * L2 - 1.0 );
2689 shape(3) = L3 * ( 2.0 * L3 - 1.0 );
2690 shape(4) = 4.0 * L0 * L1;
2691 shape(5) = 4.0 * L0 * L2;
2692 shape(6) = 4.0 * L0 * L3;
2693 shape(7) = 4.0 * L1 * L2;
2694 shape(8) = 4.0 * L1 * L3;
2695 shape(9) = 4.0 * L2 * L3;
2706 L0 = 1.0 - x - y - z;
2708 dshape(0,0) = dshape(0,1) = dshape(0,2) = 1.0 - 4.0 * L0;
2709 dshape(1,0) = -1.0 + 4.0 * x; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
2710 dshape(2,0) = 0.0; dshape(2,1) = -1.0 + 4.0 * y; dshape(2,2) = 0.0;
2711 dshape(3,0) = dshape(3,1) = 0.0; dshape(3,2) = -1.0 + 4.0 * z;
2712 dshape(4,0) = 4.0 * (L0 - x); dshape(4,1) = dshape(4,2) = -4.0 * x;
2713 dshape(5,0) = dshape(5,2) = -4.0 * y; dshape(5,1) = 4.0 * (L0 - y);
2714 dshape(6,0) = dshape(6,1) = -4.0 * z; dshape(6,2) = 4.0 * (L0 - z);
2715 dshape(7,0) = 4.0 * y; dshape(7,1) = 4.0 * x; dshape(7,2) = 0.0;
2716 dshape(8,0) = 4.0 * z; dshape(8,1) = 0.0; dshape(8,2) = 4.0 * x;
2717 dshape(9,0) = 0.0; dshape(9,1) = 4.0 * z; dshape(9,2) = 4.0 * y;
2759 double x = ip.
x, y = ip.
y, z = ip.
z;
2760 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
2762 shape(0) = ox * oy * oz;
2763 shape(1) = x * oy * oz;
2764 shape(2) = x * y * oz;
2765 shape(3) = ox * y * oz;
2766 shape(4) = ox * oy * z;
2767 shape(5) = x * oy * z;
2768 shape(6) = x * y * z;
2769 shape(7) = ox * y * z;
2775 double x = ip.
x, y = ip.
y, z = ip.
z;
2776 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
2778 dshape(0,0) = - oy * oz;
2779 dshape(0,1) = - ox * oz;
2780 dshape(0,2) = - ox * oy;
2782 dshape(1,0) = oy * oz;
2783 dshape(1,1) = - x * oz;
2784 dshape(1,2) = - x * oy;
2786 dshape(2,0) = y * oz;
2787 dshape(2,1) = x * oz;
2788 dshape(2,2) = - x * y;
2790 dshape(3,0) = - y * oz;
2791 dshape(3,1) = ox * oz;
2792 dshape(3,2) = - ox * y;
2794 dshape(4,0) = - oy * z;
2795 dshape(4,1) = - ox * z;
2796 dshape(4,2) = ox * oy;
2798 dshape(5,0) = oy * z;
2799 dshape(5,1) = - x * z;
2800 dshape(5,2) = x * oy;
2802 dshape(6,0) = y * z;
2803 dshape(6,1) = x * z;
2804 dshape(6,2) = x * y;
2806 dshape(7,0) = - y * z;
2807 dshape(7,1) = ox * z;
2808 dshape(7,2) = ox * y;
2844 shape(0) = 1.0 - 2.0 * ip.
y;
2845 shape(1) = -1.0 + 2.0 * ( ip.
x + ip.
y );
2846 shape(2) = 1.0 - 2.0 * ip.
x;
2852 dshape(0,0) = 0.0; dshape(0,1) = -2.0;
2853 dshape(1,0) = 2.0; dshape(1,1) = 2.0;
2854 dshape(2,0) = -2.0; dshape(2,1) = 0.0;
2875 const double l1 = ip.
x+ip.
y-0.5, l2 = 1.-l1, l3 = ip.
x-ip.
y+0.5, l4 = 1.-l3;
2886 const double x2 = 2.*ip.
x, y2 = 2.*ip.
y;
2888 dshape(0,0) = 1. - x2; dshape(0,1) = -2. + y2;
2889 dshape(1,0) = x2; dshape(1,1) = 1. - y2;
2890 dshape(2,0) = 1. - x2; dshape(2,1) = y2;
2891 dshape(3,0) = -2. + x2; dshape(3,1) = 1. - y2;
2909 double x = ip.
x, y = ip.
y;
2912 shape(0,1) = y - 1.;
2915 shape(2,0) = x - 1.;
2927 const double RT0TriangleFiniteElement::nk[3][2] =
2928 { {0, -1}, {1, 1}, {-1, 0} };
2934 #ifdef MFEM_THREAD_SAFE
2940 for (k = 0; k < 3; k++)
2943 for (j = 0; j < 3; j++)
2946 if (j == k) { d -= 1.0; }
2947 if (fabs(d) > 1.0e-12)
2949 mfem::err <<
"RT0TriangleFiniteElement::GetLocalInterpolation (...)\n"
2950 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
2966 for (k = 0; k < 3; k++)
2969 ip.
x = vk[0]; ip.
y = vk[1];
2972 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
2973 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
2974 for (j = 0; j < 3; j++)
2975 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
2988 #ifdef MFEM_THREAD_SAFE
2992 for (
int k = 0; k < 3; k++)
3000 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3001 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3021 double x = ip.
x, y = ip.
y;
3024 shape(0,1) = y - 1.;
3029 shape(3,0) = x - 1.;
3042 const double RT0QuadFiniteElement::nk[4][2] =
3043 { {0, -1}, {1, 0}, {0, 1}, {-1, 0} };
3049 #ifdef MFEM_THREAD_SAFE
3055 for (k = 0; k < 4; k++)
3058 for (j = 0; j < 4; j++)
3061 if (j == k) { d -= 1.0; }
3062 if (fabs(d) > 1.0e-12)
3064 mfem::err <<
"RT0QuadFiniteElement::GetLocalInterpolation (...)\n"
3065 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3081 for (k = 0; k < 4; k++)
3084 ip.
x = vk[0]; ip.
y = vk[1];
3087 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3088 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3089 for (j = 0; j < 4; j++)
3090 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3103 #ifdef MFEM_THREAD_SAFE
3107 for (
int k = 0; k < 4; k++)
3115 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3116 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3144 double x = ip.
x, y = ip.
y;
3146 shape(0,0) = -2 * x * (-1 + x + 2 * y);
3147 shape(0,1) = -2 * (-1 + y) * (-1 + x + 2 * y);
3148 shape(1,0) = 2 * x * (x - y);
3149 shape(1,1) = 2 * (x - y) * (-1 + y);
3150 shape(2,0) = 2 * x * (-1 + 2 * x + y);
3151 shape(2,1) = 2 * y * (-1 + 2 * x + y);
3152 shape(3,0) = 2 * x * (-1 + x + 2 * y);
3153 shape(3,1) = 2 * y * (-1 + x + 2 * y);
3154 shape(4,0) = -2 * (-1 + x) * (x - y);
3155 shape(4,1) = 2 * y * (-x + y);
3156 shape(5,0) = -2 * (-1 + x) * (-1 + 2 * x + y);
3157 shape(5,1) = -2 * y * (-1 + 2 * x + y);
3158 shape(6,0) = -3 * x * (-2 + 2 * x + y);
3159 shape(6,1) = -3 * y * (-1 + 2 * x + y);
3160 shape(7,0) = -3 * x * (-1 + x + 2 * y);
3161 shape(7,1) = -3 * y * (-2 + x + 2 * y);
3167 double x = ip.
x, y = ip.
y;
3169 divshape(0) = -2 * (-4 + 3 * x + 6 * y);
3170 divshape(1) = 2 + 6 * x - 6 * y;
3171 divshape(2) = -4 + 12 * x + 6 * y;
3172 divshape(3) = -4 + 6 * x + 12 * y;
3173 divshape(4) = 2 - 6 * x + 6 * y;
3174 divshape(5) = -2 * (-4 + 6 * x + 3 * y);
3175 divshape(6) = -9 * (-1 + 2 * x + y);
3176 divshape(7) = -9 * (-1 + x + 2 * y);
3179 const double RT1TriangleFiniteElement::nk[8][2] =
3191 #ifdef MFEM_THREAD_SAFE
3197 for (k = 0; k < 8; k++)
3200 for (j = 0; j < 8; j++)
3203 if (j == k) { d -= 1.0; }
3204 if (fabs(d) > 1.0e-12)
3206 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3207 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3223 for (k = 0; k < 8; k++)
3226 ip.
x = vk[0]; ip.
y = vk[1];
3229 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3230 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3231 for (j = 0; j < 8; j++)
3232 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3244 #ifdef MFEM_THREAD_SAFE
3248 for (
int k = 0; k < 8; k++)
3256 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3257 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3300 double x = ip.
x, y = ip.
y;
3304 shape(0,1) = -( 1. - 3.*y + 2.*y*y)*( 2. - 3.*x);
3306 shape(1,1) = -( 1. - 3.*y + 2.*y*y)*(-1. + 3.*x);
3308 shape(2,0) = (-x + 2.*x*x)*( 2. - 3.*y);
3310 shape(3,0) = (-x + 2.*x*x)*(-1. + 3.*y);
3314 shape(4,1) = (-y + 2.*y*y)*(-1. + 3.*x);
3316 shape(5,1) = (-y + 2.*y*y)*( 2. - 3.*x);
3318 shape(6,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y);
3320 shape(7,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y);
3323 shape(8,0) = (4.*x - 4.*x*x)*( 2. - 3.*y);
3325 shape(9,0) = (4.*x - 4.*x*x)*(-1. + 3.*y);
3329 shape(10,1) = (4.*y - 4.*y*y)*( 2. - 3.*x);
3331 shape(11,1) = (4.*y - 4.*y*y)*(-1. + 3.*x);
3337 double x = ip.
x, y = ip.
y;
3339 divshape(0) = -(-3. + 4.*y)*( 2. - 3.*x);
3340 divshape(1) = -(-3. + 4.*y)*(-1. + 3.*x);
3341 divshape(2) = (-1. + 4.*x)*( 2. - 3.*y);
3342 divshape(3) = (-1. + 4.*x)*(-1. + 3.*y);
3343 divshape(4) = (-1. + 4.*y)*(-1. + 3.*x);
3344 divshape(5) = (-1. + 4.*y)*( 2. - 3.*x);
3345 divshape(6) = -(-3. + 4.*x)*(-1. + 3.*y);
3346 divshape(7) = -(-3. + 4.*x)*( 2. - 3.*y);
3347 divshape(8) = ( 4. - 8.*x)*( 2. - 3.*y);
3348 divshape(9) = ( 4. - 8.*x)*(-1. + 3.*y);
3349 divshape(10) = ( 4. - 8.*y)*( 2. - 3.*x);
3350 divshape(11) = ( 4. - 8.*y)*(-1. + 3.*x);
3353 const double RT1QuadFiniteElement::nk[12][2] =
3373 #ifdef MFEM_THREAD_SAFE
3379 for (k = 0; k < 12; k++)
3382 for (j = 0; j < 12; j++)
3385 if (j == k) { d -= 1.0; }
3386 if (fabs(d) > 1.0e-12)
3388 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3389 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3405 for (k = 0; k < 12; k++)
3408 ip.
x = vk[0]; ip.
y = vk[1];
3411 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3412 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3413 for (j = 0; j < 12; j++)
3414 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3426 #ifdef MFEM_THREAD_SAFE
3430 for (
int k = 0; k < 12; k++)
3438 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3439 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3443 const double RT2TriangleFiniteElement::M[15][15] =
3446 0, -5.3237900077244501311, 5.3237900077244501311, 16.647580015448900262,
3447 0, 24.442740046346700787, -16.647580015448900262, -12.,
3448 -19.118950038622250656, -47.237900077244501311, 0, -34.414110069520051180,
3449 12., 30.590320061795601049, 15.295160030897800524
3452 0, 1.5, -1.5, -15., 0, 2.625, 15., 15., -4.125, 30., 0, -14.625, -15.,
3456 0, -0.67620999227554986889, 0.67620999227554986889, 7.3524199845510997378,
3457 0, -3.4427400463467007866, -7.3524199845510997378, -12.,
3458 4.1189500386222506555, -0.76209992275549868892, 0, 7.4141100695200511800,
3459 12., -6.5903200617956010489, -3.2951600308978005244
3462 0, 0, 1.5, 0, 0, 1.5, -11.471370023173350393, 0, 2.4713700231733503933,
3463 -11.471370023173350393, 0, 2.4713700231733503933, 15.295160030897800524,
3464 0, -3.2951600308978005244
3467 0, 0, 4.875, 0, 0, 4.875, -16.875, 0, -16.875, -16.875, 0, -16.875, 10.5,
3471 0, 0, 1.5, 0, 0, 1.5, 2.4713700231733503933, 0, -11.471370023173350393,
3472 2.4713700231733503933, 0, -11.471370023173350393, -3.2951600308978005244,
3473 0, 15.295160030897800524
3476 -0.67620999227554986889, 0, -3.4427400463467007866, 0,
3477 7.3524199845510997378, 0.67620999227554986889, 7.4141100695200511800, 0,
3478 -0.76209992275549868892, 4.1189500386222506555, -12.,
3479 -7.3524199845510997378, -3.2951600308978005244, -6.5903200617956010489,
3483 1.5, 0, 2.625, 0, -15., -1.5, -14.625, 0, 30., -4.125, 15., 15., 10.5,
3487 -5.3237900077244501311, 0, 24.442740046346700787, 0, 16.647580015448900262,
3488 5.3237900077244501311, -34.414110069520051180, 0, -47.237900077244501311,
3489 -19.118950038622250656, -12., -16.647580015448900262, 15.295160030897800524,
3490 30.590320061795601049, 12.
3492 { 0, 0, 18., 0, 0, 6., -42., 0, -30., -26., 0, -14., 24., 32., 8.},
3493 { 0, 0, 6., 0, 0, 18., -14., 0, -26., -30., 0, -42., 8., 32., 24.},
3494 { 0, 0, -6., 0, 0, -4., 30., 0, 4., 22., 0, 4., -24., -16., 0},
3495 { 0, 0, -4., 0, 0, -8., 20., 0, 8., 36., 0, 8., -16., -32., 0},
3496 { 0, 0, -8., 0, 0, -4., 8., 0, 36., 8., 0, 20., 0, -32., -16.},
3497 { 0, 0, -4., 0, 0, -6., 4., 0, 22., 4., 0, 30., 0, -16., -24.}
3503 const double p = 0.11270166537925831148;
3540 double x = ip.
x, y = ip.
y;
3542 double Bx[15] = {1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y, 0., x*x*x,
3545 double By[15] = {0., 1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y,
3549 for (
int i = 0; i < 15; i++)
3551 double cx = 0.0, cy = 0.0;
3552 for (
int j = 0; j < 15; j++)
3554 cx += M[i][j] * Bx[j];
3555 cy += M[i][j] * By[j];
3565 double x = ip.
x, y = ip.
y;
3567 double DivB[15] = {0., 0., 1., 0., 0., 1., 2.*x, 0., y, x, 0., 2.*y,
3568 4.*x*x, 4.*x*y, 4.*y*y
3571 for (
int i = 0; i < 15; i++)
3574 for (
int j = 0; j < 15; j++)
3576 div += M[i][j] * DivB[j];
3582 const double RT2QuadFiniteElement::pt[4] = {0.,1./3.,2./3.,1.};
3584 const double RT2QuadFiniteElement::dpt[3] = {0.25,0.5,0.75};
3626 double x = ip.
x, y = ip.
y;
3628 double ax0 = pt[0] - x;
3629 double ax1 = pt[1] - x;
3630 double ax2 = pt[2] - x;
3631 double ax3 = pt[3] - x;
3633 double by0 = dpt[0] - y;
3634 double by1 = dpt[1] - y;
3635 double by2 = dpt[2] - y;
3637 double ay0 = pt[0] - y;
3638 double ay1 = pt[1] - y;
3639 double ay2 = pt[2] - y;
3640 double ay3 = pt[3] - y;
3642 double bx0 = dpt[0] - x;
3643 double bx1 = dpt[1] - x;
3644 double bx2 = dpt[2] - x;
3646 double A01 = pt[0] - pt[1];
3647 double A02 = pt[0] - pt[2];
3648 double A12 = pt[1] - pt[2];
3649 double A03 = pt[0] - pt[3];
3650 double A13 = pt[1] - pt[3];
3651 double A23 = pt[2] - pt[3];
3653 double B01 = dpt[0] - dpt[1];
3654 double B02 = dpt[0] - dpt[2];
3655 double B12 = dpt[1] - dpt[2];
3657 double tx0 = (bx1*bx2)/(B01*B02);
3658 double tx1 = -(bx0*bx2)/(B01*B12);
3659 double tx2 = (bx0*bx1)/(B02*B12);
3661 double ty0 = (by1*by2)/(B01*B02);
3662 double ty1 = -(by0*by2)/(B01*B12);
3663 double ty2 = (by0*by1)/(B02*B12);
3667 shape(0, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx0;
3669 shape(1, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx1;
3671 shape(2, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx2;
3673 shape(3, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty0;
3675 shape(4, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty1;
3677 shape(5, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty2;
3681 shape(6, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx2;
3683 shape(7, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx1;
3685 shape(8, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx0;
3687 shape(9, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty2;
3689 shape(10, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty1;
3691 shape(11, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty0;
3694 shape(12, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty0;
3696 shape(13, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty1;
3698 shape(14, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty2;
3701 shape(15, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty0;
3703 shape(16, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty1;
3705 shape(17, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty2;
3709 shape(18, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx0;
3711 shape(19, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx1;
3713 shape(20, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx2;
3716 shape(21, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx0;
3718 shape(22, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx1;
3720 shape(23, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx2;
3726 double x = ip.
x, y = ip.
y;
3728 double a01 = pt[0]*pt[1];
3729 double a02 = pt[0]*pt[2];
3730 double a12 = pt[1]*pt[2];
3731 double a03 = pt[0]*pt[3];
3732 double a13 = pt[1]*pt[3];
3733 double a23 = pt[2]*pt[3];
3735 double bx0 = dpt[0] - x;
3736 double bx1 = dpt[1] - x;
3737 double bx2 = dpt[2] - x;
3739 double by0 = dpt[0] - y;
3740 double by1 = dpt[1] - y;
3741 double by2 = dpt[2] - y;
3743 double A01 = pt[0] - pt[1];
3744 double A02 = pt[0] - pt[2];
3745 double A12 = pt[1] - pt[2];
3746 double A03 = pt[0] - pt[3];
3747 double A13 = pt[1] - pt[3];
3748 double A23 = pt[2] - pt[3];
3750 double A012 = pt[0] + pt[1] + pt[2];
3751 double A013 = pt[0] + pt[1] + pt[3];
3752 double A023 = pt[0] + pt[2] + pt[3];
3753 double A123 = pt[1] + pt[2] + pt[3];
3755 double B01 = dpt[0] - dpt[1];
3756 double B02 = dpt[0] - dpt[2];
3757 double B12 = dpt[1] - dpt[2];
3759 double tx0 = (bx1*bx2)/(B01*B02);
3760 double tx1 = -(bx0*bx2)/(B01*B12);
3761 double tx2 = (bx0*bx1)/(B02*B12);
3763 double ty0 = (by1*by2)/(B01*B02);
3764 double ty1 = -(by0*by2)/(B01*B12);
3765 double ty2 = (by0*by1)/(B02*B12);
3768 divshape(0) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx0;
3769 divshape(1) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx1;
3770 divshape(2) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx2;
3772 divshape(3) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty0;
3773 divshape(4) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty1;
3774 divshape(5) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty2;
3776 divshape(6) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx2;
3777 divshape(7) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx1;
3778 divshape(8) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx0;
3780 divshape(9) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty2;
3781 divshape(10) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty1;
3782 divshape(11) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty0;
3784 divshape(12) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty0;
3785 divshape(13) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty1;
3786 divshape(14) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty2;
3788 divshape(15) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty0;
3789 divshape(16) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty1;
3790 divshape(17) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty2;
3792 divshape(18) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx0;
3793 divshape(19) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx1;
3794 divshape(20) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx2;
3796 divshape(21) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx0;
3797 divshape(22) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx1;
3798 divshape(23) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx2;
3801 const double RT2QuadFiniteElement::nk[24][2] =
3804 {0,-1}, {0,-1}, {0,-1},
3806 {1, 0}, {1, 0}, {1, 0},
3808 {0, 1}, {0, 1}, {0, 1},
3810 {-1,0}, {-1,0}, {-1,0},
3812 {1, 0}, {1, 0}, {1, 0},
3814 {1, 0}, {1, 0}, {1, 0},
3816 {0, 1}, {0, 1}, {0, 1},
3818 {0, 1}, {0, 1}, {0, 1}
3825 #ifdef MFEM_THREAD_SAFE
3831 for (k = 0; k < 24; k++)
3834 for (j = 0; j < 24; j++)
3837 if (j == k) { d -= 1.0; }
3838 if (fabs(d) > 1.0e-12)
3840 mfem::err <<
"RT2QuadFiniteElement::GetLocalInterpolation (...)\n"
3841 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3857 for (k = 0; k < 24; k++)
3860 ip.
x = vk[0]; ip.
y = vk[1];
3863 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3864 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3865 for (j = 0; j < 24; j++)
3866 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3878 #ifdef MFEM_THREAD_SAFE
3882 for (
int k = 0; k < 24; k++)
3890 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3891 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3907 shape(0) = 2. - 3. * x;
3908 shape(1) = 3. * x - 1.;
3922 const double p = 0.11270166537925831148;
3932 const double p = 0.11270166537925831148;
3933 const double w = 1./((1-2*p)*(1-2*p));
3936 shape(0) = (2*x-1)*(x-1+p)*w;
3937 shape(1) = 4*(x-1+p)*(p-x)*w;
3938 shape(2) = (2*x-1)*(x-p)*w;
3944 const double p = 0.11270166537925831148;
3945 const double w = 1./((1-2*p)*(1-2*p));
3948 dshape(0,0) = (-3+4*x+2*p)*w;
3949 dshape(1,0) = (4-8*x)*w;
3950 dshape(2,0) = (-1+4*x-2*p)*w;
3961 for (i = 1; i < m; i++)
3967 #ifndef MFEM_THREAD_SAFE
3972 for (i = 1; i <= m; i++)
3974 rwk(i) = rwk(i-1) * ( (double)(m) / (double)(i) );
3976 for (i = 0; i < m/2+1; i++)
3978 rwk(m-i) = ( rwk(i) *= rwk(m-i) );
3980 for (i = m-1; i >= 0; i -= 2)
3989 double w, wk, x = ip.
x;
3992 #ifdef MFEM_THREAD_SAFE
3996 k = (int) floor ( m * x + 0.5 );
3997 k = k > m ? m : k < 0 ? 0 : k;
4000 for (i = 0; i <= m; i++)
4003 wk *= ( rxxk(i) = x - (double)(i) / m );
4005 w = wk * ( rxxk(k) = x - (double)(k) / m );
4009 shape(0) = w * rwk(0) / rxxk(0);
4013 shape(0) = wk * rwk(0);
4017 shape(1) = w * rwk(m) / rxxk(m);
4021 shape(1) = wk * rwk(k);
4023 for (i = 1; i < m; i++)
4026 shape(i+1) = w * rwk(i) / rxxk(i);
4030 shape(k+1) = wk * rwk(k);
4037 double s, srx, w, wk, x = ip.
x;
4040 #ifdef MFEM_THREAD_SAFE
4044 k = (int) floor ( m * x + 0.5 );
4045 k = k > m ? m : k < 0 ? 0 : k;
4048 for (i = 0; i <= m; i++)
4051 wk *= ( rxxk(i) = x - (double)(i) / m );
4053 w = wk * ( rxxk(k) = x - (double)(k) / m );
4055 for (i = 0; i <= m; i++)
4057 rxxk(i) = 1.0 / rxxk(i);
4060 for (i = 0; i <= m; i++)
4069 dshape(0,0) = (s - w * rxxk(0)) * rwk(0) * rxxk(0);
4073 dshape(0,0) = wk * srx * rwk(0);
4077 dshape(1,0) = (s - w * rxxk(m)) * rwk(m) * rxxk(m);
4081 dshape(1,0) = wk * srx * rwk(k);
4083 for (i = 1; i < m; i++)
4086 dshape(i+1,0) = (s - w * rxxk(i)) * rwk(i) * rxxk(i);
4090 dshape(k+1,0) = wk * srx * rwk(k);
4119 double L0, L1, L2, L3;
4121 L1 = ip.
x; L2 = ip.
y; L3 = ip.
z; L0 = 1.0 - L1 - L2 - L3;
4122 shape(0) = 1.0 - 3.0 * L0;
4123 shape(1) = 1.0 - 3.0 * L1;
4124 shape(2) = 1.0 - 3.0 * L2;
4125 shape(3) = 1.0 - 3.0 * L3;
4131 dshape(0,0) = 3.0; dshape(0,1) = 3.0; dshape(0,2) = 3.0;
4132 dshape(1,0) = -3.0; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
4133 dshape(2,0) = 0.0; dshape(2,1) = -3.0; dshape(2,2) = 0.0;
4134 dshape(3,0) = 0.0; dshape(3,1) = 0.0; dshape(3,2) = -3.0;
4155 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4176 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4190 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4191 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4192 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4193 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4194 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4195 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4196 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4197 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4199 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4200 I[ 9] = 1; J[ 9] = 2; K[ 9] = 0;
4201 I[10] = 2; J[10] = 1; K[10] = 0;
4202 I[11] = 0; J[11] = 2; K[11] = 0;
4203 I[12] = 2; J[12] = 0; K[12] = 1;
4204 I[13] = 1; J[13] = 2; K[13] = 1;
4205 I[14] = 2; J[14] = 1; K[14] = 1;
4206 I[15] = 0; J[15] = 2; K[15] = 1;
4207 I[16] = 0; J[16] = 0; K[16] = 2;
4208 I[17] = 1; J[17] = 0; K[17] = 2;
4209 I[18] = 1; J[18] = 1; K[18] = 2;
4210 I[19] = 0; J[19] = 1; K[19] = 2;
4212 I[20] = 2; J[20] = 2; K[20] = 0;
4213 I[21] = 2; J[21] = 0; K[21] = 2;
4214 I[22] = 1; J[22] = 2; K[22] = 2;
4215 I[23] = 2; J[23] = 1; K[23] = 2;
4216 I[24] = 0; J[24] = 2; K[24] = 2;
4217 I[25] = 2; J[25] = 2; K[25] = 1;
4219 I[26] = 2; J[26] = 2; K[26] = 2;
4221 else if (degree == 3)
4227 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4228 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4229 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4230 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4231 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4232 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4233 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4234 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4236 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4237 I[ 9] = 3; J[ 9] = 0; K[ 9] = 0;
4238 I[10] = 1; J[10] = 2; K[10] = 0;
4239 I[11] = 1; J[11] = 3; K[11] = 0;
4240 I[12] = 2; J[12] = 1; K[12] = 0;
4241 I[13] = 3; J[13] = 1; K[13] = 0;
4242 I[14] = 0; J[14] = 2; K[14] = 0;
4243 I[15] = 0; J[15] = 3; K[15] = 0;
4244 I[16] = 2; J[16] = 0; K[16] = 1;
4245 I[17] = 3; J[17] = 0; K[17] = 1;
4246 I[18] = 1; J[18] = 2; K[18] = 1;
4247 I[19] = 1; J[19] = 3; K[19] = 1;
4248 I[20] = 2; J[20] = 1; K[20] = 1;
4249 I[21] = 3; J[21] = 1; K[21] = 1;
4250 I[22] = 0; J[22] = 2; K[22] = 1;
4251 I[23] = 0; J[23] = 3; K[23] = 1;
4252 I[24] = 0; J[24] = 0; K[24] = 2;
4253 I[25] = 0; J[25] = 0; K[25] = 3;
4254 I[26] = 1; J[26] = 0; K[26] = 2;
4255 I[27] = 1; J[27] = 0; K[27] = 3;
4256 I[28] = 1; J[28] = 1; K[28] = 2;
4257 I[29] = 1; J[29] = 1; K[29] = 3;
4258 I[30] = 0; J[30] = 1; K[30] = 2;
4259 I[31] = 0; J[31] = 1; K[31] = 3;
4261 I[32] = 2; J[32] = 3; K[32] = 0;
4262 I[33] = 3; J[33] = 3; K[33] = 0;
4263 I[34] = 2; J[34] = 2; K[34] = 0;
4264 I[35] = 3; J[35] = 2; K[35] = 0;
4265 I[36] = 2; J[36] = 0; K[36] = 2;
4266 I[37] = 3; J[37] = 0; K[37] = 2;
4267 I[38] = 2; J[38] = 0; K[38] = 3;
4268 I[39] = 3; J[39] = 0; K[39] = 3;
4269 I[40] = 1; J[40] = 2; K[40] = 2;
4270 I[41] = 1; J[41] = 3; K[41] = 2;
4271 I[42] = 1; J[42] = 2; K[42] = 3;
4272 I[43] = 1; J[43] = 3; K[43] = 3;
4273 I[44] = 3; J[44] = 1; K[44] = 2;
4274 I[45] = 2; J[45] = 1; K[45] = 2;
4275 I[46] = 3; J[46] = 1; K[46] = 3;
4276 I[47] = 2; J[47] = 1; K[47] = 3;
4277 I[48] = 0; J[48] = 3; K[48] = 2;
4278 I[49] = 0; J[49] = 2; K[49] = 2;
4279 I[50] = 0; J[50] = 3; K[50] = 3;
4280 I[51] = 0; J[51] = 2; K[51] = 3;
4281 I[52] = 2; J[52] = 2; K[52] = 1;
4282 I[53] = 3; J[53] = 2; K[53] = 1;
4283 I[54] = 2; J[54] = 3; K[54] = 1;
4284 I[55] = 3; J[55] = 3; K[55] = 1;
4286 I[56] = 2; J[56] = 2; K[56] = 2;
4287 I[57] = 3; J[57] = 2; K[57] = 2;
4288 I[58] = 3; J[58] = 3; K[58] = 2;
4289 I[59] = 2; J[59] = 3; K[59] = 2;
4290 I[60] = 2; J[60] = 2; K[60] = 3;
4291 I[61] = 3; J[61] = 2; K[61] = 3;
4292 I[62] = 3; J[62] = 3; K[62] = 3;
4293 I[63] = 2; J[63] = 3; K[63] = 3;
4297 mfem_error (
"LagrangeHexFiniteElement::LagrangeHexFiniteElement");
4301 dof1d = fe1d ->
GetDof();
4303 #ifndef MFEM_THREAD_SAFE
4313 for (
int n = 0; n <
Dof; n++)
4328 #ifdef MFEM_THREAD_SAFE
4329 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4336 for (
int n = 0; n <
Dof; n++)
4338 shape(n) = shape1dx(I[n]) * shape1dy(J[n]) * shape1dz(K[n]);
4349 #ifdef MFEM_THREAD_SAFE
4350 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4351 DenseMatrix dshape1dx(dof1d,1), dshape1dy(dof1d,1), dshape1dz(dof1d,1);
4362 for (
int n = 0; n <
Dof; n++)
4364 dshape(n,0) = dshape1dx(I[n],0) * shape1dy(J[n]) * shape1dz(K[n]);
4365 dshape(n,1) = shape1dx(I[n]) * dshape1dy(J[n],0) * shape1dz(K[n]);
4366 dshape(n,2) = shape1dx(I[n]) * shape1dy(J[n]) * dshape1dz(K[n],0);
4395 shape(0) = 1.0 - 2.0 * x;
4402 shape(1) = 2.0 * x - 1.0;
4403 shape(2) = 2.0 - 2.0 * x;
4414 dshape(0,0) = - 2.0;
4422 dshape(2,0) = - 2.0;
4449 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4450 L1 = 2.0 * ( ip.
x );
4451 L2 = 2.0 * ( ip.
y );
4460 for (i = 0; i < 6; i++)
4467 shape(0) = L0 - 1.0;
4474 shape(1) = L1 - 1.0;
4481 shape(2) = L2 - 1.0;
4485 shape(3) = 1.0 - L2;
4486 shape(4) = 1.0 - L0;
4487 shape(5) = 1.0 - L1;
4497 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4498 L1 = 2.0 * ( ip.
x );
4499 L2 = 2.0 * ( ip.
y );
4501 double DL0[2], DL1[2], DL2[2];
4502 DL0[0] = -2.0; DL0[1] = -2.0;
4503 DL1[0] = 2.0; DL1[1] = 0.0;
4504 DL2[0] = 0.0; DL2[1] = 2.0;
4506 for (i = 0; i < 6; i++)
4507 for (j = 0; j < 2; j++)
4514 for (j = 0; j < 2; j++)
4516 dshape(0,j) = DL0[j];
4517 dshape(3,j) = DL1[j];
4518 dshape(5,j) = DL2[j];
4523 for (j = 0; j < 2; j++)
4525 dshape(3,j) = DL0[j];
4526 dshape(1,j) = DL1[j];
4527 dshape(4,j) = DL2[j];
4532 for (j = 0; j < 2; j++)
4534 dshape(5,j) = DL0[j];
4535 dshape(4,j) = DL1[j];
4536 dshape(2,j) = DL2[j];
4541 for (j = 0; j < 2; j++)
4543 dshape(3,j) = - DL2[j];
4544 dshape(4,j) = - DL0[j];
4545 dshape(5,j) = - DL1[j];
4590 double L0, L1, L2, L3, L4, L5;
4591 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
4592 L1 = 2.0 * ( ip.
x );
4593 L2 = 2.0 * ( ip.
y );
4594 L3 = 2.0 * ( ip.
z );
4595 L4 = 2.0 * ( ip.
x + ip.
y );
4596 L5 = 2.0 * ( ip.
y + ip.
z );
4609 for (i = 0; i < 10; i++)
4616 shape(0) = L0 - 1.0;
4624 shape(1) = L1 - 1.0;
4632 shape(2) = L2 - 1.0;
4640 shape(3) = L3 - 1.0;
4642 else if ((L4 <= 1.0) && (L5 <= 1.0))
4644 shape(4) = 1.0 - L5;
4646 shape(6) = 1.0 - L4;
4647 shape(8) = 1.0 - L0;
4649 else if ((L4 >= 1.0) && (L5 <= 1.0))
4651 shape(4) = 1.0 - L5;
4652 shape(5) = 1.0 - L1;
4653 shape(7) = L4 - 1.0;
4656 else if ((L4 <= 1.0) && (L5 >= 1.0))
4658 shape(5) = 1.0 - L3;
4659 shape(6) = 1.0 - L4;
4661 shape(9) = L5 - 1.0;
4663 else if ((L4 >= 1.0) && (L5 >= 1.0))
4666 shape(7) = L4 - 1.0;
4667 shape(8) = 1.0 - L2;
4668 shape(9) = L5 - 1.0;
4677 double L0, L1, L2, L3, L4, L5;
4678 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
4679 L1 = 2.0 * ( ip.
x );
4680 L2 = 2.0 * ( ip.
y );
4681 L3 = 2.0 * ( ip.
z );
4682 L4 = 2.0 * ( ip.
x + ip.
y );
4683 L5 = 2.0 * ( ip.
y + ip.
z );
4685 double DL0[3], DL1[3], DL2[3], DL3[3], DL4[3], DL5[3];
4686 DL0[0] = -2.0; DL0[1] = -2.0; DL0[2] = -2.0;
4687 DL1[0] = 2.0; DL1[1] = 0.0; DL1[2] = 0.0;
4688 DL2[0] = 0.0; DL2[1] = 2.0; DL2[2] = 0.0;
4689 DL3[0] = 0.0; DL3[1] = 0.0; DL3[2] = 2.0;
4690 DL4[0] = 2.0; DL4[1] = 2.0; DL4[2] = 0.0;
4691 DL5[0] = 0.0; DL5[1] = 2.0; DL5[2] = 2.0;
4693 for (i = 0; i < 10; i++)
4694 for (j = 0; j < 3; j++)
4701 for (j = 0; j < 3; j++)
4703 dshape(0,j) = DL0[j];
4704 dshape(4,j) = DL1[j];
4705 dshape(5,j) = DL2[j];
4706 dshape(6,j) = DL3[j];
4711 for (j = 0; j < 3; j++)
4713 dshape(4,j) = DL0[j];
4714 dshape(1,j) = DL1[j];
4715 dshape(7,j) = DL2[j];
4716 dshape(8,j) = DL3[j];
4721 for (j = 0; j < 3; j++)
4723 dshape(5,j) = DL0[j];
4724 dshape(7,j) = DL1[j];
4725 dshape(2,j) = DL2[j];
4726 dshape(9,j) = DL3[j];
4731 for (j = 0; j < 3; j++)
4733 dshape(6,j) = DL0[j];
4734 dshape(8,j) = DL1[j];
4735 dshape(9,j) = DL2[j];
4736 dshape(3,j) = DL3[j];
4739 else if ((L4 <= 1.0) && (L5 <= 1.0))
4741 for (j = 0; j < 3; j++)
4743 dshape(4,j) = - DL5[j];
4744 dshape(5,j) = DL2[j];
4745 dshape(6,j) = - DL4[j];
4746 dshape(8,j) = - DL0[j];
4749 else if ((L4 >= 1.0) && (L5 <= 1.0))
4751 for (j = 0; j < 3; j++)
4753 dshape(4,j) = - DL5[j];
4754 dshape(5,j) = - DL1[j];
4755 dshape(7,j) = DL4[j];
4756 dshape(8,j) = DL3[j];
4759 else if ((L4 <= 1.0) && (L5 >= 1.0))
4761 for (j = 0; j < 3; j++)
4763 dshape(5,j) = - DL3[j];
4764 dshape(6,j) = - DL4[j];
4765 dshape(8,j) = DL1[j];
4766 dshape(9,j) = DL5[j];
4769 else if ((L4 >= 1.0) && (L5 >= 1.0))
4771 for (j = 0; j < 3; j++)
4773 dshape(5,j) = DL0[j];
4774 dshape(7,j) = DL4[j];
4775 dshape(8,j) = - DL2[j];
4776 dshape(9,j) = DL5[j];
4809 double x = ip.
x, y = ip.
y;
4811 Lx = 2.0 * ( 1. - x );
4812 Ly = 2.0 * ( 1. - y );
4821 for (i = 0; i < 9; i++)
4826 if ((x <= 0.5) && (y <= 0.5))
4828 shape(0) = (Lx - 1.0) * (Ly - 1.0);
4829 shape(4) = (2.0 - Lx) * (Ly - 1.0);
4830 shape(8) = (2.0 - Lx) * (2.0 - Ly);
4831 shape(7) = (Lx - 1.0) * (2.0 - Ly);
4833 else if ((x >= 0.5) && (y <= 0.5))
4835 shape(4) = Lx * (Ly - 1.0);
4836 shape(1) = (1.0 - Lx) * (Ly - 1.0);
4837 shape(5) = (1.0 - Lx) * (2.0 - Ly);
4838 shape(8) = Lx * (2.0 - Ly);
4840 else if ((x >= 0.5) && (y >= 0.5))
4842 shape(8) = Lx * Ly ;
4843 shape(5) = (1.0 - Lx) * Ly ;
4844 shape(2) = (1.0 - Lx) * (1.0 - Ly);
4845 shape(6) = Lx * (1.0 - Ly);
4847 else if ((x <= 0.5) && (y >= 0.5))
4849 shape(7) = (Lx - 1.0) * Ly ;
4850 shape(8) = (2.0 - Lx) * Ly ;
4851 shape(6) = (2.0 - Lx) * (1.0 - Ly);
4852 shape(3) = (Lx - 1.0) * (1.0 - Ly);
4860 double x = ip.
x, y = ip.
y;
4862 Lx = 2.0 * ( 1. - x );
4863 Ly = 2.0 * ( 1. - y );
4865 for (i = 0; i < 9; i++)
4866 for (j = 0; j < 2; j++)
4871 if ((x <= 0.5) && (y <= 0.5))
4873 dshape(0,0) = 2.0 * (1.0 - Ly);
4874 dshape(0,1) = 2.0 * (1.0 - Lx);
4876 dshape(4,0) = 2.0 * (Ly - 1.0);
4877 dshape(4,1) = -2.0 * (2.0 - Lx);
4879 dshape(8,0) = 2.0 * (2.0 - Ly);
4880 dshape(8,1) = 2.0 * (2.0 - Lx);
4882 dshape(7,0) = -2.0 * (2.0 - Ly);
4883 dshape(7,0) = 2.0 * (Lx - 1.0);
4885 else if ((x >= 0.5) && (y <= 0.5))
4887 dshape(4,0) = -2.0 * (Ly - 1.0);
4888 dshape(4,1) = -2.0 * Lx;
4890 dshape(1,0) = 2.0 * (Ly - 1.0);
4891 dshape(1,1) = -2.0 * (1.0 - Lx);
4893 dshape(5,0) = 2.0 * (2.0 - Ly);
4894 dshape(5,1) = 2.0 * (1.0 - Lx);
4896 dshape(8,0) = -2.0 * (2.0 - Ly);
4897 dshape(8,1) = 2.0 * Lx;
4899 else if ((x >= 0.5) && (y >= 0.5))
4901 dshape(8,0) = -2.0 * Ly;
4902 dshape(8,1) = -2.0 * Lx;
4904 dshape(5,0) = 2.0 * Ly;
4905 dshape(5,1) = -2.0 * (1.0 - Lx);
4907 dshape(2,0) = 2.0 * (1.0 - Ly);
4908 dshape(2,1) = 2.0 * (1.0 - Lx);
4910 dshape(6,0) = -2.0 * (1.0 - Ly);
4911 dshape(6,1) = 2.0 * Lx;
4913 else if ((x <= 0.5) && (y >= 0.5))
4915 dshape(7,0) = -2.0 * Ly;
4916 dshape(7,1) = -2.0 * (Lx - 1.0);
4918 dshape(8,0) = 2.0 * Ly ;
4919 dshape(8,1) = -2.0 * (2.0 - Lx);
4921 dshape(6,0) = 2.0 * (1.0 - Ly);
4922 dshape(6,1) = 2.0 * (2.0 - Lx);
4924 dshape(3,0) = -2.0 * (1.0 - Ly);
4925 dshape(3,1) = 2.0 * (Lx - 1.0);
4936 I[ 0] = 0.0; J[ 0] = 0.0; K[ 0] = 0.0;
4937 I[ 1] = 1.0; J[ 1] = 0.0; K[ 1] = 0.0;
4938 I[ 2] = 1.0; J[ 2] = 1.0; K[ 2] = 0.0;
4939 I[ 3] = 0.0; J[ 3] = 1.0; K[ 3] = 0.0;
4940 I[ 4] = 0.0; J[ 4] = 0.0; K[ 4] = 1.0;
4941 I[ 5] = 1.0; J[ 5] = 0.0; K[ 5] = 1.0;
4942 I[ 6] = 1.0; J[ 6] = 1.0; K[ 6] = 1.0;
4943 I[ 7] = 0.0; J[ 7] = 1.0; K[ 7] = 1.0;
4945 I[ 8] = 0.5; J[ 8] = 0.0; K[ 8] = 0.0;
4946 I[ 9] = 1.0; J[ 9] = 0.5; K[ 9] = 0.0;
4947 I[10] = 0.5; J[10] = 1.0; K[10] = 0.0;
4948 I[11] = 0.0; J[11] = 0.5; K[11] = 0.0;
4949 I[12] = 0.5; J[12] = 0.0; K[12] = 1.0;
4950 I[13] = 1.0; J[13] = 0.5; K[13] = 1.0;
4951 I[14] = 0.5; J[14] = 1.0; K[14] = 1.0;
4952 I[15] = 0.0; J[15] = 0.5; K[15] = 1.0;
4953 I[16] = 0.0; J[16] = 0.0; K[16] = 0.5;
4954 I[17] = 1.0; J[17] = 0.0; K[17] = 0.5;
4955 I[18] = 1.0; J[18] = 1.0; K[18] = 0.5;
4956 I[19] = 0.0; J[19] = 1.0; K[19] = 0.5;
4958 I[20] = 0.5; J[20] = 0.5; K[20] = 0.0;
4959 I[21] = 0.5; J[21] = 0.0; K[21] = 0.5;
4960 I[22] = 1.0; J[22] = 0.5; K[22] = 0.5;
4961 I[23] = 0.5; J[23] = 1.0; K[23] = 0.5;
4962 I[24] = 0.0; J[24] = 0.5; K[24] = 0.5;
4963 I[25] = 0.5; J[25] = 0.5; K[25] = 1.0;
4965 I[26] = 0.5; J[26] = 0.5; K[26] = 0.5;
4967 for (
int n = 0; n < 27; n++)
4980 double x = ip.
x, y = ip.
y, z = ip.
z;
4982 for (i = 0; i < 27; i++)
4987 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5002 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5017 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5032 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5047 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5062 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5077 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5108 shape(N[0]) = Lx * Ly * Lz;
5109 shape(N[1]) = (1 - Lx) * Ly * Lz;
5110 shape(N[2]) = (1 - Lx) * (1 - Ly) * Lz;
5111 shape(N[3]) = Lx * (1 - Ly) * Lz;
5112 shape(N[4]) = Lx * Ly * (1 - Lz);
5113 shape(N[5]) = (1 - Lx) * Ly * (1 - Lz);
5114 shape(N[6]) = (1 - Lx) * (1 - Ly) * (1 - Lz);
5115 shape(N[7]) = Lx * (1 - Ly) * (1 - Lz);
5123 double x = ip.
x, y = ip.
y, z = ip.
z;
5125 for (i = 0; i < 27; i++)
5126 for (j = 0; j < 3; j++)
5131 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5146 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5161 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5176 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5191 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5206 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5221 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5252 dshape(N[0],0) = -2.0 * Ly * Lz ;
5253 dshape(N[0],1) = -2.0 * Lx * Lz ;
5254 dshape(N[0],2) = -2.0 * Lx * Ly ;
5256 dshape(N[1],0) = 2.0 * Ly * Lz ;
5257 dshape(N[1],1) = -2.0 * (1 - Lx) * Lz ;
5258 dshape(N[1],2) = -2.0 * (1 - Lx) * Ly ;
5260 dshape(N[2],0) = 2.0 * (1 - Ly) * Lz ;
5261 dshape(N[2],1) = 2.0 * (1 - Lx) * Lz ;
5262 dshape(N[2],2) = -2.0 * (1 - Lx) * (1 - Ly);
5264 dshape(N[3],0) = -2.0 * (1 - Ly) * Lz ;
5265 dshape(N[3],1) = 2.0 * Lx * Lz ;
5266 dshape(N[3],2) = -2.0 * Lx * (1 - Ly);
5268 dshape(N[4],0) = -2.0 * Ly * (1 - Lz);
5269 dshape(N[4],1) = -2.0 * Lx * (1 - Lz);
5270 dshape(N[4],2) = 2.0 * Lx * Ly ;
5272 dshape(N[5],0) = 2.0 * Ly * (1 - Lz);
5273 dshape(N[5],1) = -2.0 * (1 - Lx) * (1 - Lz);
5274 dshape(N[5],2) = 2.0 * (1 - Lx) * Ly ;
5276 dshape(N[6],0) = 2.0 * (1 - Ly) * (1 - Lz);
5277 dshape(N[6],1) = 2.0 * (1 - Lx) * (1 - Lz);
5278 dshape(N[6],2) = 2.0 * (1 - Lx) * (1 - Ly);
5280 dshape(N[7],0) = -2.0 * (1 - Ly) * (1 - Lz);
5281 dshape(N[7],1) = 2.0 * Lx * (1 - Lz);
5282 dshape(N[7],2) = 2.0 * Lx * (1 - Ly);
5342 double x = ip.
x, y = ip.
y, z = ip.
z;
5344 shape(0,0) = (1. - y) * (1. - z);
5348 shape(2,0) = y * (1. - z);
5352 shape(4,0) = z * (1. - y);
5361 shape(1,1) = x * (1. - z);
5365 shape(3,1) = (1. - x) * (1. - z);
5373 shape(7,1) = (1. - x) * z;
5378 shape(8,2) = (1. - x) * (1. - y);
5382 shape(9,2) = x * (1. - y);
5386 shape(10,2) = x * y;
5390 shape(11,2) = y * (1. - x);
5398 double x = ip.
x, y = ip.
y, z = ip.
z;
5400 curl_shape(0,0) = 0.;
5401 curl_shape(0,1) = y - 1.;
5402 curl_shape(0,2) = 1. - z;
5404 curl_shape(2,0) = 0.;
5405 curl_shape(2,1) = -y;
5406 curl_shape(2,2) = z - 1.;
5408 curl_shape(4,0) = 0;
5409 curl_shape(4,1) = 1. - y;
5410 curl_shape(4,2) = z;
5412 curl_shape(6,0) = 0.;
5413 curl_shape(6,1) = y;
5414 curl_shape(6,2) = -z;
5416 curl_shape(1,0) = x;
5417 curl_shape(1,1) = 0.;
5418 curl_shape(1,2) = 1. - z;
5420 curl_shape(3,0) = 1. - x;
5421 curl_shape(3,1) = 0.;
5422 curl_shape(3,2) = z - 1.;
5424 curl_shape(5,0) = -x;
5425 curl_shape(5,1) = 0.;
5426 curl_shape(5,2) = z;
5428 curl_shape(7,0) = x - 1.;
5429 curl_shape(7,1) = 0.;
5430 curl_shape(7,2) = -z;
5432 curl_shape(8,0) = x - 1.;
5433 curl_shape(8,1) = 1. - y;
5434 curl_shape(8,2) = 0.;
5436 curl_shape(9,0) = -x;
5437 curl_shape(9,1) = y - 1.;
5438 curl_shape(9,2) = 0;
5440 curl_shape(10,0) = x;
5441 curl_shape(10,1) = -y;
5442 curl_shape(10,2) = 0.;
5444 curl_shape(11,0) = 1. - x;
5445 curl_shape(11,1) = y;
5446 curl_shape(11,2) = 0.;
5449 const double Nedelec1HexFiniteElement::tk[12][3] =
5451 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5452 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5453 {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}
5460 #ifdef MFEM_THREAD_SAFE
5465 for (k = 0; k < 12; k++)
5468 for (j = 0; j < 12; j++)
5470 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
5472 if (j == k) { d -= 1.0; }
5473 if (fabs(d) > 1.0e-12)
5475 mfem::err <<
"Nedelec1HexFiniteElement::GetLocalInterpolation (...)\n"
5476 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
5484 ip.
x = ip.
y = ip.
z = 0.0;
5491 for (k = 0; k < 12; k++)
5494 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
5497 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
5498 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
5499 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
5500 for (j = 0; j < 12; j++)
5501 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
5502 vshape(j,2)*vk[2])) < 1.0e-12)
5516 for (
int k = 0; k < 12; k++)
5524 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
5525 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
5526 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
5563 double x = ip.
x, y = ip.
y, z = ip.
z;
5565 shape(0,0) = 1. - y - z;
5570 shape(1,1) = 1. - x - z;
5575 shape(2,2) = 1. - x - y;
5594 curl_shape(0,0) = 0.;
5595 curl_shape(0,1) = -2.;
5596 curl_shape(0,2) = 2.;
5598 curl_shape(1,0) = 2.;
5599 curl_shape(1,1) = 0.;
5600 curl_shape(1,2) = -2.;
5602 curl_shape(2,0) = -2.;
5603 curl_shape(2,1) = 2.;
5604 curl_shape(2,2) = 0.;
5606 curl_shape(3,0) = 0.;
5607 curl_shape(3,1) = 0.;
5608 curl_shape(3,2) = 2.;
5610 curl_shape(4,0) = 0.;
5611 curl_shape(4,1) = -2.;
5612 curl_shape(4,2) = 0.;
5614 curl_shape(5,0) = 2.;
5615 curl_shape(5,1) = 0.;
5616 curl_shape(5,2) = 0.;
5619 const double Nedelec1TetFiniteElement::tk[6][3] =
5620 {{1,0,0}, {0,1,0}, {0,0,1}, {-1,1,0}, {-1,0,1}, {0,-1,1}};
5626 #ifdef MFEM_THREAD_SAFE
5631 for (k = 0; k < 6; k++)
5634 for (j = 0; j < 6; j++)
5636 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
5638 if (j == k) { d -= 1.0; }
5639 if (fabs(d) > 1.0e-12)
5641 mfem::err <<
"Nedelec1TetFiniteElement::GetLocalInterpolation (...)\n"
5642 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
5650 ip.
x = ip.
y = ip.
z = 0.0;
5657 for (k = 0; k < 6; k++)
5660 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
5663 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
5664 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
5665 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
5666 for (j = 0; j < 6; j++)
5667 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
5668 vshape(j,2)*vk[2])) < 1.0e-12)
5682 for (
int k = 0; k < 6; k++)
5690 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
5691 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
5692 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
5729 double x = ip.
x, y = ip.
y, z = ip.
z;
5733 shape(0,2) = z - 1.;
5736 shape(1,1) = y - 1.;
5747 shape(4,0) = x - 1.;
5767 const double RT0HexFiniteElement::nk[6][3] =
5768 {{0,0,-1}, {0,-1,0}, {1,0,0}, {0,1,0}, {-1,0,0}, {0,0,1}};
5774 #ifdef MFEM_THREAD_SAFE
5780 for (k = 0; k < 6; k++)
5783 for (j = 0; j < 6; j++)
5785 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
5787 if (j == k) { d -= 1.0; }
5788 if (fabs(d) > 1.0e-12)
5790 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
5791 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
5799 ip.
x = ip.
y = ip.
z = 0.0;
5807 for (k = 0; k < 6; k++)
5810 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
5813 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
5814 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
5815 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
5816 for (j = 0; j < 6; j++)
5817 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
5818 vshape(j,2)*vk[2])) < 1.0e-12)
5831 #ifdef MFEM_THREAD_SAFE
5835 for (
int k = 0; k < 6; k++)
5844 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
5845 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
5846 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
5975 double x = ip.
x, y = ip.
y, z = ip.
z;
5979 shape(2,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
5982 shape(3,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
5985 shape(0,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
5988 shape(1,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
5991 shape(4,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
5994 shape(5,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
5997 shape(6,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6000 shape(7,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6003 shape(8,0) = (-x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6006 shape(9,0) = (-x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6009 shape(10,0) = (-x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6012 shape(11,0) = (-x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6017 shape(13,1) = (-y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6020 shape(12,1) = (-y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6023 shape(15,1) = (-y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6026 shape(14,1) = (-y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6029 shape(17,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6032 shape(16,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6035 shape(19,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6038 shape(18,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6044 shape(20,2) = (-z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6047 shape(21,2) = (-z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6050 shape(22,2) = (-z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6053 shape(23,2) = (-z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6055 shape(24,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6058 shape(25,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6061 shape(26,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6064 shape(27,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6069 shape(28,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6072 shape(29,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6075 shape(30,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6078 shape(31,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6083 shape(32,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6086 shape(33,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6089 shape(34,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6092 shape(35,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6098 double x = ip.
x, y = ip.
y, z = ip.
z;
6100 divshape(2) = -(-3. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6101 divshape(3) = -(-3. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6102 divshape(0) = -(-3. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6103 divshape(1) = -(-3. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6105 divshape(4) = -(-3. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6106 divshape(5) = -(-3. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6107 divshape(6) = -(-3. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6108 divshape(7) = -(-3. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6110 divshape(8) = (-1. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6111 divshape(9) = (-1. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6112 divshape(10) = (-1. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6113 divshape(11) = (-1. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6115 divshape(13) = (-1. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6116 divshape(12) = (-1. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6117 divshape(15) = (-1. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6118 divshape(14) = (-1. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6120 divshape(17) = -(-3. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6121 divshape(16) = -(-3. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6122 divshape(19) = -(-3. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6123 divshape(18) = -(-3. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6125 divshape(20) = (-1. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6126 divshape(21) = (-1. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6127 divshape(22) = (-1. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6128 divshape(23) = (-1. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6130 divshape(24) = ( 4. - 8.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6131 divshape(25) = ( 4. - 8.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6132 divshape(26) = ( 4. - 8.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6133 divshape(27) = ( 4. - 8.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6135 divshape(28) = ( 4. - 8.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6136 divshape(29) = ( 4. - 8.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6137 divshape(30) = ( 4. - 8.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6138 divshape(31) = ( 4. - 8.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6140 divshape(32) = ( 4. - 8.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6141 divshape(33) = ( 4. - 8.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6142 divshape(34) = ( 4. - 8.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6143 divshape(35) = ( 4. - 8.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6146 const double RT1HexFiniteElement::nk[36][3] =
6148 {0, 0,-1}, {0, 0,-1}, {0, 0,-1}, {0, 0,-1},
6149 {0,-1, 0}, {0,-1, 0}, {0,-1, 0}, {0,-1, 0},
6150 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6151 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6152 {-1,0, 0}, {-1,0, 0}, {-1,0, 0}, {-1,0, 0},
6153 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
6154 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6155 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6156 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}
6163 #ifdef MFEM_THREAD_SAFE
6169 for (k = 0; k < 36; k++)
6172 for (j = 0; j < 36; j++)
6174 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6176 if (j == k) { d -= 1.0; }
6177 if (fabs(d) > 1.0e-12)
6179 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6180 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6188 ip.
x = ip.
y = ip.
z = 0.0;
6196 for (k = 0; k < 36; k++)
6199 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6202 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6203 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6204 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6205 for (j = 0; j < 36; j++)
6206 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6207 vshape(j,2)*vk[2])) < 1.0e-12)
6220 #ifdef MFEM_THREAD_SAFE
6224 for (
int k = 0; k < 36; k++)
6233 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6234 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6235 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6263 double x2 = 2.0*ip.
x, y2 = 2.0*ip.
y, z2 = 2.0*ip.
z;
6269 shape(1,0) = x2 - 2.0;
6274 shape(2,1) = y2 - 2.0;
6279 shape(3,2) = z2 - 2.0;
6291 const double RT0TetFiniteElement::nk[4][3] =
6292 {{.5,.5,.5}, {-.5,0,0}, {0,-.5,0}, {0,0,-.5}};
6298 #ifdef MFEM_THREAD_SAFE
6304 for (k = 0; k < 4; k++)
6307 for (j = 0; j < 4; j++)
6309 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6311 if (j == k) { d -= 1.0; }
6312 if (fabs(d) > 1.0e-12)
6314 mfem::err <<
"RT0TetFiniteElement::GetLocalInterpolation (...)\n"
6315 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6323 ip.
x = ip.
y = ip.
z = 0.0;
6331 for (k = 0; k < 4; k++)
6334 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6337 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6338 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6339 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6340 for (j = 0; j < 4; j++)
6341 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6342 vshape(j,2)*vk[2])) < 1.0e-12)
6355 #ifdef MFEM_THREAD_SAFE
6359 for (
int k = 0; k < 4; k++)
6368 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6369 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6370 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6405 double x = 2. * ip.
x - 1.;
6406 double y = 2. * ip.
y - 1.;
6407 double z = 2. * ip.
z - 1.;
6408 double f5 = x * x - y * y;
6409 double f6 = y * y - z * z;
6411 shape(0) = (1./6.) * (1. - 3. * z - f5 - 2. * f6);
6412 shape(1) = (1./6.) * (1. - 3. * y - f5 + f6);
6413 shape(2) = (1./6.) * (1. + 3. * x + 2. * f5 + f6);
6414 shape(3) = (1./6.) * (1. + 3. * y - f5 + f6);
6415 shape(4) = (1./6.) * (1. - 3. * x + 2. * f5 + f6);
6416 shape(5) = (1./6.) * (1. + 3. * z - f5 - 2. * f6);
6422 const double a = 2./3.;
6424 double xt = a * (1. - 2. * ip.
x);
6425 double yt = a * (1. - 2. * ip.
y);
6426 double zt = a * (1. - 2. * ip.
z);
6430 dshape(0,2) = -1. - 2. * zt;
6433 dshape(1,1) = -1. - 2. * yt;
6436 dshape(2,0) = 1. - 2. * xt;
6441 dshape(3,1) = 1. - 2. * yt;
6444 dshape(4,0) = -1. - 2. * xt;
6450 dshape(5,2) = 1. - 2. * zt;
6464 for (
int i = 0; i <= p; i++)
6478 for (
int i = 0; i <= p; i++)
6480 for (
int j = 0; j < i; j++)
6482 double xij = x(i) - x(j);
6487 for (
int i = 0; i <= p; i++)
6494 for (
int i = 0; i < p; i++)
6498 mfem_error(
"Poly_1D::Basis::Basis : nodes are not increasing!");
6524 int i, k, p = x.Size() - 1;
6534 for (k = 0; k < p; k++)
6536 if (y >= (x(k) + x(k+1))/2)
6542 for (i = k+1; i <= p; i++)
6549 l = lk * (y - x(k));
6551 for (i = 0; i < k; i++)
6553 u(i) = l * w(i) / (y - x(i));
6556 for (i++; i <= p; i++)
6558 u(i) = l * w(i) / (y - x(i));
6583 int i, k, p = x.Size() - 1;
6584 double l, lp, lk, sk, si;
6594 for (k = 0; k < p; k++)
6596 if (y >= (x(k) + x(k+1))/2)
6602 for (i = k+1; i <= p; i++)
6609 l = lk * (y - x(k));
6612 for (i = 0; i < k; i++)
6614 si = 1.0/(y - x(i));
6616 u(i) = l * si * w(i);
6619 for (i++; i <= p; i++)
6621 si = 1.0/(y - x(i));
6623 u(i) = l * si * w(i);
6627 for (i = 0; i < k; i++)
6629 d(i) = (lp * w(i) - u(i))/(y - x(i));
6632 for (i++; i <= p; i++)
6634 d(i) = (lp * w(i) - u(i))/(y - x(i));
6651 for (
int i = 0; i <= p; i++)
6653 binom(i,0) = binom(i,i) = 1;
6654 for (
int j = 1; j < i; j++)
6656 binom(i,j) = binom(i-1,j) + binom(i-1,j-1);
6665 for (
int i = 0; i <= p; i++)
6668 double s = sin(M_PI_2*(i + 0.5)/(p + 1));
6673 void Poly_1D::CalcMono(
const int p,
const double x,
double *u)
6677 for (
int n = 1; n <= p; n++)
6683 void Poly_1D::CalcMono(
const int p,
const double x,
double *u,
double *d)
6688 for (
int n = 1; n <= p; n++)
6705 const int *b =
Binom(p);
6708 for (i = 1; i < p; i++)
6715 for (i--; i > 0; i--)
6725 double *u,
double *d)
6735 const int *b =
Binom(p);
6736 const double xpy = x + y, ptx = p*x;
6739 for (i = 1; i < p; i++)
6741 d[i] = b[i]*z*(i*xpy - ptx);
6748 for (i--; i > 0; i--)
6769 const int *b =
Binom(p);
6770 const double xpy = x + y, ptx = p*x;
6773 for (i = 1; i < p; i++)
6775 d[i] = b[i]*z*(i*xpy - ptx);
6780 for (i--; i > 0; i--)
6789 void Poly_1D::CalcLegendre(
const int p,
const double x,
double *u)
6795 if (p == 0) {
return; }
6796 u[1] = z = 2.*x - 1.;
6797 for (
int n = 1; n < p; n++)
6799 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
6803 void Poly_1D::CalcLegendre(
const int p,
const double x,
double *u,
double *d)
6812 if (p == 0) {
return; }
6813 u[1] = z = 2.*x - 1.;
6815 for (
int n = 1; n < p; n++)
6817 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
6818 d[n+1] = (4*n + 2)*u[n] + d[n-1];
6822 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u)
6829 if (p == 0) {
return; }
6830 u[1] = z = 2.*x - 1.;
6831 for (
int n = 1; n < p; n++)
6833 u[n+1] = 2*z*u[n] - u[n-1];
6837 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d)
6850 if (p == 0) {
return; }
6851 u[1] = z = 2.*x - 1.;
6853 for (
int n = 1; n < p; n++)
6855 u[n+1] = 2*z*u[n] - u[n-1];
6856 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
6860 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d,
6876 if (p == 0) {
return; }
6877 u[1] = z = 2.*x - 1.;
6880 for (
int n = 1; n < p; n++)
6882 u[n+1] = 2*z*u[n] - u[n-1];
6883 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
6884 dd[n+1] = (n + 1)*(2.*(n + 1)*d[n] + z*dd[n])/n;
6895 if (points_container.find(btype) == points_container.end())
6900 if (pts.
Size() <= p)
6906 pts[p] =
new double[p + 1];
6916 if ( bases_container.find(btype) == bases_container.end() )
6922 if (bases.
Size() <= p)
6926 if (bases[p] == NULL)
6936 for (PointsMap::iterator it = points_container.begin();
6937 it != points_container.end() ; ++it)
6940 for (
int i = 0 ; i < pts.
Size() ; ++i )
6947 for (BasisMap::iterator it = bases_container.begin();
6948 it != bases_container.end() ; ++it)
6951 for (
int i = 0 ; i < bases.
Size() ; ++i )
6977 for (
int i = 1; i < p; i++)
6985 const int p1 = p + 1;
6996 for (
int i = 1; i < p; i++)
7000 for (
int i = 1; i < p; i++)
7004 for (
int i = 1; i < p; i++)
7008 for (
int i = 1; i < p; i++)
7014 for (
int j = 1; j < p; j++)
7016 for (
int i = 1; i < p; i++)
7025 const int p1 = p + 1;
7029 dof_map[0 + (0 + 0*p1)*p1] = 0;
7030 dof_map[p + (0 + 0*p1)*p1] = 1;
7031 dof_map[p + (p + 0*p1)*p1] = 2;
7032 dof_map[0 + (p + 0*p1)*p1] = 3;
7033 dof_map[0 + (0 + p*p1)*p1] = 4;
7034 dof_map[p + (0 + p*p1)*p1] = 5;
7035 dof_map[p + (p + p*p1)*p1] = 6;
7036 dof_map[0 + (p + p*p1)*p1] = 7;
7040 for (
int i = 1; i < p; i++)
7042 dof_map[i + (0 + 0*p1)*p1] = o++;
7044 for (
int i = 1; i < p; i++)
7046 dof_map[p + (i + 0*p1)*p1] = o++;
7048 for (
int i = 1; i < p; i++)
7050 dof_map[i + (p + 0*p1)*p1] = o++;
7052 for (
int i = 1; i < p; i++)
7054 dof_map[0 + (i + 0*p1)*p1] = o++;
7056 for (
int i = 1; i < p; i++)
7058 dof_map[i + (0 + p*p1)*p1] = o++;
7060 for (
int i = 1; i < p; i++)
7062 dof_map[p + (i + p*p1)*p1] = o++;
7064 for (
int i = 1; i < p; i++)
7066 dof_map[i + (p + p*p1)*p1] = o++;
7068 for (
int i = 1; i < p; i++)
7070 dof_map[0 + (i + p*p1)*p1] = o++;
7072 for (
int i = 1; i < p; i++)
7074 dof_map[0 + (0 + i*p1)*p1] = o++;
7076 for (
int i = 1; i < p; i++)
7078 dof_map[p + (0 + i*p1)*p1] = o++;
7080 for (
int i = 1; i < p; i++)
7082 dof_map[p + (p + i*p1)*p1] = o++;
7084 for (
int i = 1; i < p; i++)
7086 dof_map[0 + (p + i*p1)*p1] = o++;
7090 for (
int j = 1; j < p; j++)
7092 for (
int i = 1; i < p; i++)
7094 dof_map[i + ((p-j) + 0*p1)*p1] = o++;
7097 for (
int j = 1; j < p; j++)
7099 for (
int i = 1; i < p; i++)
7101 dof_map[i + (0 + j*p1)*p1] = o++;
7104 for (
int j = 1; j < p; j++)
7106 for (
int i = 1; i < p; i++)
7108 dof_map[p + (i + j*p1)*p1] = o++;
7111 for (
int j = 1; j < p; j++)
7113 for (
int i = 1; i < p; i++)
7115 dof_map[(p-i) + (p + j*p1)*p1] = o++;
7118 for (
int j = 1; j < p; j++)
7120 for (
int i = 1; i < p; i++)
7122 dof_map[0 + ((p-i) + j*p1)*p1] = o++;
7125 for (
int j = 1; j < p; j++)
7127 for (
int i = 1; i < p; i++)
7129 dof_map[i + (j + p*p1)*p1] = o++;
7134 for (
int k = 1; k < p; k++)
7136 for (
int j = 1; j < p; j++)
7138 for (
int i = 1; i < p; i++)
7140 dof_map[i + (j + k*p1)*p1] = o++;
7147 MFEM_ABORT(
"invalid dimension: " << dims);
7158 MFEM_ABORT(
"invalid DofMapType: " << dmtype);
7173 const int dims,
const int p,
const DofMapType dmtype)
7175 Pow(p + 1, dims), p,
7185 #ifndef MFEM_THREAD_SAFE
7192 for (
int i = 1; i < p; i++)
7201 const int p =
Order;
7203 #ifdef MFEM_THREAD_SAFE
7209 shape(0) = shape_x(0);
7210 shape(1) = shape_x(p);
7211 for (
int i = 1; i < p; i++)
7213 shape(i+1) = shape_x(i);
7220 const int p =
Order;
7222 #ifdef MFEM_THREAD_SAFE
7223 Vector shape_x(p+1), dshape_x(p+1);
7228 dshape(0,0) = dshape_x(0);
7229 dshape(1,0) = dshape_x(p);
7230 for (
int i = 1; i < p; i++)
7232 dshape(i+1,0) = dshape_x(i);
7238 const int p =
Order;
7246 for (
int i = 1; i < p; i++)
7255 for (
int i = 1; i < p; i++)
7269 #ifndef MFEM_THREAD_SAFE
7270 const int p1 = p + 1;
7279 for (
int j = 0; j <= p; j++)
7281 for (
int i = 0; i <= p; i++)
7291 const int p =
Order;
7293 #ifdef MFEM_THREAD_SAFE
7294 Vector shape_x(p+1), shape_y(p+1);
7300 for (
int o = 0, j = 0; j <= p; j++)
7301 for (
int i = 0; i <= p; i++)
7303 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
7310 const int p =
Order;
7312 #ifdef MFEM_THREAD_SAFE
7313 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
7319 for (
int o = 0, j = 0; j <= p; j++)
7321 for (
int i = 0; i <= p; i++)
7323 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
7324 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
7331 const int p =
Order;
7334 #ifdef MFEM_THREAD_SAFE
7335 Vector shape_x(p+1), shape_y(p+1);
7338 for (
int i = 0; i <= p; i++)
7347 for (
int o = 0, j = 0; j <= p; j++)
7348 for (
int i = 0; i <= p; i++)
7350 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j);
7354 for (
int o = 0, j = 0; j <= p; j++)
7355 for (
int i = 0; i <= p; i++)
7357 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j);
7361 for (
int o = 0, j = 0; j <= p; j++)
7362 for (
int i = 0; i <= p; i++)
7364 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j);
7368 for (
int o = 0, j = 0; j <= p; j++)
7369 for (
int i = 0; i <= p; i++)
7371 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j);
7383 #ifndef MFEM_THREAD_SAFE
7384 const int p1 = p + 1;
7395 for (
int k = 0; k <= p; k++)
7396 for (
int j = 0; j <= p; j++)
7397 for (
int i = 0; i <= p; i++)
7406 const int p =
Order;
7408 #ifdef MFEM_THREAD_SAFE
7409 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7416 for (
int o = 0, k = 0; k <= p; k++)
7417 for (
int j = 0; j <= p; j++)
7418 for (
int i = 0; i <= p; i++)
7420 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
7427 const int p =
Order;
7429 #ifdef MFEM_THREAD_SAFE
7430 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7431 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
7438 for (
int o = 0, k = 0; k <= p; k++)
7439 for (
int j = 0; j <= p; j++)
7440 for (
int i = 0; i <= p; i++)
7442 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
7443 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
7444 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
7450 const int p =
Order;
7453 #ifdef MFEM_THREAD_SAFE
7454 Vector shape_x(p+1), shape_y(p+1);
7457 for (
int i = 0; i <= p; i++)
7466 for (
int o = 0, k = 0; k <= p; k++)
7467 for (
int j = 0; j <= p; j++)
7468 for (
int i = 0; i <= p; i++)
7470 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_x(k);
7474 for (
int o = 0, k = 0; k <= p; k++)
7475 for (
int j = 0; j <= p; j++)
7476 for (
int i = 0; i <= p; i++)
7478 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_x(k);
7482 for (
int o = 0, k = 0; k <= p; k++)
7483 for (
int j = 0; j <= p; j++)
7484 for (
int i = 0; i <= p; i++)
7486 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_x(k);
7490 for (
int o = 0, k = 0; k <= p; k++)
7491 for (
int j = 0; j <= p; j++)
7492 for (
int i = 0; i <= p; i++)
7494 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_x(k);
7498 for (
int o = 0, k = 0; k <= p; k++)
7499 for (
int j = 0; j <= p; j++)
7500 for (
int i = 0; i <= p; i++)
7502 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_y(k);
7506 for (
int o = 0, k = 0; k <= p; k++)
7507 for (
int j = 0; j <= p; j++)
7508 for (
int i = 0; i <= p; i++)
7510 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_y(k);
7514 for (
int o = 0, k = 0; k <= p; k++)
7515 for (
int j = 0; j <= p; j++)
7516 for (
int i = 0; i <= p; i++)
7518 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_y(k);
7522 for (
int o = 0, k = 0; k <= p; k++)
7523 for (
int j = 0; j <= p; j++)
7524 for (
int i = 0; i <= p; i++)
7526 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_y(k);
7536 #ifndef MFEM_THREAD_SAFE
7545 for (
int i = 1; i < p; i++)
7554 const int p =
Order;
7556 #ifdef MFEM_THREAD_SAFE
7563 shape(0) = shape_x(0);
7564 shape(1) = shape_x(p);
7565 for (
int i = 1; i < p; i++)
7567 shape(i+1) = shape_x(i);
7574 const int p =
Order;
7576 #ifdef MFEM_THREAD_SAFE
7577 Vector shape_x(p+1), dshape_x(p+1);
7583 dshape(0,0) = dshape_x(0);
7584 dshape(1,0) = dshape_x(p);
7585 for (
int i = 1; i < p; i++)
7587 dshape(i+1,0) = dshape_x(i);
7601 #ifndef MFEM_THREAD_SAFE
7602 const int p1 = p + 1;
7611 for (
int j = 0; j <= p; j++)
7612 for (
int i = 0; i <= p; i++)
7621 const int p =
Order;
7623 #ifdef MFEM_THREAD_SAFE
7624 Vector shape_x(p+1), shape_y(p+1);
7631 for (
int o = 0, j = 0; j <= p; j++)
7632 for (
int i = 0; i <= p; i++)
7634 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
7641 const int p =
Order;
7643 #ifdef MFEM_THREAD_SAFE
7644 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
7651 for (
int o = 0, j = 0; j <= p; j++)
7652 for (
int i = 0; i <= p; i++)
7654 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
7655 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
7669 #ifndef MFEM_THREAD_SAFE
7670 const int p1 = p + 1;
7681 for (
int k = 0; k <= p; k++)
7682 for (
int j = 0; j <= p; j++)
7683 for (
int i = 0; i <= p; i++)
7691 const int p =
Order;
7693 #ifdef MFEM_THREAD_SAFE
7694 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7701 for (
int o = 0, k = 0; k <= p; k++)
7702 for (
int j = 0; j <= p; j++)
7703 for (
int i = 0; i <= p; i++)
7705 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
7712 const int p =
Order;
7714 #ifdef MFEM_THREAD_SAFE
7715 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7716 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
7723 for (
int o = 0, k = 0; k <= p; k++)
7724 for (
int 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)* shape_z(k);
7728 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
7729 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
7746 #ifndef MFEM_THREAD_SAFE
7760 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
7770 for (
int i = 1; i < p; i++)
7774 for (
int i = 1; i < p; i++)
7778 for (
int i = 1; i < p; i++)
7784 for (
int j = 1; j < p; j++)
7785 for (
int i = 1; i + j < p; i++)
7787 const double w = cp[i] + cp[j] + cp[p-i-j];
7792 for (
int k = 0; k <
Dof; k++)
7800 for (
int j = 0; j <= p; j++)
7801 for (
int i = 0; i + j <= p; i++)
7803 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
7814 const int p =
Order;
7816 #ifdef MFEM_THREAD_SAFE
7817 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
Dof);
7824 for (
int o = 0, j = 0; j <= p; j++)
7825 for (
int i = 0; i + j <= p; i++)
7827 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
7836 const int p =
Order;
7838 #ifdef MFEM_THREAD_SAFE
7839 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
7840 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
7848 for (
int o = 0, j = 0; j <= p; j++)
7849 for (
int i = 0; i + j <= p; i++)
7852 du(o,0) = ((dshape_x(i)* shape_l(k)) -
7853 ( shape_x(i)*dshape_l(k)))*shape_y(j);
7854 du(o,1) = ((dshape_y(j)* shape_l(k)) -
7855 ( shape_y(j)*dshape_l(k)))*shape_x(i);
7859 Ti.
Mult(du, dshape);
7865 const int p =
Order;
7866 #ifdef MFEM_THREAD_SAFE
7867 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
7868 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
7869 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_l(p + 1);
7877 for (
int o = 0, j = 0; j <= p; j++)
7878 for (
int i = 0; i + j <= p; i++)
7882 ddu(o,0) = ((ddshape_x(i) * shape_l(k)) - 2. * (dshape_x(i) * dshape_l(k)) +
7883 (shape_x(i) * ddshape_l(k))) * shape_y(j);
7884 ddu(o,1) = (((shape_x(i) * ddshape_l(k)) - dshape_x(i) * dshape_l(k)) * shape_y(
7885 j)) + (((dshape_x(i) * shape_l(k)) - (shape_x(i) * dshape_l(k))) * dshape_y(j));
7886 ddu(o,2) = ((ddshape_y(j) * shape_l(k)) - 2. * (dshape_y(j) * dshape_l(k)) +
7887 (shape_y(j) * ddshape_l(k))) * shape_x(i);
7891 Ti.
Mult(ddu, ddshape);
7901 #ifndef MFEM_THREAD_SAFE
7918 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
7929 for (
int i = 1; i < p; i++)
7933 for (
int i = 1; i < p; i++)
7937 for (
int i = 1; i < p; i++)
7941 for (
int i = 1; i < p; i++)
7945 for (
int i = 1; i < p; i++)
7949 for (
int i = 1; i < p; i++)
7955 for (
int j = 1; j < p; j++)
7956 for (
int i = 1; i + j < p; i++)
7958 double w = cp[i] + cp[j] + cp[p-i-j];
7961 for (
int j = 1; j < p; j++)
7962 for (
int i = 1; i + j < p; i++)
7964 double w = cp[i] + cp[j] + cp[p-i-j];
7967 for (
int j = 1; j < p; j++)
7968 for (
int i = 1; i + j < p; i++)
7970 double w = cp[i] + cp[j] + cp[p-i-j];
7973 for (
int j = 1; j < p; j++)
7974 for (
int i = 1; i + j < p; i++)
7976 double w = cp[i] + cp[j] + cp[p-i-j];
7981 for (
int k = 1; k < p; k++)
7982 for (
int j = 1; j + k < p; j++)
7983 for (
int i = 1; i + j + k < p; i++)
7985 double w = cp[i] + cp[j] + cp[k] + cp[p-i-j-k];
7990 for (
int m = 0; m <
Dof; m++)
7999 for (
int k = 0; k <= p; k++)
8000 for (
int j = 0; j + k <= p; j++)
8001 for (
int i = 0; i + j + k <= p; i++)
8003 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8014 const int p =
Order;
8016 #ifdef MFEM_THREAD_SAFE
8017 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8026 for (
int o = 0, k = 0; k <= p; k++)
8027 for (
int j = 0; j + k <= p; j++)
8028 for (
int i = 0; i + j + k <= p; i++)
8030 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8039 const int p =
Order;
8041 #ifdef MFEM_THREAD_SAFE
8042 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8043 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8052 for (
int o = 0, k = 0; k <= p; k++)
8053 for (
int j = 0; j + k <= p; j++)
8054 for (
int i = 0; i + j + k <= p; i++)
8056 int l = p - i - j - k;
8057 du(o,0) = ((dshape_x(i)* shape_l(l)) -
8058 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
8059 du(o,1) = ((dshape_y(j)* shape_l(l)) -
8060 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
8061 du(o,2) = ((dshape_z(k)* shape_l(l)) -
8062 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
8066 Ti.
Mult(du, dshape);
8072 const int p =
Order;
8074 #ifdef MFEM_THREAD_SAFE
8075 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8076 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8077 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_z(p + 1), ddshape_l(p + 1);
8086 for (
int o = 0, k = 0; k <= p; k++)
8087 for (
int j = 0; j + k <= p; j++)
8088 for (
int i = 0; i + j + k <= p; i++)
8091 int l = p - i - j - k;
8092 ddu(o,0) = ((ddshape_x(i) * shape_l(l)) - 2. * (dshape_x(i) * dshape_l(l)) +
8093 (shape_x(i) * ddshape_l(l))) * shape_y(j) * shape_z(k);
8094 ddu(o,1) = ((dshape_y(j) * ((dshape_x(i) * shape_l(l)) -
8095 (shape_x(i) * dshape_l(l)))) +
8096 (shape_y(j) * ((ddshape_l(l) * shape_x(i)) -
8097 (dshape_x(i) * dshape_l(l)))))* shape_z(k);
8098 ddu(o,2) = ((dshape_z(k) * ((dshape_x(i) * shape_l(l)) -
8099 (shape_x(i) * dshape_l(l)))) +
8100 (shape_z(k) * ((ddshape_l(l) * shape_x(i)) -
8101 (dshape_x(i) * dshape_l(l)))))* shape_y(j);
8102 ddu(o,3) = ((ddshape_y(j) * shape_l(l)) - 2. * (dshape_y(j) * dshape_l(l)) +
8103 (shape_y(j) * ddshape_l(l))) * shape_x(i) * shape_z(k);
8104 ddu(o,4) = ((dshape_z(k) * ((dshape_y(j) * shape_l(l)) -
8105 (shape_y(j)*dshape_l(l))) ) +
8106 (shape_z(k)* ((ddshape_l(l)*shape_y(j)) -
8107 (dshape_y(j) * dshape_l(l)) ) ) )* shape_x(i);
8108 ddu(o,5) = ((ddshape_z(k) * shape_l(l)) - 2. * (dshape_z(k) * dshape_l(l)) +
8109 (shape_z(k) * ddshape_l(l))) * shape_y(j) * shape_x(i);
8112 Ti.
Mult(ddu, ddshape);
8119 #ifndef MFEM_THREAD_SAFE
8129 Index(
int p) { p2p3 = 2*p + 3; }
8130 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
8144 for (
int i = 1; i < p; i++)
8149 for (
int i = 1; i < p; i++)
8154 for (
int i = 1; i < p; i++)
8161 for (
int j = 1; j < p; j++)
8162 for (
int i = 1; i + j < p; i++)
8171 const int p,
const double l1,
const double l2,
double *shape)
8173 const double l3 = 1. - l1 - l2;
8183 for (
int o = 0, j = 0; j <= p; j++)
8187 for (
int i = 0; i <= p - j; i++)
8197 const int p,
const double l1,
const double l2,
8198 double *dshape_1d,
double *dshape)
8200 const int dof = ((p + 1)*(p + 2))/2;
8201 const double l3 = 1. - l1 - l2;
8205 for (
int o = 0, j = 0; j <= p; j++)
8209 for (
int i = 0; i <= p - j; i++)
8211 dshape[o++] = s*dshape_1d[i];
8216 for (
int i = 0; i <= p; i++)
8220 for (
int o = i, j = 0; j <= p - i; j++)
8222 dshape[dof + o] = s*dshape_1d[j];
8232 #ifdef MFEM_THREAD_SAFE
8236 for (
int i = 0; i <
Dof; i++)
8245 #ifdef MFEM_THREAD_SAFE
8250 for (
int d = 0; d < 2; d++)
8252 for (
int i = 0; i <
Dof; i++)
8264 #ifndef MFEM_THREAD_SAFE
8274 int tri(
int k) {
return (k*(k + 1))/2; }
8275 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
8276 Index(
int p_) { p = p_; dof = tet(p + 1); }
8277 int operator()(
int i,
int j,
int k)
8278 {
return dof - tet(p - k) - tri(p + 1 - k - j) + i; }
8294 for (
int i = 1; i < p; i++)
8299 for (
int i = 1; i < p; i++)
8304 for (
int i = 1; i < p; i++)
8309 for (
int i = 1; i < p; i++)
8314 for (
int i = 1; i < p; i++)
8319 for (
int i = 1; i < p; i++)
8326 for (
int j = 1; j < p; j++)
8327 for (
int i = 1; i + j < p; i++)
8332 for (
int j = 1; j < p; j++)
8333 for (
int i = 1; i + j < p; i++)
8338 for (
int j = 1; j < p; j++)
8339 for (
int i = 1; i + j < p; i++)
8344 for (
int j = 1; j < p; j++)
8345 for (
int i = 1; i + j < p; i++)
8352 for (
int k = 1; k < p; k++)
8353 for (
int j = 1; j + k < p; j++)
8354 for (
int i = 1; i + j + k < p; i++)
8363 const int p,
const double l1,
const double l2,
const double l3,
8366 const double l4 = 1. - l1 - l2 - l3;
8375 for (
int o = 0, k = 0; k <= p; k++)
8378 const double ek = bp[k]*l3k;
8380 for (
int j = 0; j <= p - k; j++)
8383 double ekj = ek*bpk[j]*l2j;
8384 for (
int i = 0; i <= p - k - j; i++)
8396 const int p,
const double l1,
const double l2,
const double l3,
8397 double *dshape_1d,
double *dshape)
8399 const int dof = ((p + 1)*(p + 2)*(p + 3))/6;
8400 const double l4 = 1. - l1 - l2 - l3;
8408 for (
int o = 0, k = 0; k <= p; k++)
8411 const double ek = bp[k]*l3k;
8413 for (
int j = 0; j <= p - k; j++)
8416 double ekj = ek*bpk[j]*l2j;
8417 for (
int i = 0; i <= p - k - j; i++)
8419 dshape[o++] = dshape_1d[i]*ekj;
8430 for (
int ok = 0, k = 0; k <= p; k++)
8433 const double ek = bp[k]*l3k;
8435 for (
int i = 0; i <= p - k; i++)
8438 double eki = ek*bpk[i]*l1i;
8440 for (
int j = 0; j <= p - k - i; j++)
8442 dshape[dof + o] = dshape_1d[j]*eki;
8448 ok += ((p - k + 2)*(p - k + 1))/2;
8455 for (
int j = 0; j <= p; j++)
8458 const double ej = bp[j]*l2j;
8460 for (
int i = 0; i <= p - j; i++)
8463 double eji = ej*bpj[i]*l1i;
8464 int m = ((p + 2)*(p + 1))/2;
8465 int n = ((p - j + 2)*(p - j + 1))/2;
8466 for (
int o = i, k = 0; k <= p - j - i; k++)
8471 dshape[2*dof + o - n] = dshape_1d[k]*eji;
8484 #ifdef MFEM_THREAD_SAFE
8488 for (
int i = 0; i <
Dof; i++)
8497 #ifdef MFEM_THREAD_SAFE
8502 for (
int d = 0; d < 3; d++)
8504 for (
int i = 0; i <
Dof; i++)
8519 #ifndef MFEM_THREAD_SAFE
8530 t_dof[0] = 0; s_dof[0] = 0;
8531 t_dof[1] = 1; s_dof[1] = 0;
8532 t_dof[2] = 2; s_dof[2] = 0;
8533 t_dof[3] = 0; s_dof[3] = 1;
8534 t_dof[4] = 1; s_dof[4] = 1;
8535 t_dof[5] = 2; s_dof[5] = 1;
8539 for (
int i=1; i<p; i++)
8541 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 0 * ne + i] = 0;
8542 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 1 * ne + i] = 0;
8543 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 2 * ne + i] = 0;
8544 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 3 * ne + i] = 1;
8545 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 4 * ne + i] = 1;
8546 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 5 * ne + i] = 1;
8547 t_dof[5 + 6 * ne + i] = 0; s_dof[5 + 6 * ne + i] = i + 1;
8548 t_dof[5 + 7 * ne + i] = 1; s_dof[5 + 7 * ne + i] = i + 1;
8549 t_dof[5 + 8 * ne + i] = 2; s_dof[5 + 8 * ne + i] = i + 1;
8554 int nt = (p-1)*(p-2)/2;
8555 for (
int j=1; j<p; j++)
8557 for (
int i=1; i<p-j; i++)
8559 int l = j - p + (((2 * p - 1) - i) * i) / 2;
8560 t_dof[6 + 9 * ne + k] = 3 * p + l; s_dof[6 + 9 * ne + k] = 0;
8561 t_dof[6 + 9 * ne + nt + k] = 3 * p + k; s_dof[6 + 9 * ne + nt + k] = 1;
8568 int nq = (p-1)*(p-1);
8569 for (
int j=1; j<p; j++)
8571 for (
int i=1; i<p; i++)
8573 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
8574 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
8575 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
8577 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
8578 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
8579 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
8587 for (
int k=1; k<p; k++)
8590 for (
int j=1; j<p; j++)
8592 for (
int i=1; i<j; i++)
8594 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
8595 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
8604 for (
int i=0; i<
Dof; i++)
8615 #ifdef MFEM_THREAD_SAFE
8625 for (
int i=0; i<
Dof; i++)
8627 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
8634 #ifdef MFEM_THREAD_SAFE
8648 for (
int i=0; i<
Dof; i++)
8650 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
8651 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
8652 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
8663 #ifndef MFEM_THREAD_SAFE
8683 for (
int i=1; i<p; i++)
8685 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
8686 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
8687 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
8688 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
8689 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
8690 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
8691 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
8692 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
8693 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
8698 int nt = (p-1)*(p-2)/2;
8699 for (
int j=1; j<p; j++)
8701 for (
int i=1; i<j; i++)
8703 t_dof[6 + 9 * ne + k] = 3 * p + k;
s_dof[6 + 9 * ne + k] = 0;
8704 t_dof[6 + 9 * ne + nt + k] = 3 * p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
8711 int nq = (p-1)*(p-1);
8712 for (
int j=1; j<p; j++)
8714 for (
int i=1; i<p; i++)
8716 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
8717 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
8718 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
8720 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
8721 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
8722 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
8730 for (
int k=1; k<p; k++)
8733 for (
int j=1; j<p; j++)
8735 for (
int i=1; i<j; i++)
8737 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
8738 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
8747 for (
int i=0; i<
Dof; i++)
8758 #ifdef MFEM_THREAD_SAFE
8768 for (
int i=0; i<
Dof; i++)
8777 #ifdef MFEM_THREAD_SAFE
8791 for (
int i=0; i<
Dof; i++)
8805 #ifndef MFEM_THREAD_SAFE
8810 for (
int i = 0; i <= p; i++)
8825 #ifdef MFEM_THREAD_SAFE
8835 const int p =
Order;
8841 for (
int i = 0; i <= p; i++)
8848 for (
int i = 0; i <= p; i++)
8860 #ifndef MFEM_THREAD_SAFE
8871 for (
int i = 0; i <= p; i++)
8887 #ifdef MFEM_THREAD_SAFE
8898 dofs[vertex*
Order] = 1.0;
8907 #ifndef MFEM_THREAD_SAFE
8914 for (
int o = 0, j = 0; j <= p; j++)
8915 for (
int i = 0; i <= p; i++)
8924 const int p =
Order;
8926 #ifdef MFEM_THREAD_SAFE
8927 Vector shape_x(p+1), shape_y(p+1);
8933 for (
int o = 0, j = 0; j <= p; j++)
8934 for (
int i = 0; i <= p; i++)
8936 shape(o++) = shape_x(i)*shape_y(j);
8943 const int p =
Order;
8945 #ifdef MFEM_THREAD_SAFE
8946 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
8952 for (
int o = 0, j = 0; j <= p; j++)
8953 for (
int i = 0; i <= p; i++)
8955 dshape(o,0) = dshape_x(i)* shape_y(j);
8956 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
8962 const int p =
Order;
8965 #ifdef MFEM_THREAD_SAFE
8966 Vector shape_x(p+1), shape_y(p+1);
8969 for (
int i = 0; i <= p; i++)
8978 for (
int o = 0, j = 0; j <= p; j++)
8979 for (
int i = 0; i <= p; i++)
8981 dofs[o++] = shape_x(i)*shape_x(j);
8985 for (
int o = 0, j = 0; j <= p; j++)
8986 for (
int i = 0; i <= p; i++)
8988 dofs[o++] = shape_y(i)*shape_x(j);
8992 for (
int o = 0, j = 0; j <= p; j++)
8993 for (
int i = 0; i <= p; i++)
8995 dofs[o++] = shape_y(i)*shape_y(j);
8999 for (
int o = 0, j = 0; j <= p; j++)
9000 for (
int i = 0; i <= p; i++)
9002 dofs[o++] = shape_x(i)*shape_y(j);
9012 #ifndef MFEM_THREAD_SAFE
9025 for (
int o = 0, j = 0; j <= p; j++)
9026 for (
int i = 0; i <= p; i++)
9036 const int p =
Order;
9038 #ifdef MFEM_THREAD_SAFE
9039 Vector shape_x(p+1), shape_y(p+1);
9045 for (
int o = 0, j = 0; j <= p; j++)
9046 for (
int i = 0; i <= p; i++)
9048 shape(o++) = shape_x(i)*shape_y(j);
9055 const int p =
Order;
9057 #ifdef MFEM_THREAD_SAFE
9058 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9064 for (
int o = 0, j = 0; j <= p; j++)
9065 for (
int i = 0; i <= p; i++)
9067 dshape(o,0) = dshape_x(i)* shape_y(j);
9068 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9074 const int p =
Order;
9079 case 0: dofs[0] = 1.0;
break;
9080 case 1: dofs[p] = 1.0;
break;
9081 case 2: dofs[p*(p + 2)] = 1.0;
break;
9082 case 3: dofs[p*(p + 1)] = 1.0;
break;
9092 #ifndef MFEM_THREAD_SAFE
9101 for (
int o = 0, k = 0; k <= p; k++)
9102 for (
int j = 0; j <= p; j++)
9103 for (
int i = 0; i <= p; i++)
9112 const int p =
Order;
9114 #ifdef MFEM_THREAD_SAFE
9115 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9122 for (
int o = 0, k = 0; k <= p; k++)
9123 for (
int j = 0; j <= p; j++)
9124 for (
int i = 0; i <= p; i++)
9126 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9133 const int p =
Order;
9135 #ifdef MFEM_THREAD_SAFE
9136 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9137 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9144 for (
int o = 0, k = 0; k <= p; k++)
9145 for (
int j = 0; j <= p; j++)
9146 for (
int i = 0; i <= p; i++)
9148 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9149 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9150 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9156 const int p =
Order;
9159 #ifdef MFEM_THREAD_SAFE
9160 Vector shape_x(p+1), shape_y(p+1);
9163 for (
int i = 0; i <= p; i++)
9172 for (
int o = 0, k = 0; k <= p; k++)
9173 for (
int j = 0; j <= p; j++)
9174 for (
int i = 0; i <= p; i++)
9176 dofs[o++] = shape_x(i)*shape_x(j)*shape_x(k);
9180 for (
int o = 0, k = 0; k <= p; k++)
9181 for (
int j = 0; j <= p; j++)
9182 for (
int i = 0; i <= p; i++)
9184 dofs[o++] = shape_y(i)*shape_x(j)*shape_x(k);
9188 for (
int o = 0, k = 0; k <= p; k++)
9189 for (
int j = 0; j <= p; j++)
9190 for (
int i = 0; i <= p; i++)
9192 dofs[o++] = shape_y(i)*shape_y(j)*shape_x(k);
9196 for (
int o = 0, k = 0; k <= p; k++)
9197 for (
int j = 0; j <= p; j++)
9198 for (
int i = 0; i <= p; i++)
9200 dofs[o++] = shape_x(i)*shape_y(j)*shape_x(k);
9204 for (
int o = 0, k = 0; k <= p; k++)
9205 for (
int j = 0; j <= p; j++)
9206 for (
int i = 0; i <= p; i++)
9208 dofs[o++] = shape_x(i)*shape_x(j)*shape_y(k);
9212 for (
int o = 0, k = 0; k <= p; k++)
9213 for (
int j = 0; j <= p; j++)
9214 for (
int i = 0; i <= p; i++)
9216 dofs[o++] = shape_y(i)*shape_x(j)*shape_y(k);
9220 for (
int o = 0, k = 0; k <= p; k++)
9221 for (
int j = 0; j <= p; j++)
9222 for (
int i = 0; i <= p; i++)
9224 dofs[o++] = shape_y(i)*shape_y(j)*shape_y(k);
9228 for (
int o = 0, k = 0; k <= p; k++)
9229 for (
int j = 0; j <= p; j++)
9230 for (
int i = 0; i <= p; i++)
9232 dofs[o++] = shape_x(i)*shape_y(j)*shape_y(k);
9242 #ifndef MFEM_THREAD_SAFE
9257 for (
int o = 0, k = 0; k <= p; k++)
9258 for (
int j = 0; j <= p; j++)
9259 for (
int i = 0; i <= p; i++)
9269 const int p =
Order;
9271 #ifdef MFEM_THREAD_SAFE
9272 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9279 for (
int o = 0, k = 0; k <= p; k++)
9280 for (
int j = 0; j <= p; j++)
9281 for (
int i = 0; i <= p; i++)
9283 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9290 const int p =
Order;
9292 #ifdef MFEM_THREAD_SAFE
9293 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9294 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9301 for (
int o = 0, k = 0; k <= p; k++)
9302 for (
int j = 0; j <= p; j++)
9303 for (
int i = 0; i <= p; i++)
9305 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9306 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9307 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9313 const int p =
Order;
9318 case 0: dofs[0] = 1.0;
break;
9319 case 1: dofs[p] = 1.0;
break;
9320 case 2: dofs[p*(p + 2)] = 1.0;
break;
9321 case 3: dofs[p*(p + 1)] = 1.0;
break;
9322 case 4: dofs[p*(p + 1)*(p + 1)] = 1.0;
break;
9323 case 5: dofs[p + p*(p + 1)*(p + 1)] = 1.0;
break;
9324 case 6: dofs[
Dof - 1] = 1.0;
break;
9325 case 7: dofs[
Dof - p - 1] = 1.0;
break;
9336 #ifndef MFEM_THREAD_SAFE
9346 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
9349 for (
int o = 0, j = 0; j <= p; j++)
9350 for (
int i = 0; i + j <= p; i++)
9352 double w = op[i] + op[j] + op[p-i-j];
9357 for (
int k = 0; k <
Dof; k++)
9364 for (
int o = 0, j = 0; j <= p; j++)
9365 for (
int i = 0; i + j <= p; i++)
9367 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
9378 const int p =
Order;
9380 #ifdef MFEM_THREAD_SAFE
9381 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
Dof);
9388 for (
int o = 0, j = 0; j <= p; j++)
9389 for (
int i = 0; i + j <= p; i++)
9391 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
9400 const int p =
Order;
9402 #ifdef MFEM_THREAD_SAFE
9403 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
9404 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
9412 for (
int o = 0, j = 0; j <= p; j++)
9413 for (
int i = 0; i + j <= p; i++)
9416 du(o,0) = ((dshape_x(i)* shape_l(k)) -
9417 ( shape_x(i)*dshape_l(k)))*shape_y(j);
9418 du(o,1) = ((dshape_y(j)* shape_l(k)) -
9419 ( shape_y(j)*dshape_l(k)))*shape_x(i);
9423 Ti.
Mult(du, dshape);
9431 for (
int i = 0; i <
Dof; i++)
9434 dofs[i] = pow(1.0 - ip.
x - ip.
y,
Order);
9438 for (
int i = 0; i <
Dof; i++)
9441 dofs[i] = pow(ip.
x,
Order);
9445 for (
int i = 0; i <
Dof; i++)
9448 dofs[i] = pow(ip.
y,
Order);
9459 #ifndef MFEM_THREAD_SAFE
9469 for (
int o = 0, j = 0; j <= p; j++)
9470 for (
int i = 0; i + j <= p; i++)
9486 #ifdef MFEM_THREAD_SAFE
9499 case 0: dofs[0] = 1.0;
break;
9500 case 1: dofs[
Order] = 1.0;
break;
9501 case 2: dofs[
Dof-1] = 1.0;
break;
9512 #ifndef MFEM_THREAD_SAFE
9524 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9527 for (
int o = 0, k = 0; k <= p; k++)
9528 for (
int j = 0; j + k <= p; j++)
9529 for (
int i = 0; i + j + k <= p; i++)
9531 double w = op[i] + op[j] + op[k] + op[p-i-j-k];
9536 for (
int m = 0; m <
Dof; m++)
9544 for (
int o = 0, k = 0; k <= p; k++)
9545 for (
int j = 0; j + k <= p; j++)
9546 for (
int i = 0; i + j + k <= p; i++)
9548 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
9559 const int p =
Order;
9561 #ifdef MFEM_THREAD_SAFE
9562 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9571 for (
int o = 0, k = 0; k <= p; k++)
9572 for (
int j = 0; j + k <= p; j++)
9573 for (
int i = 0; i + j + k <= p; i++)
9575 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
9584 const int p =
Order;
9586 #ifdef MFEM_THREAD_SAFE
9587 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
9588 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
9597 for (
int o = 0, k = 0; k <= p; k++)
9598 for (
int j = 0; j + k <= p; j++)
9599 for (
int i = 0; i + j + k <= p; i++)
9601 int l = p - i - j - k;
9602 du(o,0) = ((dshape_x(i)* shape_l(l)) -
9603 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
9604 du(o,1) = ((dshape_y(j)* shape_l(l)) -
9605 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
9606 du(o,2) = ((dshape_z(k)* shape_l(l)) -
9607 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
9611 Ti.
Mult(du, dshape);
9619 for (
int i = 0; i <
Dof; i++)
9622 dofs[i] = pow(1.0 - ip.
x - ip.
y - ip.
z,
Order);
9626 for (
int i = 0; i <
Dof; i++)
9629 dofs[i] = pow(ip.
x,
Order);
9633 for (
int i = 0; i <
Dof; i++)
9636 dofs[i] = pow(ip.
y,
Order);
9639 for (
int i = 0; i <
Dof; i++)
9642 dofs[i] = pow(ip.
z,
Order);
9653 #ifndef MFEM_THREAD_SAFE
9663 for (
int o = 0, k = 0; k <= p; k++)
9664 for (
int j = 0; j + k <= p; j++)
9665 for (
int i = 0; i + j + k <= p; i++)
9682 #ifdef MFEM_THREAD_SAFE
9695 case 0: dofs[0] = 1.0;
break;
9696 case 1: dofs[
Order] = 1.0;
break;
9697 case 2: dofs[(
Order*(
Order+3))/2] = 1.0;
break;
9698 case 3: dofs[
Dof-1] = 1.0;
break;
9709 #ifndef MFEM_THREAD_SAFE
9721 for (
int k=0; k<=p; k++)
9724 for (
int j=0; j<=p; j++)
9726 for (
int i=0; i<=j; i++)
9738 for (
int i=0; i<
Dof; i++)
9749 #ifdef MFEM_THREAD_SAFE
9759 for (
int i=0; i<
Dof; i++)
9761 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
9768 #ifdef MFEM_THREAD_SAFE
9782 for (
int i=0; i<
Dof; i++)
9784 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
9785 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
9786 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
9797 #ifndef MFEM_THREAD_SAFE
9809 for (
int k=0; k<=p; k++)
9812 for (
int j=0; j<=p; j++)
9814 for (
int i=0; i<=j; i++)
9826 for (
int i=0; i<
Dof; i++)
9837 #ifdef MFEM_THREAD_SAFE
9847 for (
int i=0; i<
Dof; i++)
9856 #ifdef MFEM_THREAD_SAFE
9870 for (
int i=0; i<
Dof; i++)
9879 const double RT_QuadrilateralElement::nk[8] =
9880 { 0., -1., 1., 0., 0., 1., -1., 0. };
9887 cbasis1d(
poly1d.GetBasis(p + 1, VerifyClosed(cb_type))),
9888 obasis1d(
poly1d.GetBasis(p, VerifyOpen(ob_type))),
9889 dof_map(Dof), dof2nk(Dof)
9893 const int dof2 =
Dof/2;
9895 #ifndef MFEM_THREAD_SAFE
9906 for (
int i = 0; i <= p; i++)
9908 dof_map[1*dof2 + i + 0*(p + 1)] = o++;
9910 for (
int i = 0; i <= p; i++)
9912 dof_map[0*dof2 + (p + 1) + i*(p + 2)] = o++;
9914 for (
int i = 0; i <= p; i++)
9916 dof_map[1*dof2 + (p - i) + (p + 1)*(p + 1)] = o++;
9918 for (
int i = 0; i <= p; i++)
9920 dof_map[0*dof2 + 0 + (p - i)*(p + 2)] = o++;
9924 for (
int j = 0; j <= p; j++)
9925 for (
int i = 1; i <= p; i++)
9927 dof_map[0*dof2 + i + j*(p + 2)] = o++;
9929 for (
int j = 1; j <= p; j++)
9930 for (
int i = 0; i <= p; i++)
9932 dof_map[1*dof2 + i + j*(p + 1)] = o++;
9937 for (
int j = 0; j <= p; j++)
9938 for (
int i = 0; i <= p/2; i++)
9940 int idx = 0*dof2 + i + j*(p + 2);
9941 dof_map[idx] = -1 - dof_map[idx];
9944 for (
int j = p/2 + 1; j <= p; j++)
9946 int idx = 0*dof2 + (p/2 + 1) + j*(p + 2);
9947 dof_map[idx] = -1 - dof_map[idx];
9950 for (
int j = 0; j <= p/2; j++)
9951 for (
int i = 0; i <= p; i++)
9953 int idx = 1*dof2 + i + j*(p + 1);
9954 dof_map[idx] = -1 - dof_map[idx];
9957 for (
int i = 0; i <= p/2; i++)
9959 int idx = 1*dof2 + i + (p/2 + 1)*(p + 1);
9960 dof_map[idx] = -1 - dof_map[idx];
9964 for (
int j = 0; j <= p; j++)
9965 for (
int i = 0; i <= p + 1; i++)
9968 if ((idx = dof_map[o++]) < 0)
9979 for (
int j = 0; j <= p + 1; j++)
9980 for (
int i = 0; i <= p; i++)
9983 if ((idx = dof_map[o++]) < 0)
9999 const int pp1 =
Order;
10001 #ifdef MFEM_THREAD_SAFE
10002 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10005 cbasis1d.
Eval(ip.
x, shape_cx);
10006 obasis1d.
Eval(ip.
x, shape_ox);
10007 cbasis1d.
Eval(ip.
y, shape_cy);
10008 obasis1d.
Eval(ip.
y, shape_oy);
10011 for (
int j = 0; j < pp1; j++)
10012 for (
int i = 0; i <= pp1; i++)
10015 if ((idx = dof_map[o++]) < 0)
10017 idx = -1 - idx, s = -1;
10023 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
10026 for (
int j = 0; j <= pp1; j++)
10027 for (
int i = 0; i < pp1; i++)
10030 if ((idx = dof_map[o++]) < 0)
10032 idx = -1 - idx, s = -1;
10039 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
10046 const int pp1 =
Order;
10048 #ifdef MFEM_THREAD_SAFE
10049 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10050 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
10053 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
10054 obasis1d.
Eval(ip.
x, shape_ox);
10055 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
10056 obasis1d.
Eval(ip.
y, shape_oy);
10059 for (
int j = 0; j < pp1; j++)
10060 for (
int i = 0; i <= pp1; i++)
10063 if ((idx = dof_map[o++]) < 0)
10065 idx = -1 - idx, s = -1;
10071 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
10073 for (
int j = 0; j <= pp1; j++)
10074 for (
int i = 0; i < pp1; i++)
10077 if ((idx = dof_map[o++]) < 0)
10079 idx = -1 - idx, s = -1;
10085 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
10090 const double RT_HexahedronElement::nk[18] =
10091 { 0.,0.,-1., 0.,-1.,0., 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,0.,1. };
10098 cbasis1d(
poly1d.GetBasis(p + 1, VerifyClosed(cb_type))),
10099 obasis1d(
poly1d.GetBasis(p, VerifyOpen(ob_type))),
10100 dof_map(Dof), dof2nk(Dof)
10104 const int dof3 =
Dof/3;
10106 #ifndef MFEM_THREAD_SAFE
10120 for (
int j = 0; j <= p; j++)
10121 for (
int i = 0; i <= p; i++)
10123 dof_map[2*dof3 + i + ((p - j) + 0*(p + 1))*(p + 1)] = o++;
10125 for (
int j = 0; j <= p; j++)
10126 for (
int i = 0; i <= p; i++)
10128 dof_map[1*dof3 + i + (0 + j*(p + 2))*(p + 1)] = o++;
10130 for (
int j = 0; j <= p; j++)
10131 for (
int i = 0; i <= p; i++)
10133 dof_map[0*dof3 + (p + 1) + (i + j*(p + 1))*(p + 2)] = o++;
10135 for (
int j = 0; j <= p; j++)
10136 for (
int i = 0; i <= p; i++)
10138 dof_map[1*dof3 + (p - i) + ((p + 1) + j*(p + 2))*(p + 1)] = o++;
10140 for (
int j = 0; j <= p; j++)
10141 for (
int i = 0; i <= p; i++)
10143 dof_map[0*dof3 + 0 + ((p - i) + j*(p + 1))*(p + 2)] = o++;
10145 for (
int j = 0; j <= p; j++)
10146 for (
int i = 0; i <= p; i++)
10148 dof_map[2*dof3 + i + (j + (p + 1)*(p + 1))*(p + 1)] = o++;
10153 for (
int k = 0; k <= p; k++)
10154 for (
int j = 0; j <= p; j++)
10155 for (
int i = 1; i <= p; i++)
10157 dof_map[0*dof3 + i + (j + k*(p + 1))*(p + 2)] = o++;
10160 for (
int k = 0; k <= p; k++)
10161 for (
int j = 1; j <= p; j++)
10162 for (
int i = 0; i <= p; i++)
10164 dof_map[1*dof3 + i + (j + k*(p + 2))*(p + 1)] = o++;
10167 for (
int k = 1; k <= p; k++)
10168 for (
int j = 0; j <= p; j++)
10169 for (
int i = 0; i <= p; i++)
10171 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
10179 for (
int k = 0; k <= p; k++)
10180 for (
int j = 0; j <= p; j++)
10181 for (
int i = 0; i <= p/2; i++)
10183 int idx = 0*dof3 + i + (j + k*(p + 1))*(p + 2);
10184 dof_map[idx] = -1 - dof_map[idx];
10187 for (
int k = 0; k <= p; k++)
10188 for (
int j = 0; j <= p/2; j++)
10189 for (
int i = 0; i <= p; i++)
10191 int idx = 1*dof3 + i + (j + k*(p + 2))*(p + 1);
10192 dof_map[idx] = -1 - dof_map[idx];
10195 for (
int k = 0; k <= p/2; k++)
10196 for (
int j = 0; j <= p; j++)
10197 for (
int i = 0; i <= p; i++)
10199 int idx = 2*dof3 + i + (j + k*(p + 1))*(p + 1);
10200 dof_map[idx] = -1 - dof_map[idx];
10205 for (
int k = 0; k <= p; k++)
10206 for (
int j = 0; j <= p; j++)
10207 for (
int i = 0; i <= p + 1; i++)
10210 if ((idx = dof_map[o++]) < 0)
10222 for (
int k = 0; k <= p; k++)
10223 for (
int j = 0; j <= p + 1; j++)
10224 for (
int i = 0; i <= p; i++)
10227 if ((idx = dof_map[o++]) < 0)
10239 for (
int k = 0; k <= p + 1; k++)
10240 for (
int j = 0; j <= p; j++)
10241 for (
int i = 0; i <= p; i++)
10244 if ((idx = dof_map[o++]) < 0)
10260 const int pp1 =
Order;
10262 #ifdef MFEM_THREAD_SAFE
10263 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10264 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10267 cbasis1d.
Eval(ip.
x, shape_cx);
10268 obasis1d.
Eval(ip.
x, shape_ox);
10269 cbasis1d.
Eval(ip.
y, shape_cy);
10270 obasis1d.
Eval(ip.
y, shape_oy);
10271 cbasis1d.
Eval(ip.
z, shape_cz);
10272 obasis1d.
Eval(ip.
z, shape_oz);
10276 for (
int k = 0; k < pp1; k++)
10277 for (
int j = 0; j < pp1; j++)
10278 for (
int i = 0; i <= pp1; i++)
10281 if ((idx = dof_map[o++]) < 0)
10283 idx = -1 - idx, s = -1;
10289 shape(idx,0) = s*shape_cx(i)*shape_oy(j)*shape_oz(k);
10294 for (
int k = 0; k < pp1; k++)
10295 for (
int j = 0; j <= pp1; j++)
10296 for (
int i = 0; i < pp1; i++)
10299 if ((idx = dof_map[o++]) < 0)
10301 idx = -1 - idx, s = -1;
10308 shape(idx,1) = s*shape_ox(i)*shape_cy(j)*shape_oz(k);
10312 for (
int k = 0; k <= pp1; k++)
10313 for (
int j = 0; j < pp1; j++)
10314 for (
int i = 0; i < pp1; i++)
10317 if ((idx = dof_map[o++]) < 0)
10319 idx = -1 - idx, s = -1;
10327 shape(idx,2) = s*shape_ox(i)*shape_oy(j)*shape_cz(k);
10334 const int pp1 =
Order;
10336 #ifdef MFEM_THREAD_SAFE
10337 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10338 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10339 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
10342 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
10343 obasis1d.
Eval(ip.
x, shape_ox);
10344 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
10345 obasis1d.
Eval(ip.
y, shape_oy);
10346 cbasis1d.
Eval(ip.
z, shape_cz, dshape_cz);
10347 obasis1d.
Eval(ip.
z, shape_oz);
10351 for (
int k = 0; k < pp1; k++)
10352 for (
int j = 0; j < pp1; j++)
10353 for (
int i = 0; i <= pp1; i++)
10356 if ((idx = dof_map[o++]) < 0)
10358 idx = -1 - idx, s = -1;
10364 divshape(idx) = s*dshape_cx(i)*shape_oy(j)*shape_oz(k);
10367 for (
int k = 0; k < pp1; k++)
10368 for (
int j = 0; j <= pp1; j++)
10369 for (
int i = 0; i < pp1; i++)
10372 if ((idx = dof_map[o++]) < 0)
10374 idx = -1 - idx, s = -1;
10380 divshape(idx) = s*shape_ox(i)*dshape_cy(j)*shape_oz(k);
10383 for (
int k = 0; k <= pp1; k++)
10384 for (
int j = 0; j < pp1; j++)
10385 for (
int i = 0; i < pp1; i++)
10388 if ((idx = dof_map[o++]) < 0)
10390 idx = -1 - idx, s = -1;
10396 divshape(idx) = s*shape_ox(i)*shape_oy(j)*dshape_cz(k);
10401 const double RT_TriangleElement::nk[6] =
10402 { 0., -1., 1., 1., -1., 0. };
10404 const double RT_TriangleElement::c = 1./3.;
10414 #ifndef MFEM_THREAD_SAFE
10424 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10429 for (
int i = 0; i <= p; i++)
10434 for (
int i = 0; i <= p; i++)
10439 for (
int i = 0; i <= p; i++)
10446 for (
int j = 0; j < p; j++)
10447 for (
int i = 0; i + j < p; i++)
10449 double w = iop[i] + iop[j] + iop[p-1-i-j];
10457 for (
int k = 0; k <
Dof; k++)
10463 const double *n_k = nk + 2*dof2nk[k];
10466 for (
int j = 0; j <= p; j++)
10467 for (
int i = 0; i + j <= p; i++)
10469 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10470 T(o++, k) = s*n_k[0];
10471 T(o++, k) = s*n_k[1];
10473 for (
int i = 0; i <= p; i++)
10475 double s = shape_x(i)*shape_y(p-i);
10476 T(o++, k) = s*((ip.
x - c)*n_k[0] + (ip.
y - c)*n_k[1]);
10487 const int p =
Order - 1;
10489 #ifdef MFEM_THREAD_SAFE
10490 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10499 for (
int j = 0; j <= p; j++)
10500 for (
int i = 0; i + j <= p; i++)
10502 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10503 u(o,0) = s; u(o,1) = 0; o++;
10504 u(o,0) = 0; u(o,1) = s; o++;
10506 for (
int i = 0; i <= p; i++)
10508 double s = shape_x(i)*shape_y(p-i);
10509 u(o,0) = (ip.
x - c)*s;
10510 u(o,1) = (ip.
y - c)*s;
10520 const int p =
Order - 1;
10522 #ifdef MFEM_THREAD_SAFE
10523 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10524 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
10533 for (
int j = 0; j <= p; j++)
10534 for (
int i = 0; i + j <= p; i++)
10537 divu(o++) = (dshape_x(i)*shape_l(k) -
10538 shape_x(i)*dshape_l(k))*shape_y(j);
10539 divu(o++) = (dshape_y(j)*shape_l(k) -
10540 shape_y(j)*dshape_l(k))*shape_x(i);
10542 for (
int i = 0; i <= p; i++)
10545 divu(o++) = ((shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j) +
10546 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i));
10549 Ti.
Mult(divu, divshape);
10553 const double RT_TetrahedronElement::nk[12] =
10554 { 1,1,1, -1,0,0, 0,-1,0, 0,0,-1 };
10557 const double RT_TetrahedronElement::c = 1./4.;
10567 #ifndef MFEM_THREAD_SAFE
10579 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10585 for (
int j = 0; j <= p; j++)
10586 for (
int i = 0; i + j <= p; i++)
10588 double w = bop[i] + bop[j] + bop[p-i-j];
10592 for (
int j = 0; j <= p; j++)
10593 for (
int i = 0; i + j <= p; i++)
10595 double w = bop[i] + bop[j] + bop[p-i-j];
10599 for (
int j = 0; j <= p; j++)
10600 for (
int i = 0; i + j <= p; i++)
10602 double w = bop[i] + bop[j] + bop[p-i-j];
10606 for (
int j = 0; j <= p; j++)
10607 for (
int i = 0; i + j <= p; i++)
10609 double w = bop[i] + bop[j] + bop[p-i-j];
10615 for (
int k = 0; k < p; k++)
10616 for (
int j = 0; j + k < p; j++)
10617 for (
int i = 0; i + j + k < p; i++)
10619 double w = iop[i] + iop[j] + iop[k] + iop[p-1-i-j-k];
10629 for (
int m = 0; m <
Dof; m++)
10636 const double *nm = nk + 3*dof2nk[m];
10639 for (
int k = 0; k <= p; k++)
10640 for (
int j = 0; j + k <= p; j++)
10641 for (
int i = 0; i + j + k <= p; i++)
10643 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10644 T(o++, m) = s * nm[0];
10645 T(o++, m) = s * nm[1];
10646 T(o++, m) = s * nm[2];
10648 for (
int j = 0; j <= p; j++)
10649 for (
int i = 0; i + j <= p; i++)
10651 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
10652 T(o++, m) = s*((ip.
x - c)*nm[0] + (ip.
y - c)*nm[1] +
10664 const int p =
Order - 1;
10666 #ifdef MFEM_THREAD_SAFE
10667 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10677 for (
int k = 0; k <= p; k++)
10678 for (
int j = 0; j + k <= p; j++)
10679 for (
int i = 0; i + j + k <= p; i++)
10681 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10682 u(o,0) = s; u(o,1) = 0; u(o,2) = 0; o++;
10683 u(o,0) = 0; u(o,1) = s; u(o,2) = 0; o++;
10684 u(o,0) = 0; u(o,1) = 0; u(o,2) = s; o++;
10686 for (
int j = 0; j <= p; j++)
10687 for (
int i = 0; i + j <= p; i++)
10689 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
10690 u(o,0) = (ip.
x - c)*s; u(o,1) = (ip.
y - c)*s; u(o,2) = (ip.
z - c)*s;
10700 const int p =
Order - 1;
10702 #ifdef MFEM_THREAD_SAFE
10703 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10704 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
10714 for (
int k = 0; k <= p; k++)
10715 for (
int j = 0; j + k <= p; j++)
10716 for (
int i = 0; i + j + k <= p; i++)
10718 int l = p - i - j - k;
10719 divu(o++) = (dshape_x(i)*shape_l(l) -
10720 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
10721 divu(o++) = (dshape_y(j)*shape_l(l) -
10722 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
10723 divu(o++) = (dshape_z(k)*shape_l(l) -
10724 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
10726 for (
int j = 0; j <= p; j++)
10727 for (
int i = 0; i + j <= p; i++)
10731 (shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j)*shape_z(k) +
10732 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i)*shape_z(k) +
10733 (shape_z(k) + (ip.
z - c)*dshape_z(k))*shape_x(i)*shape_y(j);
10736 Ti.
Mult(divu, divshape);
10740 const double ND_HexahedronElement::tk[18] =
10741 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,0.,0., 0.,-1.,0., 0.,0.,-1. };
10744 const int cb_type,
const int ob_type)
10747 cbasis1d(
poly1d.GetBasis(p, VerifyClosed(cb_type))),
10748 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(ob_type))),
10749 dof_map(Dof), dof2tk(Dof)
10753 const int dof3 =
Dof/3;
10755 #ifndef MFEM_THREAD_SAFE
10769 for (
int i = 0; i < p; i++)
10771 dof_map[0*dof3 + i + (0 + 0*(p + 1))*p] = o++;
10773 for (
int i = 0; i < p; i++)
10775 dof_map[1*dof3 + p + (i + 0*p)*(p + 1)] = o++;
10777 for (
int i = 0; i < p; i++)
10779 dof_map[0*dof3 + i + (p + 0*(p + 1))*p] = o++;
10781 for (
int i = 0; i < p; i++)
10783 dof_map[1*dof3 + 0 + (i + 0*p)*(p + 1)] = o++;
10785 for (
int i = 0; i < p; i++)
10787 dof_map[0*dof3 + i + (0 + p*(p + 1))*p] = o++;
10789 for (
int i = 0; i < p; i++)
10791 dof_map[1*dof3 + p + (i + p*p)*(p + 1)] = o++;
10793 for (
int i = 0; i < p; i++)
10795 dof_map[0*dof3 + i + (p + p*(p + 1))*p] = o++;
10797 for (
int i = 0; i < p; i++)
10799 dof_map[1*dof3 + 0 + (i + p*p)*(p + 1)] = o++;
10801 for (
int i = 0; i < p; i++)
10803 dof_map[2*dof3 + 0 + (0 + i*(p + 1))*(p + 1)] = o++;
10805 for (
int i = 0; i < p; i++)
10807 dof_map[2*dof3 + p + (0 + i*(p + 1))*(p + 1)] = o++;
10809 for (
int i = 0; i < p; i++)
10811 dof_map[2*dof3 + p + (p + i*(p + 1))*(p + 1)] = o++;
10813 for (
int i = 0; i < p; i++)
10815 dof_map[2*dof3 + 0 + (p + i*(p + 1))*(p + 1)] = o++;
10820 for (
int j = 1; j < p; j++)
10821 for (
int i = 0; i < p; i++)
10823 dof_map[0*dof3 + i + ((p - j) + 0*(p + 1))*p] = o++;
10825 for (
int j = 0; j < p; j++)
10826 for (
int i = 1; i < p; i++)
10828 dof_map[1*dof3 + i + ((p - 1 - j) + 0*p)*(p + 1)] = -1 - (o++);
10831 for (
int k = 1; k < p; k++)
10832 for (
int i = 0; i < p; i++)
10834 dof_map[0*dof3 + i + (0 + k*(p + 1))*p] = o++;
10836 for (
int k = 0; k < p; k++)
10837 for (
int i = 1; i < p; i++ )
10839 dof_map[2*dof3 + i + (0 + k*(p + 1))*(p + 1)] = o++;
10842 for (
int k = 1; k < p; k++)
10843 for (
int j = 0; j < p; j++)
10845 dof_map[1*dof3 + p + (j + k*p)*(p + 1)] = o++;
10847 for (
int k = 0; k < p; k++)
10848 for (
int j = 1; j < p; j++)
10850 dof_map[2*dof3 + p + (j + k*(p + 1))*(p + 1)] = o++;
10853 for (
int k = 1; k < p; k++)
10854 for (
int i = 0; i < p; i++)
10856 dof_map[0*dof3 + (p - 1 - i) + (p + k*(p + 1))*p] = -1 - (o++);
10858 for (
int k = 0; k < p; k++)
10859 for (
int i = 1; i < p; i++)
10861 dof_map[2*dof3 + (p - i) + (p + k*(p + 1))*(p + 1)] = o++;
10864 for (
int k = 1; k < p; k++)
10865 for (
int j = 0; j < p; j++)
10867 dof_map[1*dof3 + 0 + ((p - 1 - j) + k*p)*(p + 1)] = -1 - (o++);
10869 for (
int k = 0; k < p; k++)
10870 for (
int j = 1; j < p; j++)
10872 dof_map[2*dof3 + 0 + ((p - j) + k*(p + 1))*(p + 1)] = o++;
10875 for (
int j = 1; j < p; j++)
10876 for (
int i = 0; i < p; i++)
10878 dof_map[0*dof3 + i + (j + p*(p + 1))*p] = o++;
10880 for (
int j = 0; j < p; j++)
10881 for (
int i = 1; i < p; i++)
10883 dof_map[1*dof3 + i + (j + p*p)*(p + 1)] = o++;
10888 for (
int k = 1; k < p; k++)
10889 for (
int j = 1; j < p; j++)
10890 for (
int i = 0; i < p; i++)
10892 dof_map[0*dof3 + i + (j + k*(p + 1))*p] = o++;
10895 for (
int k = 1; k < p; k++)
10896 for (
int j = 0; j < p; j++)
10897 for (
int i = 1; i < p; i++)
10899 dof_map[1*dof3 + i + (j + k*p)*(p + 1)] = o++;
10902 for (
int k = 0; k < p; k++)
10903 for (
int j = 1; j < p; j++)
10904 for (
int i = 1; i < p; i++)
10906 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
10912 for (
int k = 0; k <= p; k++)
10913 for (
int j = 0; j <= p; j++)
10914 for (
int i = 0; i < p; i++)
10917 if ((idx = dof_map[o++]) < 0)
10919 dof2tk[idx = -1 - idx] = 3;
10928 for (
int k = 0; k <= p; k++)
10929 for (
int j = 0; j < p; j++)
10930 for (
int i = 0; i <= p; i++)
10933 if ((idx = dof_map[o++]) < 0)
10935 dof2tk[idx = -1 - idx] = 4;
10944 for (
int k = 0; k < p; k++)
10945 for (
int j = 0; j <= p; j++)
10946 for (
int i = 0; i <= p; i++)
10949 if ((idx = dof_map[o++]) < 0)
10951 dof2tk[idx = -1 - idx] = 5;
10964 const int p =
Order;
10966 #ifdef MFEM_THREAD_SAFE
10967 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
10968 Vector shape_cz(p + 1), shape_oz(p);
10971 cbasis1d.
Eval(ip.
x, shape_cx);
10972 obasis1d.
Eval(ip.
x, shape_ox);
10973 cbasis1d.
Eval(ip.
y, shape_cy);
10974 obasis1d.
Eval(ip.
y, shape_oy);
10975 cbasis1d.
Eval(ip.
z, shape_cz);
10976 obasis1d.
Eval(ip.
z, shape_oz);
10980 for (
int k = 0; k <= p; k++)
10981 for (
int j = 0; j <= p; j++)
10982 for (
int i = 0; i < p; i++)
10985 if ((idx = dof_map[o++]) < 0)
10987 idx = -1 - idx, s = -1;
10993 shape(idx,0) = s*shape_ox(i)*shape_cy(j)*shape_cz(k);
10998 for (
int k = 0; k <= p; k++)
10999 for (
int j = 0; j < p; j++)
11000 for (
int i = 0; i <= p; i++)
11003 if ((idx = dof_map[o++]) < 0)
11005 idx = -1 - idx, s = -1;
11012 shape(idx,1) = s*shape_cx(i)*shape_oy(j)*shape_cz(k);
11016 for (
int k = 0; k < p; k++)
11017 for (
int j = 0; j <= p; j++)
11018 for (
int i = 0; i <= p; i++)
11021 if ((idx = dof_map[o++]) < 0)
11023 idx = -1 - idx, s = -1;
11031 shape(idx,2) = s*shape_cx(i)*shape_cy(j)*shape_oz(k);
11038 const int p =
Order;
11040 #ifdef MFEM_THREAD_SAFE
11041 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11042 Vector shape_cz(p + 1), shape_oz(p);
11043 Vector dshape_cx(p + 1), dshape_cy(p + 1), dshape_cz(p + 1);
11046 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
11047 obasis1d.
Eval(ip.
x, shape_ox);
11048 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
11049 obasis1d.
Eval(ip.
y, shape_oy);
11050 cbasis1d.
Eval(ip.
z, shape_cz, dshape_cz);
11051 obasis1d.
Eval(ip.
z, shape_oz);
11055 for (
int k = 0; k <= p; k++)
11056 for (
int j = 0; j <= p; j++)
11057 for (
int i = 0; i < p; i++)
11060 if ((idx = dof_map[o++]) < 0)
11062 idx = -1 - idx, s = -1;
11068 curl_shape(idx,0) = 0.;
11069 curl_shape(idx,1) = s*shape_ox(i)* shape_cy(j)*dshape_cz(k);
11070 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j)* shape_cz(k);
11073 for (
int k = 0; k <= p; k++)
11074 for (
int j = 0; j < p; j++)
11075 for (
int i = 0; i <= p; i++)
11078 if ((idx = dof_map[o++]) < 0)
11080 idx = -1 - idx, s = -1;
11086 curl_shape(idx,0) = -s* shape_cx(i)*shape_oy(j)*dshape_cz(k);
11087 curl_shape(idx,1) = 0.;
11088 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j)* shape_cz(k);
11091 for (
int k = 0; k < p; k++)
11092 for (
int j = 0; j <= p; j++)
11093 for (
int i = 0; i <= p; i++)
11096 if ((idx = dof_map[o++]) < 0)
11098 idx = -1 - idx, s = -1;
11104 curl_shape(idx,0) = s* shape_cx(i)*dshape_cy(j)*shape_oz(k);
11105 curl_shape(idx,1) = -s*dshape_cx(i)* shape_cy(j)*shape_oz(k);
11106 curl_shape(idx,2) = 0.;
11111 const double ND_QuadrilateralElement::tk[8] =
11112 { 1.,0., 0.,1., -1.,0., 0.,-1. };
11119 cbasis1d(
poly1d.GetBasis(p, VerifyClosed(cb_type))),
11120 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(ob_type))),
11121 dof_map(Dof), dof2tk(Dof)
11125 const int dof2 =
Dof/2;
11127 #ifndef MFEM_THREAD_SAFE
11138 for (
int i = 0; i < p; i++)
11140 dof_map[0*dof2 + i + 0*p] = o++;
11142 for (
int j = 0; j < p; j++)
11144 dof_map[1*dof2 + p + j*(p + 1)] = o++;
11146 for (
int i = 0; i < p; i++)
11148 dof_map[0*dof2 + (p - 1 - i) + p*p] = -1 - (o++);
11150 for (
int j = 0; j < p; j++)
11152 dof_map[1*dof2 + 0 + (p - 1 - j)*(p + 1)] = -1 - (o++);
11157 for (
int j = 1; j < p; j++)
11158 for (
int i = 0; i < p; i++)
11160 dof_map[0*dof2 + i + j*p] = o++;
11163 for (
int j = 0; j < p; j++)
11164 for (
int i = 1; i < p; i++)
11166 dof_map[1*dof2 + i + j*(p + 1)] = o++;
11172 for (
int j = 0; j <= p; j++)
11173 for (
int i = 0; i < p; i++)
11176 if ((idx = dof_map[o++]) < 0)
11178 dof2tk[idx = -1 - idx] = 2;
11187 for (
int j = 0; j < p; j++)
11188 for (
int i = 0; i <= p; i++)
11191 if ((idx = dof_map[o++]) < 0)
11193 dof2tk[idx = -1 - idx] = 3;
11206 const int p =
Order;
11208 #ifdef MFEM_THREAD_SAFE
11209 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11212 cbasis1d.
Eval(ip.
x, shape_cx);
11213 obasis1d.
Eval(ip.
x, shape_ox);
11214 cbasis1d.
Eval(ip.
y, shape_cy);
11215 obasis1d.
Eval(ip.
y, shape_oy);
11219 for (
int j = 0; j <= p; j++)
11220 for (
int i = 0; i < p; i++)
11223 if ((idx = dof_map[o++]) < 0)
11225 idx = -1 - idx, s = -1;
11231 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
11235 for (
int j = 0; j < p; j++)
11236 for (
int i = 0; i <= p; i++)
11239 if ((idx = dof_map[o++]) < 0)
11241 idx = -1 - idx, s = -1;
11248 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
11255 const int p =
Order;
11257 #ifdef MFEM_THREAD_SAFE
11258 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11259 Vector dshape_cx(p + 1), dshape_cy(p + 1);
11262 cbasis1d.
Eval(ip.
x, shape_cx, dshape_cx);
11263 obasis1d.
Eval(ip.
x, shape_ox);
11264 cbasis1d.
Eval(ip.
y, shape_cy, dshape_cy);
11265 obasis1d.
Eval(ip.
y, shape_oy);
11269 for (
int j = 0; j <= p; j++)
11270 for (
int i = 0; i < p; i++)
11273 if ((idx = dof_map[o++]) < 0)
11275 idx = -1 - idx, s = -1;
11281 curl_shape(idx,0) = -s*shape_ox(i)*dshape_cy(j);
11284 for (
int j = 0; j < p; j++)
11285 for (
int i = 0; i <= p; i++)
11288 if ((idx = dof_map[o++]) < 0)
11290 idx = -1 - idx, s = -1;
11296 curl_shape(idx,0) = s*dshape_cx(i)*shape_oy(j);
11301 const double ND_TetrahedronElement::tk[18] =
11302 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,1.,0., -1.,0.,1., 0.,-1.,1. };
11304 const double ND_TetrahedronElement::c = 1./4.;
11314 const int pm1 = p - 1, pm2 = p - 2, pm3 = p - 3;
11316 #ifndef MFEM_THREAD_SAFE
11327 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11332 for (
int i = 0; i < p; i++)
11337 for (
int i = 0; i < p; i++)
11342 for (
int i = 0; i < p; i++)
11347 for (
int i = 0; i < p; i++)
11352 for (
int i = 0; i < p; i++)
11357 for (
int i = 0; i < p; i++)
11364 for (
int j = 0; j <= pm2; j++)
11365 for (
int i = 0; i + j <= pm2; i++)
11367 double w = fop[i] + fop[j] + fop[pm2-i-j];
11373 for (
int j = 0; j <= pm2; j++)
11374 for (
int i = 0; i + j <= pm2; i++)
11376 double w = fop[i] + fop[j] + fop[pm2-i-j];
11382 for (
int j = 0; j <= pm2; j++)
11383 for (
int i = 0; i + j <= pm2; i++)
11385 double w = fop[i] + fop[j] + fop[pm2-i-j];
11391 for (
int j = 0; j <= pm2; j++)
11392 for (
int i = 0; i + j <= pm2; i++)
11394 double w = fop[i] + fop[j] + fop[pm2-i-j];
11402 for (
int k = 0; k <= pm3; k++)
11403 for (
int j = 0; j + k <= pm3; j++)
11404 for (
int i = 0; i + j + k <= pm3; i++)
11406 double w = iop[i] + iop[j] + iop[k] + iop[pm3-i-j-k];
11416 for (
int m = 0; m <
Dof; m++)
11419 const double *tm = tk + 3*dof2tk[m];
11427 for (
int k = 0; k <= pm1; k++)
11428 for (
int j = 0; j + k <= pm1; j++)
11429 for (
int i = 0; i + j + k <= pm1; i++)
11431 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
11432 T(o++, m) = s * tm[0];
11433 T(o++, m) = s * tm[1];
11434 T(o++, m) = s * tm[2];
11436 for (
int k = 0; k <= pm1; k++)
11437 for (
int j = 0; j + k <= pm1; j++)
11439 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
11440 T(o++, m) = s*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
11441 T(o++, m) = s*((ip.
z - c)*tm[0] - (ip.
x - c)*tm[2]);
11443 for (
int k = 0; k <= pm1; k++)
11446 shape_y(pm1-k)*shape_z(k)*((ip.
z - c)*tm[1] - (ip.
y - c)*tm[2]);
11457 const int pm1 =
Order - 1;
11459 #ifdef MFEM_THREAD_SAFE
11460 const int p =
Order;
11461 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11471 for (
int k = 0; k <= pm1; k++)
11472 for (
int j = 0; j + k <= pm1; j++)
11473 for (
int i = 0; i + j + k <= pm1; i++)
11475 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
11476 u(n,0) = s; u(n,1) = 0.; u(n,2) = 0.; n++;
11477 u(n,0) = 0.; u(n,1) = s; u(n,2) = 0.; n++;
11478 u(n,0) = 0.; u(n,1) = 0.; u(n,2) = s; n++;
11480 for (
int k = 0; k <= pm1; k++)
11481 for (
int j = 0; j + k <= pm1; j++)
11483 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
11484 u(n,0) = s*(ip.
y - c); u(n,1) = -s*(ip.
x - c); u(n,2) = 0.; n++;
11485 u(n,0) = s*(ip.
z - c); u(n,1) = 0.; u(n,2) = -s*(ip.
x - c); n++;
11487 for (
int k = 0; k <= pm1; k++)
11489 double s = shape_y(pm1-k)*shape_z(k);
11490 u(n,0) = 0.; u(n,1) = s*(ip.
z - c); u(n,2) = -s*(ip.
y - c); n++;
11499 const int pm1 =
Order - 1;
11501 #ifdef MFEM_THREAD_SAFE
11502 const int p =
Order;
11503 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
11504 Vector dshape_x(p), dshape_y(p), dshape_z(p), dshape_l(p);
11514 for (
int k = 0; k <= pm1; k++)
11515 for (
int j = 0; j + k <= pm1; j++)
11516 for (
int i = 0; i + j + k <= pm1; i++)
11519 const double dx = (dshape_x(i)*shape_l(l) -
11520 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
11521 const double dy = (dshape_y(j)*shape_l(l) -
11522 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
11523 const double dz = (dshape_z(k)*shape_l(l) -
11524 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
11526 u(n,0) = 0.; u(n,1) = dz; u(n,2) = -dy; n++;
11527 u(n,0) = -dz; u(n,1) = 0.; u(n,2) = dx; n++;
11528 u(n,0) = dy; u(n,1) = -dx; u(n,2) = 0.; n++;
11530 for (
int k = 0; k <= pm1; k++)
11531 for (
int j = 0; j + k <= pm1; j++)
11533 int i = pm1 - j - k;
11536 u(n,0) = shape_x(i)*(ip.
x - c)*shape_y(j)*dshape_z(k);
11537 u(n,1) = shape_x(i)*shape_y(j)*(ip.
y - c)*dshape_z(k);
11539 -((dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k) +
11540 (dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_x(i)*shape_z(k));
11543 u(n,0) = -shape_x(i)*(ip.
x - c)*dshape_y(j)*shape_z(k);
11544 u(n,1) = (shape_x(i)*shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)) +
11545 (dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k));
11546 u(n,2) = -shape_x(i)*dshape_y(j)*shape_z(k)*(ip.
z - c);
11549 for (
int k = 0; k <= pm1; k++)
11553 u(n,0) = -((dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_z(k) +
11554 shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)));
11559 Ti.
Mult(u, curl_shape);
11563 const double ND_TriangleElement::tk[8] =
11564 { 1.,0., -1.,1., 0.,-1., 0.,1. };
11566 const double ND_TriangleElement::c = 1./3.;
11576 const int pm1 = p - 1, pm2 = p - 2;
11578 #ifndef MFEM_THREAD_SAFE
11588 Vector shape_x(p), shape_y(p), shape_l(p);
11593 for (
int i = 0; i < p; i++)
11598 for (
int i = 0; i < p; i++)
11603 for (
int i = 0; i < p; i++)
11610 for (
int j = 0; j <= pm2; j++)
11611 for (
int i = 0; i + j <= pm2; i++)
11613 double w = iop[i] + iop[j] + iop[pm2-i-j];
11621 for (
int m = 0; m <
Dof; m++)
11624 const double *tm = tk + 2*dof2tk[m];
11631 for (
int j = 0; j <= pm1; j++)
11632 for (
int i = 0; i + j <= pm1; i++)
11634 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
11635 T(n++, m) = s * tm[0];
11636 T(n++, m) = s * tm[1];
11638 for (
int j = 0; j <= pm1; j++)
11641 shape_x(pm1-j)*shape_y(j)*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
11652 const int pm1 =
Order - 1;
11654 #ifdef MFEM_THREAD_SAFE
11655 const int p =
Order;
11656 Vector shape_x(p), shape_y(p), shape_l(p);
11665 for (
int j = 0; j <= pm1; j++)
11666 for (
int i = 0; i + j <= pm1; i++)
11668 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
11669 u(n,0) = s; u(n,1) = 0; n++;
11670 u(n,0) = 0; u(n,1) = s; n++;
11672 for (
int j = 0; j <= pm1; j++)
11674 double s = shape_x(pm1-j)*shape_y(j);
11675 u(n,0) = s*(ip.
y - c);
11676 u(n,1) = -s*(ip.
x - c);
11686 const int pm1 =
Order - 1;
11688 #ifdef MFEM_THREAD_SAFE
11689 const int p =
Order;
11690 Vector shape_x(p), shape_y(p), shape_l(p);
11691 Vector dshape_x(p), dshape_y(p), dshape_l(p);
11700 for (
int j = 0; j <= pm1; j++)
11701 for (
int i = 0; i + j <= pm1; i++)
11704 const double dx = (dshape_x(i)*shape_l(l) -
11705 shape_x(i)*dshape_l(l)) * shape_y(j);
11706 const double dy = (dshape_y(j)*shape_l(l) -
11707 shape_y(j)*dshape_l(l)) * shape_x(i);
11713 for (
int j = 0; j <= pm1; j++)
11717 curlu(n++) = -((dshape_x(i)*(ip.
x - c) + shape_x(i)) * shape_y(j) +
11718 (dshape_y(j)*(ip.
y - c) + shape_y(j)) * shape_x(i));
11722 Ti.
Mult(curlu, curl2d);
11726 const double ND_SegmentElement::tk[1] = { 1. };
11731 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(ob_type))),
11737 for (
int i = 0; i < p; i++)
11764 kv[0]->CalcShape(shape,
ijk[0], ip.
x);
11767 for (
int i = 0; i <=
Order; i++)
11769 sum += (shape(i) *=
weights(i));
11781 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
11783 double sum = 0.0, dsum = 0.0;
11784 for (
int i = 0; i <=
Order; i++)
11787 dsum += ( grad(i) *=
weights(i));
11791 add(sum, grad, -dsum*sum*sum,
shape_x, grad);
11816 for (
int o = 0, j = 0; j <=
Orders[1]; j++)
11818 const double sy =
shape_y(j);
11819 for (
int i = 0; i <=
Orders[0]; i++, o++)
11831 double sum, dsum[2];
11839 sum = dsum[0] = dsum[1] = 0.0;
11840 for (
int o = 0, j = 0; j <=
Orders[1]; j++)
11843 for (
int i = 0; i <=
Orders[0]; i++, o++)
11853 dsum[0] *= sum*sum;
11854 dsum[1] *= sum*sum;
11856 for (
int o = 0; o <
Dof; o++)
11858 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
11859 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
11891 for (
int o = 0, k = 0; k <=
Orders[2]; k++)
11893 const double sz =
shape_z(k);
11894 for (
int j = 0; j <=
Orders[1]; j++)
11896 const double sy_sz =
shape_y(j)*sz;
11897 for (
int i = 0; i <=
Orders[0]; i++, o++)
11910 double sum, dsum[3];
11920 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
11921 for (
int o = 0, k = 0; k <=
Orders[2]; k++)
11924 for (
int j = 0; j <=
Orders[1]; j++)
11926 const double sy_sz =
shape_y(j)* sz;
11927 const double dsy_sz =
dshape_y(j)* sz;
11928 const double sy_dsz =
shape_y(j)*dsz;
11929 for (
int i = 0; i <=
Orders[0]; i++, o++)
11941 dsum[0] *= sum*sum;
11942 dsum[1] *= sum*sum;
11943 dsum[2] *= sum*sum;
11945 for (
int o = 0; o <
Dof; o++)
11947 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
11948 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
11949 dshape(o,2) = dshape(o,2)*sum -
u(o)*dsum[2];
int GetNPoints() const
Returns the number of the points in the integration rule.
Implements CalcDivShape methods.
Abstract class for Finite Elements.
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
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.
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.
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...
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()
For scalar fields; preserves volume integrals.
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.
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
Geometry::Type GeomType
Geometry::Type of the reference element.
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 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
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 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
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)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
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
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.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
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...
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...
void SetSize(int m, int n)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat)
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void CalcAdjugateTranspose(const DenseMatrix &a, DenseMatrix &adjat)
Calculate the transposed adjugate of a matrix (for NxN matrices, N=1,2,3)
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
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...
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.
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...
void SetRow(int r, const Vector &row)
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
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
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 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...
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
Array< double > B
Basis functions evaluated at quadrature points.
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...
No derivatives implemented.
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)
Implements CalcCurlShape methods.
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.
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 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...
For scalar fields; preserves point values.
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
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...
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...
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