16 #include "../mesh/nurbs.hpp"
35 #ifndef MFEM_THREAD_SAFE
43 mfem_error (
"FiniteElement::CalcVShape (ip, ...)\n"
44 " is not implemented for this class!");
50 mfem_error (
"FiniteElement::CalcVShape (trans, ...)\n"
51 " is not implemented for this class!");
57 mfem_error (
"FiniteElement::CalcDivShape (ip, ...)\n"
58 " is not implemented for this class!");
65 div_shape *= (1.0 / Trans.
Weight());
71 mfem_error (
"FiniteElement::CalcCurlShape (ip, ...)\n"
72 " is not implemented for this class!");
82 #ifdef MFEM_THREAD_SAFE
87 curl_shape *= (1.0 / Trans.
Weight());
93 curl_shape *= (1.0 / Trans.
Weight());
96 MFEM_ABORT(
"Invalid dimension, Dim = " <<
Dim);
102 mfem_error (
"FiniteElement::GetFaceDofs (...)");
108 mfem_error (
"FiniteElement::CalcHessian (...) is not overloaded !");
114 mfem_error (
"GetLocalInterpolation (...) is not overloaded !");
120 mfem_error(
"FiniteElement::GetLocalRestriction() is not overloaded !");
127 MFEM_ABORT(
"method is not overloaded !");
133 mfem_error (
"FiniteElement::Project (...) is not overloaded !");
139 mfem_error (
"FiniteElement::Project (...) (vector) is not overloaded !");
145 mfem_error(
"FiniteElement::ProjectMatrixCoefficient() is not overloaded !");
150 mfem_error(
"FiniteElement::ProjectDelta(...) is not implemented for "
157 mfem_error(
"FiniteElement::Project(...) (fe version) is not implemented "
158 "for this element!");
165 mfem_error(
"FiniteElement::ProjectGrad(...) is not implemented for "
173 mfem_error(
"FiniteElement::ProjectCurl(...) is not implemented for "
181 mfem_error(
"FiniteElement::ProjectDiv(...) is not implemented for "
199 #ifdef MFEM_THREAD_SAFE
219 int size = (
Dim*(
Dim+1))/2;
225 for (
int nd = 0; nd <
Dof; nd++)
227 Laplacian[nd] = hess(nd,0) + hess(nd,4) + hess(nd,5);
232 for (
int nd = 0; nd <
Dof; nd++)
234 Laplacian[nd] = hess(nd,0) + hess(nd,2);
239 for (
int nd = 0; nd <
Dof; nd++)
241 Laplacian[nd] = hess(nd,0);
252 int size = (
Dim*(
Dim+1))/2;
263 scale[1] = 2*Gij(0,1);
264 scale[2] = 2*Gij(0,2);
266 scale[3] = 2*Gij(1,2);
274 scale[1] = 2*Gij(0,1);
282 for (
int nd = 0; nd <
Dof; nd++)
285 for (
int ii = 0; ii < size; ii++)
287 Laplacian[nd] += hess(nd,ii)*scale[ii];
328 int size = (Dim*(Dim+1))/2;
346 for (
int i = 0; i <
Dim; i++)
348 for (
int j = 0; j <
Dim; j++)
350 for (
int k = 0; k <
Dim; k++)
352 for (
int l = 0; l <
Dim; l++)
354 lhm(map[i*Dim+j],map[k*Dim+l]) += invJ(i,k)*invJ(j,l);
362 for (
int i = 0; i < Dim*
Dim; i++) { mult[map[i]]++; }
367 Mult( hess, lhm, Hessian);
373 mfem_error(
"FiniteElement::GetDofToQuad(...) is not implemented for "
395 #ifdef MFEM_THREAD_SAFE
402 for (
int i = 0; i < fine_fe.
Dof; i++)
407 for (
int j = 0; j <
Dof; j++)
408 if (fabs(I(i,j) =
c_shape(j)) < 1.0e-12)
433 Vector fine_shape(fs), coarse_shape(cs);
434 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
451 fine_mass_inv.
Mult(fine_coarse_mass, I);
469 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
483 #ifdef MFEM_THREAD_SAFE
487 for (
int i = 0; i < nqpt; i++)
491 for (
int j = 0; j <
Dof; j++)
493 d2q->
B[i+nqpt*j] = d2q->
Bt[j+Dof*i] =
c_shape(j);
496 for (
int d = 0; d <
Dim; d++)
498 for (
int j = 0; j <
Dof; j++)
500 d2q->
G[i+nqpt*(d+Dim*j)] = d2q->
Gt[j+Dof*(i+nqpt*d)] =
vshape(j,d);
518 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
523 const int ndof =
Order + 1;
524 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
Dim) + 0.5);
534 Vector val(ndof), grad(ndof);
535 for (
int i = 0; i < nqpt; i++)
540 for (
int j = 0; j < ndof; j++)
542 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
543 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
560 for (
int i = 0; i <
Dof; i++)
563 for (
int j = 0; j < fe.
GetDof(); j++)
565 curl(i,j) = curl_shape(j,0);
592 #ifdef MFEM_THREAD_SAFE
598 for (
int j = 0; j <
Dof; j++)
618 for (
int i = 0; i <
Dof; i++)
624 dofs(i) = coeff.
Eval (Trans, ip);
627 dofs(i) *= Trans.
Weight();
638 for (
int i = 0; i <
Dof; i++)
642 vc.
Eval (x, Trans, ip);
647 for (
int j = 0; j < x.Size(); j++)
649 dofs(Dof*j+i) = x(j);
661 for (
int k = 0; k <
Dof; k++)
666 for (
int r = 0; r < MQ.Height(); r++)
668 for (
int d = 0; d < MQ.Width(); d++)
670 dofs(k+Dof*(d+MQ.Width()*r)) = MQ(r,d);
686 for (
int k = 0; k <
Dof; k++)
689 for (
int j = 0; j < shape.Size(); j++)
691 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
700 for (
int k = 0; k <
Dof; k++)
711 I(k+d*Dof,j) =
vshape(j,d);
727 for (
int k = 0; k <
Dof; k++)
733 Mult(dshape, Jinv, grad_k);
738 for (
int j = 0; j < grad_k.Height(); j++)
739 for (
int d = 0; d <
Dim; d++)
741 grad(k+d*Dof,j) = grad_k(j,d);
754 for (
int k = 0; k <
Dof; k++)
762 for (
int j = 0; j < div_shape.Size(); j++)
764 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j)/detJ;
769 for (
int j = 0; j < div_shape.Size(); j++)
771 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j);
781 for (
int i = 0; i <
Dof; i++)
785 dofs(i) = coeff.
Eval(Trans, ip);
795 for (
int i = 0; i <
Dof; i++)
799 vc.
Eval (x, Trans, ip);
800 for (
int j = 0; j < x.Size(); j++)
802 dofs(Dof*j+i) = x(j);
829 pos_mass_inv.
Mult(mixed_mass, I);
834 void VectorFiniteElement::CalcShape (
837 mfem_error (
"Error: Cannot use scalar CalcShape(...) function with\n"
838 " VectorFiniteElements!");
841 void VectorFiniteElement::CalcDShape (
842 const IntegrationPoint &ip, DenseMatrix &dshape )
const
844 mfem_error (
"Error: Cannot use scalar CalcDShape(...) function with\n"
845 " VectorFiniteElements!");
877 MFEM_ABORT(
"Invalid dimension, Dim = " <<
Dim);
881 MFEM_ABORT(
"Invalid MapType = " <<
MapType);
889 #ifdef MFEM_THREAD_SAFE
894 shape *= (1.0 / Trans.
Weight());
901 #ifdef MFEM_THREAD_SAFE
914 MFEM_ASSERT(vc.
GetVDim() == sdim,
"");
916 const bool square_J = (
Dim == sdim);
918 for (
int k = 0; k <
Dof; k++)
924 if (!square_J) { dofs(k) /= Trans.
Weight(); }
935 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
936 const bool square_J = (
Dim == sdim);
938 Vector nk_phys(sdim), dofs_k(MQ.Height());
939 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
941 for (
int k = 0; k <
Dof; k++)
947 if (!square_J) { nk_phys /= T.
Weight(); }
948 MQ.Mult(nk_phys, dofs_k);
949 for (
int r = 0; r < MQ.Height(); r++)
951 dofs(k+Dof*r) = dofs_k(r);
967 for (
int k = 0; k <
Dof; k++)
976 double w = 1.0/Trans.
Weight();
977 for (
int d = 0; d <
Dim; d++)
983 for (
int j = 0; j < shape.Size(); j++)
990 for (
int d = 0; d < sdim; d++)
992 I(k,j+d*shape.Size()) = s*vk[d];
999 mfem_error(
"VectorFiniteElement::Project_RT (fe version)");
1009 mfem_error(
"VectorFiniteElement::ProjectGrad_RT works only in 2D!");
1017 for (
int k = 0; k <
Dof; k++)
1020 tk[0] = nk[d2n[k]*
Dim+1];
1021 tk[1] = -nk[d2n[k]*
Dim];
1022 dshape.Mult(tk, grad_k);
1023 for (
int j = 0; j < grad_k.Size(); j++)
1025 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1034 #ifdef MFEM_THREAD_SAFE
1047 for (
int k = 0; k <
Dof; k++)
1054 J *= 1.0 / Trans.
Weight();
1061 for (
int j = 0; j < curl_k.Size(); j++)
1063 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1076 for (
int k = 0; k <
Dof; k++)
1079 curl_shape.Mult(nk + d2n[k]*
Dim, curl_k);
1080 for (
int j = 0; j < curl_k.Size(); j++)
1082 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1094 for (
int k = 0; k <
Dof; k++)
1111 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
1113 Vector tk_phys(sdim), dofs_k(MQ.Height());
1114 MFEM_ASSERT(dofs.
Size() ==
Dof*MQ.Height(),
"");
1116 for (
int k = 0; k <
Dof; k++)
1122 MQ.Mult(tk_phys, dofs_k);
1123 for (
int r = 0; r < MQ.Height(); r++)
1125 dofs(k+Dof*r) = dofs_k(r);
1141 for (
int k = 0; k <
Dof; k++)
1150 double w = 1.0/Trans.
Weight();
1151 for (
int d = 0; d < sdim; d++)
1157 for (
int j = 0; j < shape.Size(); j++)
1159 double s = shape(j);
1160 if (fabs(s) < 1e-12)
1164 for (
int d = 0; d < sdim; d++)
1166 I(k, j + d*shape.Size()) = s*vk[d];
1173 mfem_error(
"VectorFiniteElement::Project_ND (fe version)");
1187 for (
int k = 0; k <
Dof; k++)
1190 dshape.Mult(tk + d2t[k]*
Dim, grad_k);
1191 for (
int j = 0; j < grad_k.Size(); j++)
1193 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1207 #ifdef MFEM_THREAD_SAFE
1217 for (
int k = 0; k <
Dof; k++)
1228 for (
int i = 0; i <
Dim; i++)
1230 Ikj +=
vshape(j, i) * vk[i];
1232 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1244 #ifdef MFEM_THREAD_SAFE
1254 for (
int k = 0; k <
Dof; k++)
1265 for (
int i = 0; i <
Dim; i++)
1267 Ikj +=
vshape(j, i) * vk[i];
1269 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1282 #ifdef MFEM_THREAD_SAFE
1288 const double weight = Trans.
Weight();
1289 for (
int j = 0; j <
Dof; j++)
1298 for (
int k = 0; k <
Dof; k++)
1301 for (
int d = 0; d <
Dim; d++)
1303 R_jk +=
vshape(k,d)*pt_data[d];
1325 #ifdef MFEM_THREAD_SAFE
1331 for (
int j = 0; j <
Dof; j++)
1338 Jinv.
Mult(tk+
Dim*d2t[j], pt_data);
1339 for (
int k = 0; k <
Dof; k++)
1342 for (
int d = 0; d <
Dim; d++)
1344 R_jk +=
vshape(k,d)*pt_data[d];
1387 shape(0) = 1. - ip.
x;
1412 shape(0) = 1. - ip.
x - ip.
y;
1420 dshape(0,0) = -1.; dshape(0,1) = -1.;
1421 dshape(1,0) = 1.; dshape(1,1) = 0.;
1422 dshape(2,0) = 0.; dshape(2,1) = 1.;
1441 shape(0) = (1. - ip.
x) * (1. - ip.
y) ;
1442 shape(1) = ip.
x * (1. - ip.
y) ;
1443 shape(2) = ip.
x * ip.
y ;
1444 shape(3) = (1. - ip.
x) * ip.
y ;
1450 dshape(0,0) = -1. + ip.
y; dshape(0,1) = -1. + ip.
x ;
1451 dshape(1,0) = 1. - ip.
y; dshape(1,1) = -ip.
x ;
1452 dshape(2,0) = ip.
y ; dshape(2,1) = ip.
x ;
1453 dshape(3,0) = -ip.
y ; dshape(3,1) = 1. - ip.
x ;
1459 h(0,0) = 0.; h(0,1) = 1.; h(0,2) = 0.;
1460 h(1,0) = 0.; h(1,1) = -1.; h(1,2) = 0.;
1461 h(2,0) = 0.; h(2,1) = 1.; h(2,2) = 0.;
1462 h(3,0) = 0.; h(3,1) = -1.; h(3,2) = 0.;
1480 const double x = ip.
x, y = ip.
y;
1482 shape(0) = 5./3. - 2. * (x + y);
1483 shape(1) = 2. * (x - 1./6.);
1484 shape(2) = 2. * (y - 1./6.);
1490 dshape(0,0) = -2.; dshape(0,1) = -2.;
1491 dshape(1,0) = 2.; dshape(1,1) = 0.;
1492 dshape(2,0) = 0.; dshape(2,1) = 2.;
1497 dofs(vertex) = 2./3.;
1498 dofs((vertex+1)%3) = 1./6.;
1499 dofs((vertex+2)%3) = 1./6.;
1504 const double GaussBiLinear2DFiniteElement::p[] =
1505 { 0.2113248654051871177454256, 0.7886751345948128822545744 };
1523 const double x = ip.
x, y = ip.
y;
1525 shape(0) = 3. * (p[1] - x) * (p[1] - y);
1526 shape(1) = 3. * (x - p[0]) * (p[1] - y);
1527 shape(2) = 3. * (x - p[0]) * (y - p[0]);
1528 shape(3) = 3. * (p[1] - x) * (y - p[0]);
1534 const double x = ip.
x, y = ip.
y;
1536 dshape(0,0) = 3. * (y - p[1]); dshape(0,1) = 3. * (x - p[1]);
1537 dshape(1,0) = 3. * (p[1] - y); dshape(1,1) = 3. * (p[0] - x);
1538 dshape(2,0) = 3. * (y - p[0]); dshape(2,1) = 3. * (x - p[0]);
1539 dshape(3,0) = 3. * (p[0] - y); dshape(3,1) = 3. * (p[1] - x);
1545 dofs(vertex) = p[1]*p[1];
1546 dofs((vertex+1)%4) = p[0]*p[1];
1547 dofs((vertex+2)%4) = p[0]*p[0];
1548 dofs((vertex+3)%4) = p[0]*p[1];
1569 shape(0) = 1. - ip.
x - ip.
y;
1577 dshape(0,0) = -1.; dshape(0,1) = -1.;
1578 dshape(1,0) = 1.; dshape(1,1) = 0.;
1579 dshape(2,0) = 0.; dshape(2,1) = 1.;
1595 double l1 = 1.0 - x, l2 = x, l3 = 2. * x - 1.;
1597 shape(0) = l1 * (-l3);
1599 shape(2) = 4. * l1 * l2;
1607 dshape(0,0) = 4. * x - 3.;
1608 dshape(1,0) = 4. * x - 1.;
1609 dshape(2,0) = 4. - 8. * x;
1624 const double x = ip.
x, x1 = 1. - x;
1628 shape(2) = 2. * x * x1;
1634 const double x = ip.
x;
1636 dshape(0,0) = 2. * x - 2.;
1637 dshape(1,0) = 2. * x;
1638 dshape(2,0) = 2. - 4. * x;
1661 double x = ip.
x, y = ip.
y;
1662 double l1 = 1.-x-y, l2 = x, l3 = y;
1664 shape(0) = l1 * (2. * l1 - 1.);
1665 shape(1) = l2 * (2. * l2 - 1.);
1666 shape(2) = l3 * (2. * l3 - 1.);
1667 shape(3) = 4. * l1 * l2;
1668 shape(4) = 4. * l2 * l3;
1669 shape(5) = 4. * l3 * l1;
1675 double x = ip.
x, y = ip.
y;
1678 dshape(0,1) = 4. * (x + y) - 3.;
1680 dshape(1,0) = 4. * x - 1.;
1684 dshape(2,1) = 4. * y - 1.;
1686 dshape(3,0) = -4. * (2. * x + y - 1.);
1687 dshape(3,1) = -4. * x;
1689 dshape(4,0) = 4. * y;
1690 dshape(4,1) = 4. * x;
1692 dshape(5,0) = -4. * y;
1693 dshape(5,1) = -4. * (x + 2. * y - 1.);
1733 case 0: dofs(3) = 0.25; dofs(5) = 0.25;
break;
1734 case 1: dofs(3) = 0.25; dofs(4) = 0.25;
break;
1735 case 2: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1741 const double GaussQuad2DFiniteElement::p[] =
1742 { 0.0915762135097707434595714634022015, 0.445948490915964886318329253883051 };
1760 for (
int i = 0; i < 6; i++)
1777 const double x = ip.
x, y = ip.
y;
1791 const double x = ip.
x, y = ip.
y;
1792 D(0,0) = 0.; D(0,1) = 0.;
1793 D(1,0) = 1.; D(1,1) = 0.;
1794 D(2,0) = 0.; D(2,1) = 1.;
1795 D(3,0) = 2. * x; D(3,1) = 0.;
1796 D(4,0) = y; D(4,1) = x;
1797 D(5,0) = 0.; D(5,1) = 2. * y;
1829 double x = ip.
x, y = ip.
y;
1830 double l1x, l2x, l3x, l1y, l2y, l3y;
1832 l1x = (x - 1.) * (2. * x - 1);
1833 l2x = 4. * x * (1. - x);
1834 l3x = x * (2. * x - 1.);
1835 l1y = (y - 1.) * (2. * y - 1);
1836 l2y = 4. * y * (1. - y);
1837 l3y = y * (2. * y - 1.);
1839 shape(0) = l1x * l1y;
1840 shape(4) = l2x * l1y;
1841 shape(1) = l3x * l1y;
1842 shape(7) = l1x * l2y;
1843 shape(8) = l2x * l2y;
1844 shape(5) = l3x * l2y;
1845 shape(3) = l1x * l3y;
1846 shape(6) = l2x * l3y;
1847 shape(2) = l3x * l3y;
1853 double x = ip.
x, y = ip.
y;
1854 double l1x, l2x, l3x, l1y, l2y, l3y;
1855 double d1x, d2x, d3x, d1y, d2y, d3y;
1857 l1x = (x - 1.) * (2. * x - 1);
1858 l2x = 4. * x * (1. - x);
1859 l3x = x * (2. * x - 1.);
1860 l1y = (y - 1.) * (2. * y - 1);
1861 l2y = 4. * y * (1. - y);
1862 l3y = y * (2. * y - 1.);
1871 dshape(0,0) = d1x * l1y;
1872 dshape(0,1) = l1x * d1y;
1874 dshape(4,0) = d2x * l1y;
1875 dshape(4,1) = l2x * d1y;
1877 dshape(1,0) = d3x * l1y;
1878 dshape(1,1) = l3x * d1y;
1880 dshape(7,0) = d1x * l2y;
1881 dshape(7,1) = l1x * d2y;
1883 dshape(8,0) = d2x * l2y;
1884 dshape(8,1) = l2x * d2y;
1886 dshape(5,0) = d3x * l2y;
1887 dshape(5,1) = l3x * d2y;
1889 dshape(3,0) = d1x * l3y;
1890 dshape(3,1) = l1x * d3y;
1892 dshape(6,0) = d2x * l3y;
1893 dshape(6,1) = l2x * d3y;
1895 dshape(2,0) = d3x * l3y;
1896 dshape(2,1) = l3x * d3y;
1908 case 0: dofs(4) = 0.25; dofs(7) = 0.25;
break;
1909 case 1: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1910 case 2: dofs(5) = 0.25; dofs(6) = 0.25;
break;
1911 case 3: dofs(6) = 0.25; dofs(7) = 0.25;
break;
1927 TensorBasisElement::DofMapType::Sr_DOF_MAP);
1938 for (
int j = 0; j <= p; j++)
1940 for (
int i = 0; i <= p; i++)
1956 double x = ip.
x, y = ip.
y;
1962 edgeNodalBasis.Eval(x, nodalX);
1963 edgeNodalBasis.Eval(y, nodalY);
1967 for (
int i = 0; i < p-1; i++)
1969 shape(4 + 0*(p-1) + i) = (nodalX(i+1))*(1.-y);
1970 shape(4 + 1*(p-1) + i) = (nodalY(i+1))*x;
1971 shape(4 + 3*(p-1) - i - 1) = (nodalX(i+1)) * y;
1972 shape(4 + 4*(p-1) - i - 1) = (nodalY(i+1)) * (1. - x);
1990 for (
int i = 0; i<p-1; i++)
1992 vtx0fix += (1-edgePts[i+1])*(shape(4 + i) +
1993 shape(4 + 4*(p-1) - i - 1));
1994 vtx1fix += (1-edgePts[i+1])*(shape(4 + 1*(p-1) + i) +
1995 shape(4 + (p-2)-i));
1996 vtx2fix += (1-edgePts[i+1])*(shape(4 + 2*(p-1) + i) +
1998 vtx3fix += (1-edgePts[i+1])*(shape(4 + 3*(p-1) + i) +
2001 shape(0) = bilinearsAtIP(0) - vtx0fix;
2002 shape(1) = bilinearsAtIP(1) - vtx1fix;
2003 shape(2) = bilinearsAtIP(2) - vtx2fix;
2004 shape(3) = bilinearsAtIP(3) - vtx3fix;
2010 double *legX =
new double[p-1];
2011 double *legY =
new double[p-1];
2017 int interior_total = 0;
2018 for (
int j = 4; j < p + 1; j++)
2020 for (
int k = 0; k < j-3; k++)
2022 shape(4 + 4*(p-1) + interior_total)
2023 = legX[k] * legY[j-4-k] * x * (1. - x) * y * (1. - y);
2030 delete storeLegendre;
2038 double x = ip.
x, y = ip.
y;
2046 edgeNodalBasis.Eval(x, nodalX, DnodalX);
2047 edgeNodalBasis.Eval(y, nodalY, DnodalY);
2049 for (
int i = 0; i < p-1; i++)
2051 dshape(4 + 0*(p-1) + i,0) = DnodalX(i+1) * (1.-y);
2052 dshape(4 + 0*(p-1) + i,1) = -nodalX(i+1);
2053 dshape(4 + 1*(p-1) + i,0) = nodalY(i+1);
2054 dshape(4 + 1*(p-1) + i,1) = DnodalY(i+1)*x;
2055 dshape(4 + 3*(p-1) - i - 1,0) = DnodalX(i+1)*y;
2056 dshape(4 + 3*(p-1) - i - 1,1) = nodalX(i+1);
2057 dshape(4 + 4*(p-1) - i - 1,0) = -nodalY(i+1);
2058 dshape(4 + 4*(p-1) - i - 1,1) = DnodalY(i+1) * (1.-x);
2067 dshape(0,0) = DbilinearsAtIP(0,0);
2068 dshape(0,1) = DbilinearsAtIP(0,1);
2069 dshape(1,0) = DbilinearsAtIP(1,0);
2070 dshape(1,1) = DbilinearsAtIP(1,1);
2071 dshape(2,0) = DbilinearsAtIP(2,0);
2072 dshape(2,1) = DbilinearsAtIP(2,1);
2073 dshape(3,0) = DbilinearsAtIP(3,0);
2074 dshape(3,1) = DbilinearsAtIP(3,1);
2076 for (
int i = 0; i<p-1; i++)
2078 dshape(0,0) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 0) +
2079 dshape(4 + 4*(p-1) - i - 1,0));
2080 dshape(0,1) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 1) +
2081 dshape(4 + 4*(p-1) - i - 1,1));
2082 dshape(1,0) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 0) +
2083 dshape(4 + (p-2)-i, 0));
2084 dshape(1,1) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 1) +
2085 dshape(4 + (p-2)-i, 1));
2086 dshape(2,0) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 0) +
2087 dshape(1 + 2*p-i, 0));
2088 dshape(2,1) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 1) +
2089 dshape(1 + 2*p-i, 1));
2090 dshape(3,0) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 0) +
2091 dshape(3*p - i, 0));
2092 dshape(3,1) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 1) +
2093 dshape(3*p - i, 1));
2098 double *legX =
new double[p-1];
2099 double *legY =
new double[p-1];
2100 double *DlegX =
new double[p-1];
2101 double *DlegY =
new double[p-1];
2107 int interior_total = 0;
2108 for (
int j = 4; j < p + 1; j++)
2110 for (
int k = 0; k < j-3; k++)
2112 dshape(4 + 4*(p-1) + interior_total, 0) =
2113 legY[j-4-k]*y*(1-y) * (DlegX[k]*x*(1-x) + legX[k]*(1-2*x));
2114 dshape(4 + 4*(p-1) + interior_total, 1) =
2115 legX[k]*x*(1-x) * (DlegY[j-4-k]*y*(1-y) + legY[j-4-k]*(1-2*y));
2123 delete storeLegendre;
2170 double x = ip.
x, y = ip.
y;
2171 double l1x, l2x, l3x, l1y, l2y, l3y;
2173 l1x = (1. - x) * (1. - x);
2174 l2x = 2. * x * (1. - x);
2176 l1y = (1. - y) * (1. - y);
2177 l2y = 2. * y * (1. - y);
2180 shape(0) = l1x * l1y;
2181 shape(4) = l2x * l1y;
2182 shape(1) = l3x * l1y;
2183 shape(7) = l1x * l2y;
2184 shape(8) = l2x * l2y;
2185 shape(5) = l3x * l2y;
2186 shape(3) = l1x * l3y;
2187 shape(6) = l2x * l3y;
2188 shape(2) = l3x * l3y;
2194 double x = ip.
x, y = ip.
y;
2195 double l1x, l2x, l3x, l1y, l2y, l3y;
2196 double d1x, d2x, d3x, d1y, d2y, d3y;
2198 l1x = (1. - x) * (1. - x);
2199 l2x = 2. * x * (1. - x);
2201 l1y = (1. - y) * (1. - y);
2202 l2y = 2. * y * (1. - y);
2212 dshape(0,0) = d1x * l1y;
2213 dshape(0,1) = l1x * d1y;
2215 dshape(4,0) = d2x * l1y;
2216 dshape(4,1) = l2x * d1y;
2218 dshape(1,0) = d3x * l1y;
2219 dshape(1,1) = l3x * d1y;
2221 dshape(7,0) = d1x * l2y;
2222 dshape(7,1) = l1x * d2y;
2224 dshape(8,0) = d2x * l2y;
2225 dshape(8,1) = l2x * d2y;
2227 dshape(5,0) = d3x * l2y;
2228 dshape(5,1) = l3x * d2y;
2230 dshape(3,0) = d1x * l3y;
2231 dshape(3,1) = l1x * d3y;
2233 dshape(6,0) = d2x * l3y;
2234 dshape(6,1) = l2x * d3y;
2236 dshape(2,0) = d3x * l3y;
2237 dshape(2,1) = l3x * d3y;
2245 Vector xx(&tr_ip.
x, 2), shape(s, 9);
2247 for (
int i = 0; i < 9; i++)
2251 for (
int j = 0; j < 9; j++)
2252 if (fabs(I(i,j) = s[j]) < 1.0e-12)
2257 for (
int i = 0; i < 9; i++)
2259 double *d = &I(0,i);
2260 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2261 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2262 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2263 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2264 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2265 0.25 * (d[0] + d[1] + d[2] + d[3]);
2274 for (
int i = 0; i < 9; i++)
2278 d[i] = coeff.
Eval(Trans, ip);
2280 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2281 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2282 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2283 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2284 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2285 0.25 * (d[0] + d[1] + d[2] + d[3]);
2295 for (
int i = 0; i < 9; i++)
2299 vc.
Eval (x, Trans, ip);
2300 for (
int j = 0; j < x.Size(); j++)
2305 for (
int j = 0; j < x.Size(); j++)
2307 double *d = &dofs(9*j);
2309 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2310 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2311 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2312 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2313 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2314 0.25 * (d[0] + d[1] + d[2] + d[3]);
2322 const double p1 = 0.5*(1.-sqrt(3./5.));
2347 const double a = sqrt(5./3.);
2348 const double p1 = 0.5*(1.-sqrt(3./5.));
2350 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2351 double l1x, l2x, l3x, l1y, l2y, l3y;
2353 l1x = (x - 1.) * (2. * x - 1);
2354 l2x = 4. * x * (1. - x);
2355 l3x = x * (2. * x - 1.);
2356 l1y = (y - 1.) * (2. * y - 1);
2357 l2y = 4. * y * (1. - y);
2358 l3y = y * (2. * y - 1.);
2360 shape(0) = l1x * l1y;
2361 shape(4) = l2x * l1y;
2362 shape(1) = l3x * l1y;
2363 shape(7) = l1x * l2y;
2364 shape(8) = l2x * l2y;
2365 shape(5) = l3x * l2y;
2366 shape(3) = l1x * l3y;
2367 shape(6) = l2x * l3y;
2368 shape(2) = l3x * l3y;
2374 const double a = sqrt(5./3.);
2375 const double p1 = 0.5*(1.-sqrt(3./5.));
2377 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2378 double l1x, l2x, l3x, l1y, l2y, l3y;
2379 double d1x, d2x, d3x, d1y, d2y, d3y;
2381 l1x = (x - 1.) * (2. * x - 1);
2382 l2x = 4. * x * (1. - x);
2383 l3x = x * (2. * x - 1.);
2384 l1y = (y - 1.) * (2. * y - 1);
2385 l2y = 4. * y * (1. - y);
2386 l3y = y * (2. * y - 1.);
2388 d1x = a * (4. * x - 3.);
2389 d2x = a * (4. - 8. * x);
2390 d3x = a * (4. * x - 1.);
2391 d1y = a * (4. * y - 3.);
2392 d2y = a * (4. - 8. * y);
2393 d3y = a * (4. * y - 1.);
2395 dshape(0,0) = d1x * l1y;
2396 dshape(0,1) = l1x * d1y;
2398 dshape(4,0) = d2x * l1y;
2399 dshape(4,1) = l2x * d1y;
2401 dshape(1,0) = d3x * l1y;
2402 dshape(1,1) = l3x * d1y;
2404 dshape(7,0) = d1x * l2y;
2405 dshape(7,1) = l1x * d2y;
2407 dshape(8,0) = d2x * l2y;
2408 dshape(8,1) = l2x * d2y;
2410 dshape(5,0) = d3x * l2y;
2411 dshape(5,1) = l3x * d2y;
2413 dshape(3,0) = d1x * l3y;
2414 dshape(3,1) = l1x * d3y;
2416 dshape(6,0) = d2x * l3y;
2417 dshape(6,1) = l2x * d3y;
2419 dshape(2,0) = d3x * l3y;
2420 dshape(2,1) = l3x * d3y;
2463 double x = ip.
x, y = ip.
y;
2465 double w1x, w2x, w3x, w1y, w2y, w3y;
2466 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2468 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2469 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2471 l0x = (- 4.5) * w1x * w2x * w3x;
2472 l1x = ( 13.5) * x * w2x * w3x;
2473 l2x = (-13.5) * x * w1x * w3x;
2474 l3x = ( 4.5) * x * w1x * w2x;
2476 l0y = (- 4.5) * w1y * w2y * w3y;
2477 l1y = ( 13.5) * y * w2y * w3y;
2478 l2y = (-13.5) * y * w1y * w3y;
2479 l3y = ( 4.5) * y * w1y * w2y;
2481 shape(0) = l0x * l0y;
2482 shape(1) = l3x * l0y;
2483 shape(2) = l3x * l3y;
2484 shape(3) = l0x * l3y;
2485 shape(4) = l1x * l0y;
2486 shape(5) = l2x * l0y;
2487 shape(6) = l3x * l1y;
2488 shape(7) = l3x * l2y;
2489 shape(8) = l2x * l3y;
2490 shape(9) = l1x * l3y;
2491 shape(10) = l0x * l2y;
2492 shape(11) = l0x * l1y;
2493 shape(12) = l1x * l1y;
2494 shape(13) = l2x * l1y;
2495 shape(14) = l1x * l2y;
2496 shape(15) = l2x * l2y;
2502 double x = ip.
x, y = ip.
y;
2504 double w1x, w2x, w3x, w1y, w2y, w3y;
2505 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2506 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2508 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2509 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2511 l0x = (- 4.5) * w1x * w2x * w3x;
2512 l1x = ( 13.5) * x * w2x * w3x;
2513 l2x = (-13.5) * x * w1x * w3x;
2514 l3x = ( 4.5) * x * w1x * w2x;
2516 l0y = (- 4.5) * w1y * w2y * w3y;
2517 l1y = ( 13.5) * y * w2y * w3y;
2518 l2y = (-13.5) * y * w1y * w3y;
2519 l3y = ( 4.5) * y * w1y * w2y;
2521 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2522 d1x = 9. + (-45. + 40.5 * x) * x;
2523 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2524 d3x = 1. + (- 9. + 13.5 * x) * x;
2526 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2527 d1y = 9. + (-45. + 40.5 * y) * y;
2528 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2529 d3y = 1. + (- 9. + 13.5 * y) * y;
2531 dshape( 0,0) = d0x * l0y; dshape( 0,1) = l0x * d0y;
2532 dshape( 1,0) = d3x * l0y; dshape( 1,1) = l3x * d0y;
2533 dshape( 2,0) = d3x * l3y; dshape( 2,1) = l3x * d3y;
2534 dshape( 3,0) = d0x * l3y; dshape( 3,1) = l0x * d3y;
2535 dshape( 4,0) = d1x * l0y; dshape( 4,1) = l1x * d0y;
2536 dshape( 5,0) = d2x * l0y; dshape( 5,1) = l2x * d0y;
2537 dshape( 6,0) = d3x * l1y; dshape( 6,1) = l3x * d1y;
2538 dshape( 7,0) = d3x * l2y; dshape( 7,1) = l3x * d2y;
2539 dshape( 8,0) = d2x * l3y; dshape( 8,1) = l2x * d3y;
2540 dshape( 9,0) = d1x * l3y; dshape( 9,1) = l1x * d3y;
2541 dshape(10,0) = d0x * l2y; dshape(10,1) = l0x * d2y;
2542 dshape(11,0) = d0x * l1y; dshape(11,1) = l0x * d1y;
2543 dshape(12,0) = d1x * l1y; dshape(12,1) = l1x * d1y;
2544 dshape(13,0) = d2x * l1y; dshape(13,1) = l2x * d1y;
2545 dshape(14,0) = d1x * l2y; dshape(14,1) = l1x * d2y;
2546 dshape(15,0) = d2x * l2y; dshape(15,1) = l2x * d2y;
2552 double x = ip.
x, y = ip.
y;
2554 double w1x, w2x, w3x, w1y, w2y, w3y;
2555 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2556 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2557 double h0x, h1x, h2x, h3x, h0y, h1y, h2y, h3y;
2559 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2560 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2562 l0x = (- 4.5) * w1x * w2x * w3x;
2563 l1x = ( 13.5) * x * w2x * w3x;
2564 l2x = (-13.5) * x * w1x * w3x;
2565 l3x = ( 4.5) * x * w1x * w2x;
2567 l0y = (- 4.5) * w1y * w2y * w3y;
2568 l1y = ( 13.5) * y * w2y * w3y;
2569 l2y = (-13.5) * y * w1y * w3y;
2570 l3y = ( 4.5) * y * w1y * w2y;
2572 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2573 d1x = 9. + (-45. + 40.5 * x) * x;
2574 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2575 d3x = 1. + (- 9. + 13.5 * x) * x;
2577 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2578 d1y = 9. + (-45. + 40.5 * y) * y;
2579 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2580 d3y = 1. + (- 9. + 13.5 * y) * y;
2582 h0x = -27. * x + 18.;
2583 h1x = 81. * x - 45.;
2584 h2x = -81. * x + 36.;
2587 h0y = -27. * y + 18.;
2588 h1y = 81. * y - 45.;
2589 h2y = -81. * y + 36.;
2592 h( 0,0) = h0x * l0y; h( 0,1) = d0x * d0y; h( 0,2) = l0x * h0y;
2593 h( 1,0) = h3x * l0y; h( 1,1) = d3x * d0y; h( 1,2) = l3x * h0y;
2594 h( 2,0) = h3x * l3y; h( 2,1) = d3x * d3y; h( 2,2) = l3x * h3y;
2595 h( 3,0) = h0x * l3y; h( 3,1) = d0x * d3y; h( 3,2) = l0x * h3y;
2596 h( 4,0) = h1x * l0y; h( 4,1) = d1x * d0y; h( 4,2) = l1x * h0y;
2597 h( 5,0) = h2x * l0y; h( 5,1) = d2x * d0y; h( 5,2) = l2x * h0y;
2598 h( 6,0) = h3x * l1y; h( 6,1) = d3x * d1y; h( 6,2) = l3x * h1y;
2599 h( 7,0) = h3x * l2y; h( 7,1) = d3x * d2y; h( 7,2) = l3x * h2y;
2600 h( 8,0) = h2x * l3y; h( 8,1) = d2x * d3y; h( 8,2) = l2x * h3y;
2601 h( 9,0) = h1x * l3y; h( 9,1) = d1x * d3y; h( 9,2) = l1x * h3y;
2602 h(10,0) = h0x * l2y; h(10,1) = d0x * d2y; h(10,2) = l0x * h2y;
2603 h(11,0) = h0x * l1y; h(11,1) = d0x * d1y; h(11,2) = l0x * h1y;
2604 h(12,0) = h1x * l1y; h(12,1) = d1x * d1y; h(12,2) = l1x * h1y;
2605 h(13,0) = h2x * l1y; h(13,1) = d2x * d1y; h(13,2) = l2x * h1y;
2606 h(14,0) = h1x * l2y; h(14,1) = d1x * d2y; h(14,2) = l1x * h2y;
2607 h(15,0) = h2x * l2y; h(15,1) = d2x * d2y; h(15,2) = l2x * h2y;
2626 l3 = (0.33333333333333333333-x),
2627 l4 = (0.66666666666666666667-x);
2629 shape(0) = 4.5 * l2 * l3 * l4;
2630 shape(1) = 4.5 * l1 * l3 * l4;
2631 shape(2) = 13.5 * l1 * l2 * l4;
2632 shape(3) = -13.5 * l1 * l2 * l3;
2640 dshape(0,0) = -5.5 + x * (18. - 13.5 * x);
2641 dshape(1,0) = 1. - x * (9. - 13.5 * x);
2642 dshape(2,0) = 9. - x * (45. - 40.5 * x);
2643 dshape(3,0) = -4.5 + x * (36. - 40.5 * x);
2675 double x = ip.
x, y = ip.
y;
2676 double l1 = (-1. + x + y),
2680 shape(0) = -0.5*l1*(3.*l1 + 1.)*(3.*l1 + 2.);
2681 shape(1) = 0.5*x*(lx - 1.)*lx;
2682 shape(2) = 0.5*y*(-1. + ly)*ly;
2683 shape(3) = 4.5*x*l1*(3.*l1 + 1.);
2684 shape(4) = -4.5*x*lx*l1;
2685 shape(5) = 4.5*x*lx*y;
2686 shape(6) = 4.5*x*y*ly;
2687 shape(7) = -4.5*y*l1*ly;
2688 shape(8) = 4.5*y*l1*(1. + 3.*l1);
2689 shape(9) = -27.*x*y*l1;
2695 double x = ip.
x, y = ip.
y;
2697 dshape(0,0) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2698 dshape(1,0) = 1. + 4.5*x*(-2. + 3.*x);
2700 dshape(3,0) = 4.5*(2. + 9.*x*x - 5.*y + 3.*y*y + 2.*x*(-5. + 6.*y));
2701 dshape(4,0) = -4.5*(1. - 1.*y + x*(-8. + 9.*x + 6.*y));
2702 dshape(5,0) = 4.5*(-1. + 6.*x)*y;
2703 dshape(6,0) = 4.5*y*(-1. + 3.*y);
2704 dshape(7,0) = 4.5*(1. - 3.*y)*y;
2705 dshape(8,0) = 4.5*y*(-5. + 6.*x + 6.*y);
2706 dshape(9,0) = -27.*y*(-1. + 2.*x + y);
2708 dshape(0,1) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2710 dshape(2,1) = 1. + 4.5*y*(-2. + 3.*y);
2711 dshape(3,1) = 4.5*x*(-5. + 6.*x + 6.*y);
2712 dshape(4,1) = 4.5*(1. - 3.*x)*x;
2713 dshape(5,1) = 4.5*x*(-1. + 3.*x);
2714 dshape(6,1) = 4.5*x*(-1. + 6.*y);
2715 dshape(7,1) = -4.5*(1. + x*(-1. + 6.*y) + y*(-8. + 9.*y));
2716 dshape(8,1) = 4.5*(2. + 3.*x*x + y*(-10. + 9.*y) + x*(-5. + 12.*y));
2717 dshape(9,1) = -27.*x*(-1. + x + 2.*y);
2723 double x = ip.
x, y = ip.
y;
2725 h(0,0) = 18.-27.*(x+y);
2726 h(0,1) = 18.-27.*(x+y);
2727 h(0,2) = 18.-27.*(x+y);
2737 h(3,0) = -45.+81.*x+54.*y;
2738 h(3,1) = -22.5+54.*x+27.*y;
2741 h(4,0) = 36.-81.*x-27.*y;
2746 h(5,1) = -4.5+27.*x;
2750 h(6,1) = -4.5+27.*y;
2755 h(7,2) = 36.-27.*x-81.*y;
2758 h(8,1) = -22.5+27.*x+54.*y;
2759 h(8,2) = -45.+54.*x+81.*y;
2762 h(9,1) = 27.-54.*(x+y);
2835 double x = ip.
x, y = ip.
y, z = ip.
z;
2837 shape(0) = -((-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z)*
2838 (-1 + 3*x + 3*y + 3*z))/2.;
2839 shape(4) = (9*x*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2840 shape(5) = (-9*x*(-1 + 3*x)*(-1 + x + y + z))/2.;
2841 shape(1) = (x*(2 + 9*(-1 + x)*x))/2.;
2842 shape(6) = (9*y*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2843 shape(19) = -27*x*y*(-1 + x + y + z);
2844 shape(10) = (9*x*(-1 + 3*x)*y)/2.;
2845 shape(7) = (-9*y*(-1 + 3*y)*(-1 + x + y + z))/2.;
2846 shape(11) = (9*x*y*(-1 + 3*y))/2.;
2847 shape(2) = (y*(2 + 9*(-1 + y)*y))/2.;
2848 shape(8) = (9*z*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2849 shape(18) = -27*x*z*(-1 + x + y + z);
2850 shape(12) = (9*x*(-1 + 3*x)*z)/2.;
2851 shape(17) = -27*y*z*(-1 + x + y + z);
2852 shape(16) = 27*x*y*z;
2853 shape(14) = (9*y*(-1 + 3*y)*z)/2.;
2854 shape(9) = (-9*z*(-1 + x + y + z)*(-1 + 3*z))/2.;
2855 shape(13) = (9*x*z*(-1 + 3*z))/2.;
2856 shape(15) = (9*y*z*(-1 + 3*z))/2.;
2857 shape(3) = (z*(2 + 9*(-1 + z)*z))/2.;
2863 double x = ip.
x, y = ip.
y, z = ip.
z;
2865 dshape(0,0) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2866 x*(-4 + 6*y + 6*z)))/2.;
2867 dshape(0,1) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2868 x*(-4 + 6*y + 6*z)))/2.;
2869 dshape(0,2) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2870 x*(-4 + 6*y + 6*z)))/2.;
2871 dshape(4,0) = (9*(9*pow(x,2) + (-1 + y + z)*(-2 + 3*y + 3*z) +
2872 2*x*(-5 + 6*y + 6*z)))/2.;
2873 dshape(4,1) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2874 dshape(4,2) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2875 dshape(5,0) = (-9*(1 - y - z + x*(-8 + 9*x + 6*y + 6*z)))/2.;
2876 dshape(5,1) = (9*(1 - 3*x)*x)/2.;
2877 dshape(5,2) = (9*(1 - 3*x)*x)/2.;
2878 dshape(1,0) = 1 + (9*x*(-2 + 3*x))/2.;
2881 dshape(6,0) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2882 dshape(6,1) = (9*(2 + 3*pow(x,2) - 10*y - 5*z + 3*(y + z)*(3*y + z) +
2883 x*(-5 + 12*y + 6*z)))/2.;
2884 dshape(6,2) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2885 dshape(19,0) = -27*y*(-1 + 2*x + y + z);
2886 dshape(19,1) = -27*x*(-1 + x + 2*y + z);
2887 dshape(19,2) = -27*x*y;
2888 dshape(10,0) = (9*(-1 + 6*x)*y)/2.;
2889 dshape(10,1) = (9*x*(-1 + 3*x))/2.;
2891 dshape(7,0) = (9*(1 - 3*y)*y)/2.;
2892 dshape(7,1) = (-9*(1 + x*(-1 + 6*y) - z + y*(-8 + 9*y + 6*z)))/2.;
2893 dshape(7,2) = (9*(1 - 3*y)*y)/2.;
2894 dshape(11,0) = (9*y*(-1 + 3*y))/2.;
2895 dshape(11,1) = (9*x*(-1 + 6*y))/2.;
2898 dshape(2,1) = 1 + (9*y*(-2 + 3*y))/2.;
2900 dshape(8,0) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2901 dshape(8,1) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2902 dshape(8,2) = (9*(2 + 3*pow(x,2) - 5*y - 10*z + 3*(y + z)*(y + 3*z) +
2903 x*(-5 + 6*y + 12*z)))/2.;
2904 dshape(18,0) = -27*z*(-1 + 2*x + y + z);
2905 dshape(18,1) = -27*x*z;
2906 dshape(18,2) = -27*x*(-1 + x + y + 2*z);
2907 dshape(12,0) = (9*(-1 + 6*x)*z)/2.;
2909 dshape(12,2) = (9*x*(-1 + 3*x))/2.;
2910 dshape(17,0) = -27*y*z;
2911 dshape(17,1) = -27*z*(-1 + x + 2*y + z);
2912 dshape(17,2) = -27*y*(-1 + x + y + 2*z);
2913 dshape(16,0) = 27*y*z;
2914 dshape(16,1) = 27*x*z;
2915 dshape(16,2) = 27*x*y;
2917 dshape(14,1) = (9*(-1 + 6*y)*z)/2.;
2918 dshape(14,2) = (9*y*(-1 + 3*y))/2.;
2919 dshape(9,0) = (9*(1 - 3*z)*z)/2.;
2920 dshape(9,1) = (9*(1 - 3*z)*z)/2.;
2921 dshape(9,2) = (9*(-1 + x + y + 8*z - 6*(x + y)*z - 9*pow(z,2)))/2.;
2922 dshape(13,0) = (9*z*(-1 + 3*z))/2.;
2924 dshape(13,2) = (9*x*(-1 + 6*z))/2.;
2926 dshape(15,1) = (9*z*(-1 + 3*z))/2.;
2927 dshape(15,2) = (9*y*(-1 + 6*z))/2.;
2930 dshape(3,2) = 1 + (9*z*(-2 + 3*z))/2.;
2996 shape(0) = 1. - ip.
x - ip.
y - ip.
z;
3005 if (dshape.
Height() == 4)
3007 double *A = &dshape(0,0);
3008 A[0] = -1.; A[4] = -1.; A[8] = -1.;
3009 A[1] = 1.; A[5] = 0.; A[9] = 0.;
3010 A[2] = 0.; A[6] = 1.; A[10] = 0.;
3011 A[3] = 0.; A[7] = 0.; A[11] = 1.;
3015 dshape(0,0) = -1.; dshape(0,1) = -1.; dshape(0,2) = -1.;
3016 dshape(1,0) = 1.; dshape(1,1) = 0.; dshape(1,2) = 0.;
3017 dshape(2,0) = 0.; dshape(2,1) = 1.; dshape(2,2) = 0.;
3018 dshape(3,0) = 0.; dshape(3,1) = 0.; dshape(3,2) = 1.;
3025 static int face_dofs[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
3028 *dofs = face_dofs[face];
3070 double L0, L1, L2, L3;
3072 L0 = 1. - ip.
x - ip.
y - ip.
z;
3077 shape(0) = L0 * ( 2.0 * L0 - 1.0 );
3078 shape(1) = L1 * ( 2.0 * L1 - 1.0 );
3079 shape(2) = L2 * ( 2.0 * L2 - 1.0 );
3080 shape(3) = L3 * ( 2.0 * L3 - 1.0 );
3081 shape(4) = 4.0 * L0 * L1;
3082 shape(5) = 4.0 * L0 * L2;
3083 shape(6) = 4.0 * L0 * L3;
3084 shape(7) = 4.0 * L1 * L2;
3085 shape(8) = 4.0 * L1 * L3;
3086 shape(9) = 4.0 * L2 * L3;
3097 L0 = 1.0 - x - y - z;
3099 dshape(0,0) = dshape(0,1) = dshape(0,2) = 1.0 - 4.0 * L0;
3100 dshape(1,0) = -1.0 + 4.0 * x; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
3101 dshape(2,0) = 0.0; dshape(2,1) = -1.0 + 4.0 * y; dshape(2,2) = 0.0;
3102 dshape(3,0) = dshape(3,1) = 0.0; dshape(3,2) = -1.0 + 4.0 * z;
3103 dshape(4,0) = 4.0 * (L0 - x); dshape(4,1) = dshape(4,2) = -4.0 * x;
3104 dshape(5,0) = dshape(5,2) = -4.0 * y; dshape(5,1) = 4.0 * (L0 - y);
3105 dshape(6,0) = dshape(6,1) = -4.0 * z; dshape(6,2) = 4.0 * (L0 - z);
3106 dshape(7,0) = 4.0 * y; dshape(7,1) = 4.0 * x; dshape(7,2) = 0.0;
3107 dshape(8,0) = 4.0 * z; dshape(8,1) = 0.0; dshape(8,2) = 4.0 * x;
3108 dshape(9,0) = 0.0; dshape(9,1) = 4.0 * z; dshape(9,2) = 4.0 * y;
3150 double x = ip.
x, y = ip.
y, z = ip.
z;
3151 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3153 shape(0) = ox * oy * oz;
3154 shape(1) = x * oy * oz;
3155 shape(2) = x * y * oz;
3156 shape(3) = ox * y * oz;
3157 shape(4) = ox * oy * z;
3158 shape(5) = x * oy * z;
3159 shape(6) = x * y * z;
3160 shape(7) = ox * y * z;
3166 double x = ip.
x, y = ip.
y, z = ip.
z;
3167 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3169 dshape(0,0) = - oy * oz;
3170 dshape(0,1) = - ox * oz;
3171 dshape(0,2) = - ox * oy;
3173 dshape(1,0) = oy * oz;
3174 dshape(1,1) = - x * oz;
3175 dshape(1,2) = - x * oy;
3177 dshape(2,0) = y * oz;
3178 dshape(2,1) = x * oz;
3179 dshape(2,2) = - x * y;
3181 dshape(3,0) = - y * oz;
3182 dshape(3,1) = ox * oz;
3183 dshape(3,2) = - ox * y;
3185 dshape(4,0) = - oy * z;
3186 dshape(4,1) = - ox * z;
3187 dshape(4,2) = ox * oy;
3189 dshape(5,0) = oy * z;
3190 dshape(5,1) = - x * z;
3191 dshape(5,2) = x * oy;
3193 dshape(6,0) = y * z;
3194 dshape(6,1) = x * z;
3195 dshape(6,2) = x * y;
3197 dshape(7,0) = - y * z;
3198 dshape(7,1) = ox * z;
3199 dshape(7,2) = ox * y;
3235 shape(0) = 1.0 - 2.0 * ip.
y;
3236 shape(1) = -1.0 + 2.0 * ( ip.
x + ip.
y );
3237 shape(2) = 1.0 - 2.0 * ip.
x;
3243 dshape(0,0) = 0.0; dshape(0,1) = -2.0;
3244 dshape(1,0) = 2.0; dshape(1,1) = 2.0;
3245 dshape(2,0) = -2.0; dshape(2,1) = 0.0;
3266 const double l1 = ip.
x+ip.
y-0.5, l2 = 1.-l1, l3 = ip.
x-ip.
y+0.5, l4 = 1.-l3;
3277 const double x2 = 2.*ip.
x, y2 = 2.*ip.
y;
3279 dshape(0,0) = 1. - x2; dshape(0,1) = -2. + y2;
3280 dshape(1,0) = x2; dshape(1,1) = 1. - y2;
3281 dshape(2,0) = 1. - x2; dshape(2,1) = y2;
3282 dshape(3,0) = -2. + x2; dshape(3,1) = 1. - y2;
3300 double x = ip.
x, y = ip.
y;
3303 shape(0,1) = y - 1.;
3306 shape(2,0) = x - 1.;
3318 const double RT0TriangleFiniteElement::nk[3][2] =
3319 { {0, -1}, {1, 1}, {-1, 0} };
3325 #ifdef MFEM_THREAD_SAFE
3331 for (k = 0; k < 3; k++)
3334 for (j = 0; j < 3; j++)
3337 if (j == k) { d -= 1.0; }
3338 if (fabs(d) > 1.0e-12)
3340 mfem::err <<
"RT0TriangleFiniteElement::GetLocalInterpolation (...)\n"
3341 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3357 for (k = 0; k < 3; k++)
3360 ip.
x = vk[0]; ip.
y = vk[1];
3363 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3364 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3365 for (j = 0; j < 3; j++)
3366 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3379 #ifdef MFEM_THREAD_SAFE
3383 for (
int k = 0; k < 3; k++)
3391 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3392 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3412 double x = ip.
x, y = ip.
y;
3415 shape(0,1) = y - 1.;
3420 shape(3,0) = x - 1.;
3433 const double RT0QuadFiniteElement::nk[4][2] =
3434 { {0, -1}, {1, 0}, {0, 1}, {-1, 0} };
3440 #ifdef MFEM_THREAD_SAFE
3446 for (k = 0; k < 4; k++)
3449 for (j = 0; j < 4; j++)
3452 if (j == k) { d -= 1.0; }
3453 if (fabs(d) > 1.0e-12)
3455 mfem::err <<
"RT0QuadFiniteElement::GetLocalInterpolation (...)\n"
3456 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3472 for (k = 0; k < 4; k++)
3475 ip.
x = vk[0]; ip.
y = vk[1];
3478 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3479 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3480 for (j = 0; j < 4; j++)
3481 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3494 #ifdef MFEM_THREAD_SAFE
3498 for (
int k = 0; k < 4; k++)
3506 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3507 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3535 double x = ip.
x, y = ip.
y;
3537 shape(0,0) = -2 * x * (-1 + x + 2 * y);
3538 shape(0,1) = -2 * (-1 + y) * (-1 + x + 2 * y);
3539 shape(1,0) = 2 * x * (x - y);
3540 shape(1,1) = 2 * (x - y) * (-1 + y);
3541 shape(2,0) = 2 * x * (-1 + 2 * x + y);
3542 shape(2,1) = 2 * y * (-1 + 2 * x + y);
3543 shape(3,0) = 2 * x * (-1 + x + 2 * y);
3544 shape(3,1) = 2 * y * (-1 + x + 2 * y);
3545 shape(4,0) = -2 * (-1 + x) * (x - y);
3546 shape(4,1) = 2 * y * (-x + y);
3547 shape(5,0) = -2 * (-1 + x) * (-1 + 2 * x + y);
3548 shape(5,1) = -2 * y * (-1 + 2 * x + y);
3549 shape(6,0) = -3 * x * (-2 + 2 * x + y);
3550 shape(6,1) = -3 * y * (-1 + 2 * x + y);
3551 shape(7,0) = -3 * x * (-1 + x + 2 * y);
3552 shape(7,1) = -3 * y * (-2 + x + 2 * y);
3558 double x = ip.
x, y = ip.
y;
3560 divshape(0) = -2 * (-4 + 3 * x + 6 * y);
3561 divshape(1) = 2 + 6 * x - 6 * y;
3562 divshape(2) = -4 + 12 * x + 6 * y;
3563 divshape(3) = -4 + 6 * x + 12 * y;
3564 divshape(4) = 2 - 6 * x + 6 * y;
3565 divshape(5) = -2 * (-4 + 6 * x + 3 * y);
3566 divshape(6) = -9 * (-1 + 2 * x + y);
3567 divshape(7) = -9 * (-1 + x + 2 * y);
3570 const double RT1TriangleFiniteElement::nk[8][2] =
3582 #ifdef MFEM_THREAD_SAFE
3588 for (k = 0; k < 8; k++)
3591 for (j = 0; j < 8; j++)
3594 if (j == k) { d -= 1.0; }
3595 if (fabs(d) > 1.0e-12)
3597 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3598 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3614 for (k = 0; k < 8; k++)
3617 ip.
x = vk[0]; ip.
y = vk[1];
3620 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3621 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3622 for (j = 0; j < 8; j++)
3623 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3635 #ifdef MFEM_THREAD_SAFE
3639 for (
int k = 0; k < 8; k++)
3647 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3648 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3691 double x = ip.
x, y = ip.
y;
3695 shape(0,1) = -( 1. - 3.*y + 2.*y*y)*( 2. - 3.*x);
3697 shape(1,1) = -( 1. - 3.*y + 2.*y*y)*(-1. + 3.*x);
3699 shape(2,0) = (-x + 2.*x*x)*( 2. - 3.*y);
3701 shape(3,0) = (-x + 2.*x*x)*(-1. + 3.*y);
3705 shape(4,1) = (-y + 2.*y*y)*(-1. + 3.*x);
3707 shape(5,1) = (-y + 2.*y*y)*( 2. - 3.*x);
3709 shape(6,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y);
3711 shape(7,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y);
3714 shape(8,0) = (4.*x - 4.*x*x)*( 2. - 3.*y);
3716 shape(9,0) = (4.*x - 4.*x*x)*(-1. + 3.*y);
3720 shape(10,1) = (4.*y - 4.*y*y)*( 2. - 3.*x);
3722 shape(11,1) = (4.*y - 4.*y*y)*(-1. + 3.*x);
3728 double x = ip.
x, y = ip.
y;
3730 divshape(0) = -(-3. + 4.*y)*( 2. - 3.*x);
3731 divshape(1) = -(-3. + 4.*y)*(-1. + 3.*x);
3732 divshape(2) = (-1. + 4.*x)*( 2. - 3.*y);
3733 divshape(3) = (-1. + 4.*x)*(-1. + 3.*y);
3734 divshape(4) = (-1. + 4.*y)*(-1. + 3.*x);
3735 divshape(5) = (-1. + 4.*y)*( 2. - 3.*x);
3736 divshape(6) = -(-3. + 4.*x)*(-1. + 3.*y);
3737 divshape(7) = -(-3. + 4.*x)*( 2. - 3.*y);
3738 divshape(8) = ( 4. - 8.*x)*( 2. - 3.*y);
3739 divshape(9) = ( 4. - 8.*x)*(-1. + 3.*y);
3740 divshape(10) = ( 4. - 8.*y)*( 2. - 3.*x);
3741 divshape(11) = ( 4. - 8.*y)*(-1. + 3.*x);
3744 const double RT1QuadFiniteElement::nk[12][2] =
3764 #ifdef MFEM_THREAD_SAFE
3770 for (k = 0; k < 12; k++)
3773 for (j = 0; j < 12; j++)
3776 if (j == k) { d -= 1.0; }
3777 if (fabs(d) > 1.0e-12)
3779 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3780 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3796 for (k = 0; k < 12; k++)
3799 ip.
x = vk[0]; ip.
y = vk[1];
3802 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3803 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3804 for (j = 0; j < 12; j++)
3805 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3817 #ifdef MFEM_THREAD_SAFE
3821 for (
int k = 0; k < 12; k++)
3829 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3830 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3834 const double RT2TriangleFiniteElement::M[15][15] =
3837 0, -5.3237900077244501311, 5.3237900077244501311, 16.647580015448900262,
3838 0, 24.442740046346700787, -16.647580015448900262, -12.,
3839 -19.118950038622250656, -47.237900077244501311, 0, -34.414110069520051180,
3840 12., 30.590320061795601049, 15.295160030897800524
3843 0, 1.5, -1.5, -15., 0, 2.625, 15., 15., -4.125, 30., 0, -14.625, -15.,
3847 0, -0.67620999227554986889, 0.67620999227554986889, 7.3524199845510997378,
3848 0, -3.4427400463467007866, -7.3524199845510997378, -12.,
3849 4.1189500386222506555, -0.76209992275549868892, 0, 7.4141100695200511800,
3850 12., -6.5903200617956010489, -3.2951600308978005244
3853 0, 0, 1.5, 0, 0, 1.5, -11.471370023173350393, 0, 2.4713700231733503933,
3854 -11.471370023173350393, 0, 2.4713700231733503933, 15.295160030897800524,
3855 0, -3.2951600308978005244
3858 0, 0, 4.875, 0, 0, 4.875, -16.875, 0, -16.875, -16.875, 0, -16.875, 10.5,
3862 0, 0, 1.5, 0, 0, 1.5, 2.4713700231733503933, 0, -11.471370023173350393,
3863 2.4713700231733503933, 0, -11.471370023173350393, -3.2951600308978005244,
3864 0, 15.295160030897800524
3867 -0.67620999227554986889, 0, -3.4427400463467007866, 0,
3868 7.3524199845510997378, 0.67620999227554986889, 7.4141100695200511800, 0,
3869 -0.76209992275549868892, 4.1189500386222506555, -12.,
3870 -7.3524199845510997378, -3.2951600308978005244, -6.5903200617956010489,
3874 1.5, 0, 2.625, 0, -15., -1.5, -14.625, 0, 30., -4.125, 15., 15., 10.5,
3878 -5.3237900077244501311, 0, 24.442740046346700787, 0, 16.647580015448900262,
3879 5.3237900077244501311, -34.414110069520051180, 0, -47.237900077244501311,
3880 -19.118950038622250656, -12., -16.647580015448900262, 15.295160030897800524,
3881 30.590320061795601049, 12.
3883 { 0, 0, 18., 0, 0, 6., -42., 0, -30., -26., 0, -14., 24., 32., 8.},
3884 { 0, 0, 6., 0, 0, 18., -14., 0, -26., -30., 0, -42., 8., 32., 24.},
3885 { 0, 0, -6., 0, 0, -4., 30., 0, 4., 22., 0, 4., -24., -16., 0},
3886 { 0, 0, -4., 0, 0, -8., 20., 0, 8., 36., 0, 8., -16., -32., 0},
3887 { 0, 0, -8., 0, 0, -4., 8., 0, 36., 8., 0, 20., 0, -32., -16.},
3888 { 0, 0, -4., 0, 0, -6., 4., 0, 22., 4., 0, 30., 0, -16., -24.}
3894 const double p = 0.11270166537925831148;
3931 double x = ip.
x, y = ip.
y;
3933 double Bx[15] = {1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y, 0., x*x*x,
3936 double By[15] = {0., 1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y,
3940 for (
int i = 0; i < 15; i++)
3942 double cx = 0.0, cy = 0.0;
3943 for (
int j = 0; j < 15; j++)
3945 cx += M[i][j] * Bx[j];
3946 cy += M[i][j] * By[j];
3956 double x = ip.
x, y = ip.
y;
3958 double DivB[15] = {0., 0., 1., 0., 0., 1., 2.*x, 0., y, x, 0., 2.*y,
3959 4.*x*x, 4.*x*y, 4.*y*y
3962 for (
int i = 0; i < 15; i++)
3965 for (
int j = 0; j < 15; j++)
3967 div += M[i][j] * DivB[j];
3973 const double RT2QuadFiniteElement::pt[4] = {0.,1./3.,2./3.,1.};
3975 const double RT2QuadFiniteElement::dpt[3] = {0.25,0.5,0.75};
4017 double x = ip.
x, y = ip.
y;
4019 double ax0 = pt[0] - x;
4020 double ax1 = pt[1] - x;
4021 double ax2 = pt[2] - x;
4022 double ax3 = pt[3] - x;
4024 double by0 = dpt[0] - y;
4025 double by1 = dpt[1] - y;
4026 double by2 = dpt[2] - y;
4028 double ay0 = pt[0] - y;
4029 double ay1 = pt[1] - y;
4030 double ay2 = pt[2] - y;
4031 double ay3 = pt[3] - y;
4033 double bx0 = dpt[0] - x;
4034 double bx1 = dpt[1] - x;
4035 double bx2 = dpt[2] - x;
4037 double A01 = pt[0] - pt[1];
4038 double A02 = pt[0] - pt[2];
4039 double A12 = pt[1] - pt[2];
4040 double A03 = pt[0] - pt[3];
4041 double A13 = pt[1] - pt[3];
4042 double A23 = pt[2] - pt[3];
4044 double B01 = dpt[0] - dpt[1];
4045 double B02 = dpt[0] - dpt[2];
4046 double B12 = dpt[1] - dpt[2];
4048 double tx0 = (bx1*bx2)/(B01*B02);
4049 double tx1 = -(bx0*bx2)/(B01*B12);
4050 double tx2 = (bx0*bx1)/(B02*B12);
4052 double ty0 = (by1*by2)/(B01*B02);
4053 double ty1 = -(by0*by2)/(B01*B12);
4054 double ty2 = (by0*by1)/(B02*B12);
4058 shape(0, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx0;
4060 shape(1, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx1;
4062 shape(2, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx2;
4064 shape(3, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty0;
4066 shape(4, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty1;
4068 shape(5, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty2;
4072 shape(6, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx2;
4074 shape(7, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx1;
4076 shape(8, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx0;
4078 shape(9, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty2;
4080 shape(10, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty1;
4082 shape(11, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty0;
4085 shape(12, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty0;
4087 shape(13, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty1;
4089 shape(14, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty2;
4092 shape(15, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty0;
4094 shape(16, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty1;
4096 shape(17, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty2;
4100 shape(18, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx0;
4102 shape(19, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx1;
4104 shape(20, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx2;
4107 shape(21, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx0;
4109 shape(22, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx1;
4111 shape(23, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx2;
4117 double x = ip.
x, y = ip.
y;
4119 double a01 = pt[0]*pt[1];
4120 double a02 = pt[0]*pt[2];
4121 double a12 = pt[1]*pt[2];
4122 double a03 = pt[0]*pt[3];
4123 double a13 = pt[1]*pt[3];
4124 double a23 = pt[2]*pt[3];
4126 double bx0 = dpt[0] - x;
4127 double bx1 = dpt[1] - x;
4128 double bx2 = dpt[2] - x;
4130 double by0 = dpt[0] - y;
4131 double by1 = dpt[1] - y;
4132 double by2 = dpt[2] - y;
4134 double A01 = pt[0] - pt[1];
4135 double A02 = pt[0] - pt[2];
4136 double A12 = pt[1] - pt[2];
4137 double A03 = pt[0] - pt[3];
4138 double A13 = pt[1] - pt[3];
4139 double A23 = pt[2] - pt[3];
4141 double A012 = pt[0] + pt[1] + pt[2];
4142 double A013 = pt[0] + pt[1] + pt[3];
4143 double A023 = pt[0] + pt[2] + pt[3];
4144 double A123 = pt[1] + pt[2] + pt[3];
4146 double B01 = dpt[0] - dpt[1];
4147 double B02 = dpt[0] - dpt[2];
4148 double B12 = dpt[1] - dpt[2];
4150 double tx0 = (bx1*bx2)/(B01*B02);
4151 double tx1 = -(bx0*bx2)/(B01*B12);
4152 double tx2 = (bx0*bx1)/(B02*B12);
4154 double ty0 = (by1*by2)/(B01*B02);
4155 double ty1 = -(by0*by2)/(B01*B12);
4156 double ty2 = (by0*by1)/(B02*B12);
4159 divshape(0) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx0;
4160 divshape(1) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx1;
4161 divshape(2) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx2;
4163 divshape(3) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty0;
4164 divshape(4) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty1;
4165 divshape(5) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty2;
4167 divshape(6) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx2;
4168 divshape(7) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx1;
4169 divshape(8) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx0;
4171 divshape(9) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty2;
4172 divshape(10) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty1;
4173 divshape(11) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty0;
4175 divshape(12) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty0;
4176 divshape(13) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty1;
4177 divshape(14) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty2;
4179 divshape(15) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty0;
4180 divshape(16) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty1;
4181 divshape(17) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty2;
4183 divshape(18) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx0;
4184 divshape(19) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx1;
4185 divshape(20) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx2;
4187 divshape(21) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx0;
4188 divshape(22) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx1;
4189 divshape(23) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx2;
4192 const double RT2QuadFiniteElement::nk[24][2] =
4195 {0,-1}, {0,-1}, {0,-1},
4197 {1, 0}, {1, 0}, {1, 0},
4199 {0, 1}, {0, 1}, {0, 1},
4201 {-1,0}, {-1,0}, {-1,0},
4203 {1, 0}, {1, 0}, {1, 0},
4205 {1, 0}, {1, 0}, {1, 0},
4207 {0, 1}, {0, 1}, {0, 1},
4209 {0, 1}, {0, 1}, {0, 1}
4216 #ifdef MFEM_THREAD_SAFE
4222 for (k = 0; k < 24; k++)
4225 for (j = 0; j < 24; j++)
4228 if (j == k) { d -= 1.0; }
4229 if (fabs(d) > 1.0e-12)
4231 mfem::err <<
"RT2QuadFiniteElement::GetLocalInterpolation (...)\n"
4232 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
4248 for (k = 0; k < 24; k++)
4251 ip.
x = vk[0]; ip.
y = vk[1];
4254 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
4255 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
4256 for (j = 0; j < 24; j++)
4257 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
4269 #ifdef MFEM_THREAD_SAFE
4273 for (
int k = 0; k < 24; k++)
4281 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
4282 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
4298 shape(0) = 2. - 3. * x;
4299 shape(1) = 3. * x - 1.;
4313 const double p = 0.11270166537925831148;
4323 const double p = 0.11270166537925831148;
4324 const double w = 1./((1-2*p)*(1-2*p));
4327 shape(0) = (2*x-1)*(x-1+p)*w;
4328 shape(1) = 4*(x-1+p)*(p-x)*w;
4329 shape(2) = (2*x-1)*(x-p)*w;
4335 const double p = 0.11270166537925831148;
4336 const double w = 1./((1-2*p)*(1-2*p));
4339 dshape(0,0) = (-3+4*x+2*p)*w;
4340 dshape(1,0) = (4-8*x)*w;
4341 dshape(2,0) = (-1+4*x-2*p)*w;
4352 for (i = 1; i < m; i++)
4358 #ifndef MFEM_THREAD_SAFE
4363 for (i = 1; i <= m; i++)
4365 rwk(i) = rwk(i-1) * ( (double)(m) / (double)(i) );
4367 for (i = 0; i < m/2+1; i++)
4369 rwk(m-i) = ( rwk(i) *= rwk(m-i) );
4371 for (i = m-1; i >= 0; i -= 2)
4380 double w, wk, x = ip.
x;
4383 #ifdef MFEM_THREAD_SAFE
4387 k = (int) floor ( m * x + 0.5 );
4388 k = k > m ? m : k < 0 ? 0 : k;
4391 for (i = 0; i <= m; i++)
4394 wk *= ( rxxk(i) = x - (double)(i) / m );
4396 w = wk * ( rxxk(k) = x - (double)(k) / m );
4400 shape(0) = w * rwk(0) / rxxk(0);
4404 shape(0) = wk * rwk(0);
4408 shape(1) = w * rwk(m) / rxxk(m);
4412 shape(1) = wk * rwk(k);
4414 for (i = 1; i < m; i++)
4417 shape(i+1) = w * rwk(i) / rxxk(i);
4421 shape(k+1) = wk * rwk(k);
4428 double s, srx, w, wk, x = ip.
x;
4431 #ifdef MFEM_THREAD_SAFE
4435 k = (int) floor ( m * x + 0.5 );
4436 k = k > m ? m : k < 0 ? 0 : k;
4439 for (i = 0; i <= m; i++)
4442 wk *= ( rxxk(i) = x - (double)(i) / m );
4444 w = wk * ( rxxk(k) = x - (double)(k) / m );
4446 for (i = 0; i <= m; i++)
4448 rxxk(i) = 1.0 / rxxk(i);
4451 for (i = 0; i <= m; i++)
4460 dshape(0,0) = (s - w * rxxk(0)) * rwk(0) * rxxk(0);
4464 dshape(0,0) = wk * srx * rwk(0);
4468 dshape(1,0) = (s - w * rxxk(m)) * rwk(m) * rxxk(m);
4472 dshape(1,0) = wk * srx * rwk(k);
4474 for (i = 1; i < m; i++)
4477 dshape(i+1,0) = (s - w * rxxk(i)) * rwk(i) * rxxk(i);
4481 dshape(k+1,0) = wk * srx * rwk(k);
4510 double L0, L1, L2, L3;
4512 L1 = ip.
x; L2 = ip.
y; L3 = ip.
z; L0 = 1.0 - L1 - L2 - L3;
4513 shape(0) = 1.0 - 3.0 * L0;
4514 shape(1) = 1.0 - 3.0 * L1;
4515 shape(2) = 1.0 - 3.0 * L2;
4516 shape(3) = 1.0 - 3.0 * L3;
4522 dshape(0,0) = 3.0; dshape(0,1) = 3.0; dshape(0,2) = 3.0;
4523 dshape(1,0) = -3.0; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
4524 dshape(2,0) = 0.0; dshape(2,1) = -3.0; dshape(2,2) = 0.0;
4525 dshape(3,0) = 0.0; dshape(3,1) = 0.0; dshape(3,2) = -3.0;
4546 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4567 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4581 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4582 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4583 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4584 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4585 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4586 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4587 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4588 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4590 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4591 I[ 9] = 1; J[ 9] = 2; K[ 9] = 0;
4592 I[10] = 2; J[10] = 1; K[10] = 0;
4593 I[11] = 0; J[11] = 2; K[11] = 0;
4594 I[12] = 2; J[12] = 0; K[12] = 1;
4595 I[13] = 1; J[13] = 2; K[13] = 1;
4596 I[14] = 2; J[14] = 1; K[14] = 1;
4597 I[15] = 0; J[15] = 2; K[15] = 1;
4598 I[16] = 0; J[16] = 0; K[16] = 2;
4599 I[17] = 1; J[17] = 0; K[17] = 2;
4600 I[18] = 1; J[18] = 1; K[18] = 2;
4601 I[19] = 0; J[19] = 1; K[19] = 2;
4603 I[20] = 2; J[20] = 2; K[20] = 0;
4604 I[21] = 2; J[21] = 0; K[21] = 2;
4605 I[22] = 1; J[22] = 2; K[22] = 2;
4606 I[23] = 2; J[23] = 1; K[23] = 2;
4607 I[24] = 0; J[24] = 2; K[24] = 2;
4608 I[25] = 2; J[25] = 2; K[25] = 1;
4610 I[26] = 2; J[26] = 2; K[26] = 2;
4612 else if (degree == 3)
4618 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4619 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4620 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4621 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4622 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4623 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4624 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4625 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4627 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4628 I[ 9] = 3; J[ 9] = 0; K[ 9] = 0;
4629 I[10] = 1; J[10] = 2; K[10] = 0;
4630 I[11] = 1; J[11] = 3; K[11] = 0;
4631 I[12] = 2; J[12] = 1; K[12] = 0;
4632 I[13] = 3; J[13] = 1; K[13] = 0;
4633 I[14] = 0; J[14] = 2; K[14] = 0;
4634 I[15] = 0; J[15] = 3; K[15] = 0;
4635 I[16] = 2; J[16] = 0; K[16] = 1;
4636 I[17] = 3; J[17] = 0; K[17] = 1;
4637 I[18] = 1; J[18] = 2; K[18] = 1;
4638 I[19] = 1; J[19] = 3; K[19] = 1;
4639 I[20] = 2; J[20] = 1; K[20] = 1;
4640 I[21] = 3; J[21] = 1; K[21] = 1;
4641 I[22] = 0; J[22] = 2; K[22] = 1;
4642 I[23] = 0; J[23] = 3; K[23] = 1;
4643 I[24] = 0; J[24] = 0; K[24] = 2;
4644 I[25] = 0; J[25] = 0; K[25] = 3;
4645 I[26] = 1; J[26] = 0; K[26] = 2;
4646 I[27] = 1; J[27] = 0; K[27] = 3;
4647 I[28] = 1; J[28] = 1; K[28] = 2;
4648 I[29] = 1; J[29] = 1; K[29] = 3;
4649 I[30] = 0; J[30] = 1; K[30] = 2;
4650 I[31] = 0; J[31] = 1; K[31] = 3;
4652 I[32] = 2; J[32] = 3; K[32] = 0;
4653 I[33] = 3; J[33] = 3; K[33] = 0;
4654 I[34] = 2; J[34] = 2; K[34] = 0;
4655 I[35] = 3; J[35] = 2; K[35] = 0;
4656 I[36] = 2; J[36] = 0; K[36] = 2;
4657 I[37] = 3; J[37] = 0; K[37] = 2;
4658 I[38] = 2; J[38] = 0; K[38] = 3;
4659 I[39] = 3; J[39] = 0; K[39] = 3;
4660 I[40] = 1; J[40] = 2; K[40] = 2;
4661 I[41] = 1; J[41] = 3; K[41] = 2;
4662 I[42] = 1; J[42] = 2; K[42] = 3;
4663 I[43] = 1; J[43] = 3; K[43] = 3;
4664 I[44] = 3; J[44] = 1; K[44] = 2;
4665 I[45] = 2; J[45] = 1; K[45] = 2;
4666 I[46] = 3; J[46] = 1; K[46] = 3;
4667 I[47] = 2; J[47] = 1; K[47] = 3;
4668 I[48] = 0; J[48] = 3; K[48] = 2;
4669 I[49] = 0; J[49] = 2; K[49] = 2;
4670 I[50] = 0; J[50] = 3; K[50] = 3;
4671 I[51] = 0; J[51] = 2; K[51] = 3;
4672 I[52] = 2; J[52] = 2; K[52] = 1;
4673 I[53] = 3; J[53] = 2; K[53] = 1;
4674 I[54] = 2; J[54] = 3; K[54] = 1;
4675 I[55] = 3; J[55] = 3; K[55] = 1;
4677 I[56] = 2; J[56] = 2; K[56] = 2;
4678 I[57] = 3; J[57] = 2; K[57] = 2;
4679 I[58] = 3; J[58] = 3; K[58] = 2;
4680 I[59] = 2; J[59] = 3; K[59] = 2;
4681 I[60] = 2; J[60] = 2; K[60] = 3;
4682 I[61] = 3; J[61] = 2; K[61] = 3;
4683 I[62] = 3; J[62] = 3; K[62] = 3;
4684 I[63] = 2; J[63] = 3; K[63] = 3;
4688 mfem_error (
"LagrangeHexFiniteElement::LagrangeHexFiniteElement");
4692 dof1d = fe1d ->
GetDof();
4694 #ifndef MFEM_THREAD_SAFE
4704 for (
int n = 0; n <
Dof; n++)
4719 #ifdef MFEM_THREAD_SAFE
4720 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4727 for (
int n = 0; n <
Dof; n++)
4729 shape(n) = shape1dx(I[n]) * shape1dy(J[n]) * shape1dz(K[n]);
4740 #ifdef MFEM_THREAD_SAFE
4741 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4742 DenseMatrix dshape1dx(dof1d,1), dshape1dy(dof1d,1), dshape1dz(dof1d,1);
4753 for (
int n = 0; n <
Dof; n++)
4755 dshape(n,0) = dshape1dx(I[n],0) * shape1dy(J[n]) * shape1dz(K[n]);
4756 dshape(n,1) = shape1dx(I[n]) * dshape1dy(J[n],0) * shape1dz(K[n]);
4757 dshape(n,2) = shape1dx(I[n]) * shape1dy(J[n]) * dshape1dz(K[n],0);
4786 shape(0) = 1.0 - 2.0 * x;
4793 shape(1) = 2.0 * x - 1.0;
4794 shape(2) = 2.0 - 2.0 * x;
4805 dshape(0,0) = - 2.0;
4813 dshape(2,0) = - 2.0;
4840 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4841 L1 = 2.0 * ( ip.
x );
4842 L2 = 2.0 * ( ip.
y );
4851 for (i = 0; i < 6; i++)
4858 shape(0) = L0 - 1.0;
4865 shape(1) = L1 - 1.0;
4872 shape(2) = L2 - 1.0;
4876 shape(3) = 1.0 - L2;
4877 shape(4) = 1.0 - L0;
4878 shape(5) = 1.0 - L1;
4888 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4889 L1 = 2.0 * ( ip.
x );
4890 L2 = 2.0 * ( ip.
y );
4892 double DL0[2], DL1[2], DL2[2];
4893 DL0[0] = -2.0; DL0[1] = -2.0;
4894 DL1[0] = 2.0; DL1[1] = 0.0;
4895 DL2[0] = 0.0; DL2[1] = 2.0;
4897 for (i = 0; i < 6; i++)
4898 for (j = 0; j < 2; j++)
4905 for (j = 0; j < 2; j++)
4907 dshape(0,j) = DL0[j];
4908 dshape(3,j) = DL1[j];
4909 dshape(5,j) = DL2[j];
4914 for (j = 0; j < 2; j++)
4916 dshape(3,j) = DL0[j];
4917 dshape(1,j) = DL1[j];
4918 dshape(4,j) = DL2[j];
4923 for (j = 0; j < 2; j++)
4925 dshape(5,j) = DL0[j];
4926 dshape(4,j) = DL1[j];
4927 dshape(2,j) = DL2[j];
4932 for (j = 0; j < 2; j++)
4934 dshape(3,j) = - DL2[j];
4935 dshape(4,j) = - DL0[j];
4936 dshape(5,j) = - DL1[j];
4981 double L0, L1, L2, L3, L4, L5;
4982 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
4983 L1 = 2.0 * ( ip.
x );
4984 L2 = 2.0 * ( ip.
y );
4985 L3 = 2.0 * ( ip.
z );
4986 L4 = 2.0 * ( ip.
x + ip.
y );
4987 L5 = 2.0 * ( ip.
y + ip.
z );
5000 for (i = 0; i < 10; i++)
5007 shape(0) = L0 - 1.0;
5015 shape(1) = L1 - 1.0;
5023 shape(2) = L2 - 1.0;
5031 shape(3) = L3 - 1.0;
5033 else if ((L4 <= 1.0) && (L5 <= 1.0))
5035 shape(4) = 1.0 - L5;
5037 shape(6) = 1.0 - L4;
5038 shape(8) = 1.0 - L0;
5040 else if ((L4 >= 1.0) && (L5 <= 1.0))
5042 shape(4) = 1.0 - L5;
5043 shape(5) = 1.0 - L1;
5044 shape(7) = L4 - 1.0;
5047 else if ((L4 <= 1.0) && (L5 >= 1.0))
5049 shape(5) = 1.0 - L3;
5050 shape(6) = 1.0 - L4;
5052 shape(9) = L5 - 1.0;
5054 else if ((L4 >= 1.0) && (L5 >= 1.0))
5057 shape(7) = L4 - 1.0;
5058 shape(8) = 1.0 - L2;
5059 shape(9) = L5 - 1.0;
5068 double L0, L1, L2, L3, L4, L5;
5069 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5070 L1 = 2.0 * ( ip.
x );
5071 L2 = 2.0 * ( ip.
y );
5072 L3 = 2.0 * ( ip.
z );
5073 L4 = 2.0 * ( ip.
x + ip.
y );
5074 L5 = 2.0 * ( ip.
y + ip.
z );
5076 double DL0[3], DL1[3], DL2[3], DL3[3], DL4[3], DL5[3];
5077 DL0[0] = -2.0; DL0[1] = -2.0; DL0[2] = -2.0;
5078 DL1[0] = 2.0; DL1[1] = 0.0; DL1[2] = 0.0;
5079 DL2[0] = 0.0; DL2[1] = 2.0; DL2[2] = 0.0;
5080 DL3[0] = 0.0; DL3[1] = 0.0; DL3[2] = 2.0;
5081 DL4[0] = 2.0; DL4[1] = 2.0; DL4[2] = 0.0;
5082 DL5[0] = 0.0; DL5[1] = 2.0; DL5[2] = 2.0;
5084 for (i = 0; i < 10; i++)
5085 for (j = 0; j < 3; j++)
5092 for (j = 0; j < 3; j++)
5094 dshape(0,j) = DL0[j];
5095 dshape(4,j) = DL1[j];
5096 dshape(5,j) = DL2[j];
5097 dshape(6,j) = DL3[j];
5102 for (j = 0; j < 3; j++)
5104 dshape(4,j) = DL0[j];
5105 dshape(1,j) = DL1[j];
5106 dshape(7,j) = DL2[j];
5107 dshape(8,j) = DL3[j];
5112 for (j = 0; j < 3; j++)
5114 dshape(5,j) = DL0[j];
5115 dshape(7,j) = DL1[j];
5116 dshape(2,j) = DL2[j];
5117 dshape(9,j) = DL3[j];
5122 for (j = 0; j < 3; j++)
5124 dshape(6,j) = DL0[j];
5125 dshape(8,j) = DL1[j];
5126 dshape(9,j) = DL2[j];
5127 dshape(3,j) = DL3[j];
5130 else if ((L4 <= 1.0) && (L5 <= 1.0))
5132 for (j = 0; j < 3; j++)
5134 dshape(4,j) = - DL5[j];
5135 dshape(5,j) = DL2[j];
5136 dshape(6,j) = - DL4[j];
5137 dshape(8,j) = - DL0[j];
5140 else if ((L4 >= 1.0) && (L5 <= 1.0))
5142 for (j = 0; j < 3; j++)
5144 dshape(4,j) = - DL5[j];
5145 dshape(5,j) = - DL1[j];
5146 dshape(7,j) = DL4[j];
5147 dshape(8,j) = DL3[j];
5150 else if ((L4 <= 1.0) && (L5 >= 1.0))
5152 for (j = 0; j < 3; j++)
5154 dshape(5,j) = - DL3[j];
5155 dshape(6,j) = - DL4[j];
5156 dshape(8,j) = DL1[j];
5157 dshape(9,j) = DL5[j];
5160 else if ((L4 >= 1.0) && (L5 >= 1.0))
5162 for (j = 0; j < 3; j++)
5164 dshape(5,j) = DL0[j];
5165 dshape(7,j) = DL4[j];
5166 dshape(8,j) = - DL2[j];
5167 dshape(9,j) = DL5[j];
5200 double x = ip.
x, y = ip.
y;
5202 Lx = 2.0 * ( 1. - x );
5203 Ly = 2.0 * ( 1. - y );
5212 for (i = 0; i < 9; i++)
5217 if ((x <= 0.5) && (y <= 0.5))
5219 shape(0) = (Lx - 1.0) * (Ly - 1.0);
5220 shape(4) = (2.0 - Lx) * (Ly - 1.0);
5221 shape(8) = (2.0 - Lx) * (2.0 - Ly);
5222 shape(7) = (Lx - 1.0) * (2.0 - Ly);
5224 else if ((x >= 0.5) && (y <= 0.5))
5226 shape(4) = Lx * (Ly - 1.0);
5227 shape(1) = (1.0 - Lx) * (Ly - 1.0);
5228 shape(5) = (1.0 - Lx) * (2.0 - Ly);
5229 shape(8) = Lx * (2.0 - Ly);
5231 else if ((x >= 0.5) && (y >= 0.5))
5233 shape(8) = Lx * Ly ;
5234 shape(5) = (1.0 - Lx) * Ly ;
5235 shape(2) = (1.0 - Lx) * (1.0 - Ly);
5236 shape(6) = Lx * (1.0 - Ly);
5238 else if ((x <= 0.5) && (y >= 0.5))
5240 shape(7) = (Lx - 1.0) * Ly ;
5241 shape(8) = (2.0 - Lx) * Ly ;
5242 shape(6) = (2.0 - Lx) * (1.0 - Ly);
5243 shape(3) = (Lx - 1.0) * (1.0 - Ly);
5251 double x = ip.
x, y = ip.
y;
5253 Lx = 2.0 * ( 1. - x );
5254 Ly = 2.0 * ( 1. - y );
5256 for (i = 0; i < 9; i++)
5257 for (j = 0; j < 2; j++)
5262 if ((x <= 0.5) && (y <= 0.5))
5264 dshape(0,0) = 2.0 * (1.0 - Ly);
5265 dshape(0,1) = 2.0 * (1.0 - Lx);
5267 dshape(4,0) = 2.0 * (Ly - 1.0);
5268 dshape(4,1) = -2.0 * (2.0 - Lx);
5270 dshape(8,0) = 2.0 * (2.0 - Ly);
5271 dshape(8,1) = 2.0 * (2.0 - Lx);
5273 dshape(7,0) = -2.0 * (2.0 - Ly);
5274 dshape(7,0) = 2.0 * (Lx - 1.0);
5276 else if ((x >= 0.5) && (y <= 0.5))
5278 dshape(4,0) = -2.0 * (Ly - 1.0);
5279 dshape(4,1) = -2.0 * Lx;
5281 dshape(1,0) = 2.0 * (Ly - 1.0);
5282 dshape(1,1) = -2.0 * (1.0 - Lx);
5284 dshape(5,0) = 2.0 * (2.0 - Ly);
5285 dshape(5,1) = 2.0 * (1.0 - Lx);
5287 dshape(8,0) = -2.0 * (2.0 - Ly);
5288 dshape(8,1) = 2.0 * Lx;
5290 else if ((x >= 0.5) && (y >= 0.5))
5292 dshape(8,0) = -2.0 * Ly;
5293 dshape(8,1) = -2.0 * Lx;
5295 dshape(5,0) = 2.0 * Ly;
5296 dshape(5,1) = -2.0 * (1.0 - Lx);
5298 dshape(2,0) = 2.0 * (1.0 - Ly);
5299 dshape(2,1) = 2.0 * (1.0 - Lx);
5301 dshape(6,0) = -2.0 * (1.0 - Ly);
5302 dshape(6,1) = 2.0 * Lx;
5304 else if ((x <= 0.5) && (y >= 0.5))
5306 dshape(7,0) = -2.0 * Ly;
5307 dshape(7,1) = -2.0 * (Lx - 1.0);
5309 dshape(8,0) = 2.0 * Ly ;
5310 dshape(8,1) = -2.0 * (2.0 - Lx);
5312 dshape(6,0) = 2.0 * (1.0 - Ly);
5313 dshape(6,1) = 2.0 * (2.0 - Lx);
5315 dshape(3,0) = -2.0 * (1.0 - Ly);
5316 dshape(3,1) = 2.0 * (Lx - 1.0);
5327 I[ 0] = 0.0; J[ 0] = 0.0; K[ 0] = 0.0;
5328 I[ 1] = 1.0; J[ 1] = 0.0; K[ 1] = 0.0;
5329 I[ 2] = 1.0; J[ 2] = 1.0; K[ 2] = 0.0;
5330 I[ 3] = 0.0; J[ 3] = 1.0; K[ 3] = 0.0;
5331 I[ 4] = 0.0; J[ 4] = 0.0; K[ 4] = 1.0;
5332 I[ 5] = 1.0; J[ 5] = 0.0; K[ 5] = 1.0;
5333 I[ 6] = 1.0; J[ 6] = 1.0; K[ 6] = 1.0;
5334 I[ 7] = 0.0; J[ 7] = 1.0; K[ 7] = 1.0;
5336 I[ 8] = 0.5; J[ 8] = 0.0; K[ 8] = 0.0;
5337 I[ 9] = 1.0; J[ 9] = 0.5; K[ 9] = 0.0;
5338 I[10] = 0.5; J[10] = 1.0; K[10] = 0.0;
5339 I[11] = 0.0; J[11] = 0.5; K[11] = 0.0;
5340 I[12] = 0.5; J[12] = 0.0; K[12] = 1.0;
5341 I[13] = 1.0; J[13] = 0.5; K[13] = 1.0;
5342 I[14] = 0.5; J[14] = 1.0; K[14] = 1.0;
5343 I[15] = 0.0; J[15] = 0.5; K[15] = 1.0;
5344 I[16] = 0.0; J[16] = 0.0; K[16] = 0.5;
5345 I[17] = 1.0; J[17] = 0.0; K[17] = 0.5;
5346 I[18] = 1.0; J[18] = 1.0; K[18] = 0.5;
5347 I[19] = 0.0; J[19] = 1.0; K[19] = 0.5;
5349 I[20] = 0.5; J[20] = 0.5; K[20] = 0.0;
5350 I[21] = 0.5; J[21] = 0.0; K[21] = 0.5;
5351 I[22] = 1.0; J[22] = 0.5; K[22] = 0.5;
5352 I[23] = 0.5; J[23] = 1.0; K[23] = 0.5;
5353 I[24] = 0.0; J[24] = 0.5; K[24] = 0.5;
5354 I[25] = 0.5; J[25] = 0.5; K[25] = 1.0;
5356 I[26] = 0.5; J[26] = 0.5; K[26] = 0.5;
5358 for (
int n = 0; n < 27; n++)
5371 double x = ip.
x, y = ip.
y, z = ip.
z;
5373 for (i = 0; i < 27; i++)
5378 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5393 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5408 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))