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::ProjectFromNodes() (vector) is not overloaded!");
151 mfem_error(
"FiniteElement::ProjectMatrixCoefficient() is not overloaded !");
156 mfem_error(
"FiniteElement::ProjectDelta(...) is not implemented for "
163 mfem_error(
"FiniteElement::Project(...) (fe version) is not implemented "
164 "for this element!");
171 mfem_error(
"FiniteElement::ProjectGrad(...) is not implemented for "
179 mfem_error(
"FiniteElement::ProjectCurl(...) is not implemented for "
187 mfem_error(
"FiniteElement::ProjectDiv(...) is not implemented for "
205 #ifdef MFEM_THREAD_SAFE
225 int size = (
dim*(
dim+1))/2;
231 for (
int nd = 0; nd <
dof; nd++)
233 Laplacian[nd] = hess(nd,0) + hess(nd,4) + hess(nd,5);
238 for (
int nd = 0; nd <
dof; nd++)
240 Laplacian[nd] = hess(nd,0) + hess(nd,2);
245 for (
int nd = 0; nd <
dof; nd++)
247 Laplacian[nd] = hess(nd,0);
258 int size = (
dim*(
dim+1))/2;
269 scale[1] = 2*Gij(0,1);
270 scale[2] = 2*Gij(0,2);
272 scale[3] = 2*Gij(1,2);
280 scale[1] = 2*Gij(0,1);
288 for (
int nd = 0; nd <
dof; nd++)
291 for (
int ii = 0; ii < size; ii++)
293 Laplacian[nd] += hess(nd,ii)*scale[ii];
334 int size = (dim*(dim+1))/2;
352 for (
int i = 0; i <
dim; i++)
354 for (
int j = 0; j <
dim; j++)
356 for (
int k = 0; k <
dim; k++)
358 for (
int l = 0; l <
dim; l++)
360 lhm(map[i*dim+j],map[k*dim+l]) += invJ(i,k)*invJ(j,l);
368 for (
int i = 0; i < dim*
dim; i++) { mult[map[i]]++; }
373 Mult( hess, lhm, Hessian);
379 mfem_error(
"FiniteElement::GetDofToQuad(...) is not implemented for "
401 #ifdef MFEM_THREAD_SAFE
408 for (
int i = 0; i < fine_fe.
dof; i++)
413 for (
int j = 0; j <
dof; j++)
414 if (fabs(I(i,j) =
c_shape(j)) < 1.0e-12)
439 Vector fine_shape(fs), coarse_shape(cs);
440 DenseMatrix fine_mass(fs), fine_coarse_mass(fs, cs);
457 fine_mass_inv.
Mult(fine_coarse_mass, I);
475 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
489 #ifdef MFEM_THREAD_SAFE
493 for (
int i = 0; i < nqpt; i++)
497 for (
int j = 0; j <
dof; j++)
499 d2q->
B[i+nqpt*j] = d2q->
Bt[j+dof*i] =
c_shape(j);
502 for (
int d = 0; d <
dim; d++)
504 for (
int j = 0; j <
dof; j++)
506 d2q->
G[i+nqpt*(d+dim*j)] = d2q->
Gt[j+dof*(i+nqpt*d)] =
vshape(j,d);
524 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
529 const int ndof =
order + 1;
530 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
dim) + 0.5);
540 Vector val(ndof), grad(ndof);
541 for (
int i = 0; i < nqpt; i++)
546 for (
int j = 0; j < ndof; j++)
548 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
549 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
566 for (
int i = 0; i <
dof; i++)
569 for (
int j = 0; j < fe.
GetDof(); j++)
571 curl(i,j) = curl_shape(j,0);
598 #ifdef MFEM_THREAD_SAFE
604 for (
int j = 0; j <
dof; j++)
624 for (
int i = 0; i <
dof; i++)
630 dofs(i) = coeff.
Eval (Trans, ip);
633 dofs(i) *= Trans.
Weight();
644 for (
int i = 0; i <
dof; i++)
648 vc.
Eval (x, Trans, ip);
653 for (
int j = 0; j < x.Size(); j++)
655 dofs(dof*j+i) = x(j);
667 for (
int k = 0; k <
dof; k++)
672 for (
int r = 0; r < MQ.Height(); r++)
674 for (
int d = 0; d < MQ.Width(); d++)
676 dofs(k+dof*(d+MQ.Width()*r)) = MQ(r,d);
692 for (
int k = 0; k <
dof; k++)
695 for (
int j = 0; j < shape.Size(); j++)
697 I(k,j) = (fabs(shape(j)) < 1e-12) ? 0.0 : shape(j);
706 for (
int k = 0; k <
dof; k++)
717 I(k+d*dof,j) =
vshape(j,d);
733 for (
int k = 0; k <
dof; k++)
739 Mult(dshape, Jinv, grad_k);
744 for (
int j = 0; j < grad_k.Height(); j++)
745 for (
int d = 0; d <
dim; d++)
747 grad(k+d*dof,j) = grad_k(j,d);
760 for (
int k = 0; k <
dof; k++)
768 for (
int j = 0; j < div_shape.Size(); j++)
770 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j)/detJ;
775 for (
int j = 0; j < div_shape.Size(); j++)
777 div(k,j) = (fabs(div_shape(j)) < 1e-12) ? 0.0 : div_shape(j);
787 for (
int i = 0; i <
dof; i++)
791 dofs(i) = coeff.
Eval(Trans, ip);
801 for (
int i = 0; i <
dof; i++)
805 vc.
Eval (x, Trans, ip);
806 for (
int j = 0; j < x.Size(); j++)
808 dofs(dof*j+i) = x(j);
835 pos_mass_inv.
Mult(mixed_mass, I);
840 void VectorFiniteElement::CalcShape (
843 mfem_error (
"Error: Cannot use scalar CalcShape(...) function with\n"
844 " VectorFiniteElements!");
847 void VectorFiniteElement::CalcDShape (
848 const IntegrationPoint &ip, DenseMatrix &dshape )
const
850 mfem_error (
"Error: Cannot use scalar CalcDShape(...) function with\n"
851 " VectorFiniteElements!");
883 MFEM_ABORT(
"Invalid dimension, Dim = " <<
dim);
887 MFEM_ABORT(
"Invalid MapType = " <<
map_type);
895 #ifdef MFEM_THREAD_SAFE
900 shape *= (1.0 / Trans.
Weight());
907 #ifdef MFEM_THREAD_SAFE
920 MFEM_ASSERT(vc.
GetVDim() == sdim,
"");
922 const bool square_J = (
dim == sdim);
924 for (
int k = 0; k <
dof; k++)
930 if (!square_J) { dofs(k) /= Trans.
Weight(); }
939 const bool square_J = (
dim == sdim);
941 for (
int k = 0; k <
dof; k++)
947 if (!square_J) { dofs(k) /= Trans.
Weight(); }
958 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
959 const bool square_J = (
dim == sdim);
961 Vector nk_phys(sdim), dofs_k(MQ.Height());
962 MFEM_ASSERT(dofs.
Size() ==
dof*MQ.Height(),
"");
964 for (
int k = 0; k <
dof; k++)
970 if (!square_J) { nk_phys /= T.
Weight(); }
971 MQ.Mult(nk_phys, dofs_k);
972 for (
int r = 0; r < MQ.Height(); r++)
974 dofs(k+dof*r) = dofs_k(r);
990 for (
int k = 0; k <
dof; k++)
999 double w = 1.0/Trans.
Weight();
1000 for (
int d = 0; d <
dim; d++)
1006 for (
int j = 0; j < shape.Size(); j++)
1008 double s = shape(j);
1009 if (fabs(s) < 1e-12)
1013 for (
int d = 0; d < sdim; d++)
1015 I(k,j+d*shape.Size()) = s*vk[d];
1022 mfem_error(
"VectorFiniteElement::Project_RT (fe version)");
1032 mfem_error(
"VectorFiniteElement::ProjectGrad_RT works only in 2D!");
1040 for (
int k = 0; k <
dof; k++)
1043 tk[0] = nk[d2n[k]*
dim+1];
1044 tk[1] = -nk[d2n[k]*
dim];
1045 dshape.Mult(tk, grad_k);
1046 for (
int j = 0; j < grad_k.Size(); j++)
1048 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1057 #ifdef MFEM_THREAD_SAFE
1070 for (
int k = 0; k <
dof; k++)
1077 J *= 1.0 / Trans.
Weight();
1084 for (
int j = 0; j < curl_k.Size(); j++)
1086 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1099 for (
int k = 0; k <
dof; k++)
1102 curl_shape.Mult(nk + d2n[k]*
dim, curl_k);
1103 for (
int j = 0; j < curl_k.Size(); j++)
1105 curl(k,j) = (fabs(curl_k(j)) < 1e-12) ? 0.0 : curl_k(j);
1117 for (
int k = 0; k <
dof; k++)
1131 for (
int k = 0; k <
dof; k++)
1147 MFEM_ASSERT(mc.
GetWidth() == sdim,
"");
1149 Vector tk_phys(sdim), dofs_k(MQ.Height());
1150 MFEM_ASSERT(dofs.
Size() ==
dof*MQ.Height(),
"");
1152 for (
int k = 0; k <
dof; k++)
1158 MQ.Mult(tk_phys, dofs_k);
1159 for (
int r = 0; r < MQ.Height(); r++)
1161 dofs(k+dof*r) = dofs_k(r);
1177 for (
int k = 0; k <
dof; k++)
1186 double w = 1.0/Trans.
Weight();
1187 for (
int d = 0; d < sdim; d++)
1193 for (
int j = 0; j < shape.Size(); j++)
1195 double s = shape(j);
1196 if (fabs(s) < 1e-12)
1200 for (
int d = 0; d < sdim; d++)
1202 I(k, j + d*shape.Size()) = s*vk[d];
1209 mfem_error(
"VectorFiniteElement::Project_ND (fe version)");
1223 for (
int k = 0; k <
dof; k++)
1226 dshape.Mult(tk + d2t[k]*
dim, grad_k);
1227 for (
int j = 0; j < grad_k.Size(); j++)
1229 grad(k,j) = (fabs(grad_k(j)) < 1e-12) ? 0.0 : grad_k(j);
1243 #ifdef MFEM_THREAD_SAFE
1253 for (
int k = 0; k <
dof; k++)
1264 for (
int i = 0; i <
dim; i++)
1266 Ikj +=
vshape(j, i) * vk[i];
1268 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1280 #ifdef MFEM_THREAD_SAFE
1290 for (
int k = 0; k <
dof; k++)
1301 for (
int i = 0; i <
dim; i++)
1303 Ikj +=
vshape(j, i) * vk[i];
1305 I(k, j) = (fabs(Ikj) < 1e-12) ? 0.0 : Ikj;
1318 #ifdef MFEM_THREAD_SAFE
1324 const double weight = Trans.
Weight();
1325 for (
int j = 0; j <
dof; j++)
1334 for (
int k = 0; k <
dof; k++)
1337 for (
int d = 0; d <
dim; d++)
1339 R_jk +=
vshape(k,d)*pt_data[d];
1361 #ifdef MFEM_THREAD_SAFE
1367 for (
int j = 0; j <
dof; j++)
1374 Jinv.
Mult(tk+
dim*d2t[j], pt_data);
1375 for (
int k = 0; k <
dof; k++)
1378 for (
int d = 0; d <
dim; d++)
1380 R_jk +=
vshape(k,d)*pt_data[d];
1423 shape(0) = 1. - ip.
x;
1448 shape(0) = 1. - ip.
x - ip.
y;
1456 dshape(0,0) = -1.; dshape(0,1) = -1.;
1457 dshape(1,0) = 1.; dshape(1,1) = 0.;
1458 dshape(2,0) = 0.; dshape(2,1) = 1.;
1477 shape(0) = (1. - ip.
x) * (1. - ip.
y) ;
1478 shape(1) = ip.
x * (1. - ip.
y) ;
1479 shape(2) = ip.
x * ip.
y ;
1480 shape(3) = (1. - ip.
x) * ip.
y ;
1486 dshape(0,0) = -1. + ip.
y; dshape(0,1) = -1. + ip.
x ;
1487 dshape(1,0) = 1. - ip.
y; dshape(1,1) = -ip.
x ;
1488 dshape(2,0) = ip.
y ; dshape(2,1) = ip.
x ;
1489 dshape(3,0) = -ip.
y ; dshape(3,1) = 1. - ip.
x ;
1495 h(0,0) = 0.; h(0,1) = 1.; h(0,2) = 0.;
1496 h(1,0) = 0.; h(1,1) = -1.; h(1,2) = 0.;
1497 h(2,0) = 0.; h(2,1) = 1.; h(2,2) = 0.;
1498 h(3,0) = 0.; h(3,1) = -1.; h(3,2) = 0.;
1516 const double x = ip.
x, y = ip.
y;
1518 shape(0) = 5./3. - 2. * (x + y);
1519 shape(1) = 2. * (x - 1./6.);
1520 shape(2) = 2. * (y - 1./6.);
1526 dshape(0,0) = -2.; dshape(0,1) = -2.;
1527 dshape(1,0) = 2.; dshape(1,1) = 0.;
1528 dshape(2,0) = 0.; dshape(2,1) = 2.;
1533 dofs(vertex) = 2./3.;
1534 dofs((vertex+1)%3) = 1./6.;
1535 dofs((vertex+2)%3) = 1./6.;
1540 const double GaussBiLinear2DFiniteElement::p[] =
1541 { 0.2113248654051871177454256, 0.7886751345948128822545744 };
1559 const double x = ip.
x, y = ip.
y;
1561 shape(0) = 3. * (p[1] - x) * (p[1] - y);
1562 shape(1) = 3. * (x - p[0]) * (p[1] - y);
1563 shape(2) = 3. * (x - p[0]) * (y - p[0]);
1564 shape(3) = 3. * (p[1] - x) * (y - p[0]);
1570 const double x = ip.
x, y = ip.
y;
1572 dshape(0,0) = 3. * (y - p[1]); dshape(0,1) = 3. * (x - p[1]);
1573 dshape(1,0) = 3. * (p[1] - y); dshape(1,1) = 3. * (p[0] - x);
1574 dshape(2,0) = 3. * (y - p[0]); dshape(2,1) = 3. * (x - p[0]);
1575 dshape(3,0) = 3. * (p[0] - y); dshape(3,1) = 3. * (p[1] - x);
1581 dofs(vertex) = p[1]*p[1];
1582 dofs((vertex+1)%4) = p[0]*p[1];
1583 dofs((vertex+2)%4) = p[0]*p[0];
1584 dofs((vertex+3)%4) = p[0]*p[1];
1605 shape(0) = 1. - ip.
x - ip.
y;
1613 dshape(0,0) = -1.; dshape(0,1) = -1.;
1614 dshape(1,0) = 1.; dshape(1,1) = 0.;
1615 dshape(2,0) = 0.; dshape(2,1) = 1.;
1631 double l1 = 1.0 - x, l2 = x, l3 = 2. * x - 1.;
1633 shape(0) = l1 * (-l3);
1635 shape(2) = 4. * l1 * l2;
1643 dshape(0,0) = 4. * x - 3.;
1644 dshape(1,0) = 4. * x - 1.;
1645 dshape(2,0) = 4. - 8. * x;
1660 const double x = ip.
x, x1 = 1. - x;
1664 shape(2) = 2. * x * x1;
1670 const double x = ip.
x;
1672 dshape(0,0) = 2. * x - 2.;
1673 dshape(1,0) = 2. * x;
1674 dshape(2,0) = 2. - 4. * x;
1697 double x = ip.
x, y = ip.
y;
1698 double l1 = 1.-x-y, l2 = x, l3 = y;
1700 shape(0) = l1 * (2. * l1 - 1.);
1701 shape(1) = l2 * (2. * l2 - 1.);
1702 shape(2) = l3 * (2. * l3 - 1.);
1703 shape(3) = 4. * l1 * l2;
1704 shape(4) = 4. * l2 * l3;
1705 shape(5) = 4. * l3 * l1;
1711 double x = ip.
x, y = ip.
y;
1714 dshape(0,1) = 4. * (x + y) - 3.;
1716 dshape(1,0) = 4. * x - 1.;
1720 dshape(2,1) = 4. * y - 1.;
1722 dshape(3,0) = -4. * (2. * x + y - 1.);
1723 dshape(3,1) = -4. * x;
1725 dshape(4,0) = 4. * y;
1726 dshape(4,1) = 4. * x;
1728 dshape(5,0) = -4. * y;
1729 dshape(5,1) = -4. * (x + 2. * y - 1.);
1769 case 0: dofs(3) = 0.25; dofs(5) = 0.25;
break;
1770 case 1: dofs(3) = 0.25; dofs(4) = 0.25;
break;
1771 case 2: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1777 const double GaussQuad2DFiniteElement::p[] =
1778 { 0.0915762135097707434595714634022015, 0.445948490915964886318329253883051 };
1796 for (
int i = 0; i < 6; i++)
1813 const double x = ip.
x, y = ip.
y;
1827 const double x = ip.
x, y = ip.
y;
1828 D(0,0) = 0.; D(0,1) = 0.;
1829 D(1,0) = 1.; D(1,1) = 0.;
1830 D(2,0) = 0.; D(2,1) = 1.;
1831 D(3,0) = 2. * x; D(3,1) = 0.;
1832 D(4,0) = y; D(4,1) = x;
1833 D(5,0) = 0.; D(5,1) = 2. * y;
1865 double x = ip.
x, y = ip.
y;
1866 double l1x, l2x, l3x, l1y, l2y, l3y;
1868 l1x = (x - 1.) * (2. * x - 1);
1869 l2x = 4. * x * (1. - x);
1870 l3x = x * (2. * x - 1.);
1871 l1y = (y - 1.) * (2. * y - 1);
1872 l2y = 4. * y * (1. - y);
1873 l3y = y * (2. * y - 1.);
1875 shape(0) = l1x * l1y;
1876 shape(4) = l2x * l1y;
1877 shape(1) = l3x * l1y;
1878 shape(7) = l1x * l2y;
1879 shape(8) = l2x * l2y;
1880 shape(5) = l3x * l2y;
1881 shape(3) = l1x * l3y;
1882 shape(6) = l2x * l3y;
1883 shape(2) = l3x * l3y;
1889 double x = ip.
x, y = ip.
y;
1890 double l1x, l2x, l3x, l1y, l2y, l3y;
1891 double d1x, d2x, d3x, d1y, d2y, d3y;
1893 l1x = (x - 1.) * (2. * x - 1);
1894 l2x = 4. * x * (1. - x);
1895 l3x = x * (2. * x - 1.);
1896 l1y = (y - 1.) * (2. * y - 1);
1897 l2y = 4. * y * (1. - y);
1898 l3y = y * (2. * y - 1.);
1907 dshape(0,0) = d1x * l1y;
1908 dshape(0,1) = l1x * d1y;
1910 dshape(4,0) = d2x * l1y;
1911 dshape(4,1) = l2x * d1y;
1913 dshape(1,0) = d3x * l1y;
1914 dshape(1,1) = l3x * d1y;
1916 dshape(7,0) = d1x * l2y;
1917 dshape(7,1) = l1x * d2y;
1919 dshape(8,0) = d2x * l2y;
1920 dshape(8,1) = l2x * d2y;
1922 dshape(5,0) = d3x * l2y;
1923 dshape(5,1) = l3x * d2y;
1925 dshape(3,0) = d1x * l3y;
1926 dshape(3,1) = l1x * d3y;
1928 dshape(6,0) = d2x * l3y;
1929 dshape(6,1) = l2x * d3y;
1931 dshape(2,0) = d3x * l3y;
1932 dshape(2,1) = l3x * d3y;
1944 case 0: dofs(4) = 0.25; dofs(7) = 0.25;
break;
1945 case 1: dofs(4) = 0.25; dofs(5) = 0.25;
break;
1946 case 2: dofs(5) = 0.25; dofs(6) = 0.25;
break;
1947 case 3: dofs(6) = 0.25; dofs(7) = 0.25;
break;
1963 TensorBasisElement::DofMapType::Sr_DOF_MAP);
1974 for (
int j = 0; j <=
p; j++)
1976 for (
int i = 0; i <=
p; i++)
1992 double x = ip.
x, y = ip.
y;
1998 edgeNodalBasis.Eval(x, nodalX);
1999 edgeNodalBasis.Eval(y, nodalY);
2003 for (
int i = 0; i < p-1; i++)
2005 shape(4 + 0*(p-1) + i) = (nodalX(i+1))*(1.-y);
2006 shape(4 + 1*(p-1) + i) = (nodalY(i+1))*x;
2007 shape(4 + 3*(p-1) - i - 1) = (nodalX(i+1)) * y;
2008 shape(4 + 4*(p-1) - i - 1) = (nodalY(i+1)) * (1. - x);
2026 for (
int i = 0; i<p-1; i++)
2028 vtx0fix += (1-edgePts[i+1])*(shape(4 + i) +
2029 shape(4 + 4*(p-1) - i - 1));
2030 vtx1fix += (1-edgePts[i+1])*(shape(4 + 1*(p-1) + i) +
2031 shape(4 + (p-2)-i));
2032 vtx2fix += (1-edgePts[i+1])*(shape(4 + 2*(p-1) + i) +
2034 vtx3fix += (1-edgePts[i+1])*(shape(4 + 3*(p-1) + i) +
2037 shape(0) = bilinearsAtIP(0) - vtx0fix;
2038 shape(1) = bilinearsAtIP(1) - vtx1fix;
2039 shape(2) = bilinearsAtIP(2) - vtx2fix;
2040 shape(3) = bilinearsAtIP(3) - vtx3fix;
2046 double *legX =
new double[p-1];
2047 double *legY =
new double[p-1];
2053 int interior_total = 0;
2054 for (
int j = 4; j < p + 1; j++)
2056 for (
int k = 0; k < j-3; k++)
2058 shape(4 + 4*(p-1) + interior_total)
2059 = legX[k] * legY[j-4-k] * x * (1. - x) * y * (1. - y);
2066 delete storeLegendre;
2074 double x = ip.
x, y = ip.
y;
2082 edgeNodalBasis.Eval(x, nodalX, DnodalX);
2083 edgeNodalBasis.Eval(y, nodalY, DnodalY);
2085 for (
int i = 0; i < p-1; i++)
2087 dshape(4 + 0*(p-1) + i,0) = DnodalX(i+1) * (1.-y);
2088 dshape(4 + 0*(p-1) + i,1) = -nodalX(i+1);
2089 dshape(4 + 1*(p-1) + i,0) = nodalY(i+1);
2090 dshape(4 + 1*(p-1) + i,1) = DnodalY(i+1)*x;
2091 dshape(4 + 3*(p-1) - i - 1,0) = DnodalX(i+1)*y;
2092 dshape(4 + 3*(p-1) - i - 1,1) = nodalX(i+1);
2093 dshape(4 + 4*(p-1) - i - 1,0) = -nodalY(i+1);
2094 dshape(4 + 4*(p-1) - i - 1,1) = DnodalY(i+1) * (1.-x);
2103 dshape(0,0) = DbilinearsAtIP(0,0);
2104 dshape(0,1) = DbilinearsAtIP(0,1);
2105 dshape(1,0) = DbilinearsAtIP(1,0);
2106 dshape(1,1) = DbilinearsAtIP(1,1);
2107 dshape(2,0) = DbilinearsAtIP(2,0);
2108 dshape(2,1) = DbilinearsAtIP(2,1);
2109 dshape(3,0) = DbilinearsAtIP(3,0);
2110 dshape(3,1) = DbilinearsAtIP(3,1);
2112 for (
int i = 0; i<p-1; i++)
2114 dshape(0,0) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 0) +
2115 dshape(4 + 4*(p-1) - i - 1,0));
2116 dshape(0,1) -= (1-edgePts[i+1])*(dshape(4 + 0*(p-1) + i, 1) +
2117 dshape(4 + 4*(p-1) - i - 1,1));
2118 dshape(1,0) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 0) +
2119 dshape(4 + (p-2)-i, 0));
2120 dshape(1,1) -= (1-edgePts[i+1])*(dshape(4 + 1*(p-1) + i, 1) +
2121 dshape(4 + (p-2)-i, 1));
2122 dshape(2,0) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 0) +
2123 dshape(1 + 2*p-i, 0));
2124 dshape(2,1) -= (1-edgePts[i+1])*(dshape(4 + 2*(p-1) + i, 1) +
2125 dshape(1 + 2*p-i, 1));
2126 dshape(3,0) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 0) +
2127 dshape(3*p - i, 0));
2128 dshape(3,1) -= (1-edgePts[i+1])*(dshape(4 + 3*(p-1) + i, 1) +
2129 dshape(3*p - i, 1));
2134 double *legX =
new double[p-1];
2135 double *legY =
new double[p-1];
2136 double *DlegX =
new double[p-1];
2137 double *DlegY =
new double[p-1];
2143 int interior_total = 0;
2144 for (
int j = 4; j < p + 1; j++)
2146 for (
int k = 0; k < j-3; k++)
2148 dshape(4 + 4*(p-1) + interior_total, 0) =
2149 legY[j-4-k]*y*(1-y) * (DlegX[k]*x*(1-x) + legX[k]*(1-2*x));
2150 dshape(4 + 4*(p-1) + interior_total, 1) =
2151 legX[k]*x*(1-x) * (DlegY[j-4-k]*y*(1-y) + legY[j-4-k]*(1-2*y));
2159 delete storeLegendre;
2206 double x = ip.
x, y = ip.
y;
2207 double l1x, l2x, l3x, l1y, l2y, l3y;
2209 l1x = (1. - x) * (1. - x);
2210 l2x = 2. * x * (1. - x);
2212 l1y = (1. - y) * (1. - y);
2213 l2y = 2. * y * (1. - y);
2216 shape(0) = l1x * l1y;
2217 shape(4) = l2x * l1y;
2218 shape(1) = l3x * l1y;
2219 shape(7) = l1x * l2y;
2220 shape(8) = l2x * l2y;
2221 shape(5) = l3x * l2y;
2222 shape(3) = l1x * l3y;
2223 shape(6) = l2x * l3y;
2224 shape(2) = l3x * l3y;
2230 double x = ip.
x, y = ip.
y;
2231 double l1x, l2x, l3x, l1y, l2y, l3y;
2232 double d1x, d2x, d3x, d1y, d2y, d3y;
2234 l1x = (1. - x) * (1. - x);
2235 l2x = 2. * x * (1. - x);
2237 l1y = (1. - y) * (1. - y);
2238 l2y = 2. * y * (1. - y);
2248 dshape(0,0) = d1x * l1y;
2249 dshape(0,1) = l1x * d1y;
2251 dshape(4,0) = d2x * l1y;
2252 dshape(4,1) = l2x * d1y;
2254 dshape(1,0) = d3x * l1y;
2255 dshape(1,1) = l3x * d1y;
2257 dshape(7,0) = d1x * l2y;
2258 dshape(7,1) = l1x * d2y;
2260 dshape(8,0) = d2x * l2y;
2261 dshape(8,1) = l2x * d2y;
2263 dshape(5,0) = d3x * l2y;
2264 dshape(5,1) = l3x * d2y;
2266 dshape(3,0) = d1x * l3y;
2267 dshape(3,1) = l1x * d3y;
2269 dshape(6,0) = d2x * l3y;
2270 dshape(6,1) = l2x * d3y;
2272 dshape(2,0) = d3x * l3y;
2273 dshape(2,1) = l3x * d3y;
2281 Vector xx(&tr_ip.
x, 2), shape(s, 9);
2283 for (
int i = 0; i < 9; i++)
2287 for (
int j = 0; j < 9; j++)
2288 if (fabs(I(i,j) = s[j]) < 1.0e-12)
2293 for (
int i = 0; i < 9; i++)
2295 double *d = &I(0,i);
2296 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2297 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2298 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2299 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2300 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2301 0.25 * (d[0] + d[1] + d[2] + d[3]);
2310 for (
int i = 0; i < 9; i++)
2314 d[i] = coeff.
Eval(Trans, ip);
2316 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2317 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2318 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2319 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2320 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2321 0.25 * (d[0] + d[1] + d[2] + d[3]);
2331 for (
int i = 0; i < 9; i++)
2335 vc.
Eval (x, Trans, ip);
2336 for (
int j = 0; j < x.Size(); j++)
2341 for (
int j = 0; j < x.Size(); j++)
2343 double *d = &dofs(9*j);
2345 d[4] = 2. * d[4] - 0.5 * (d[0] + d[1]);
2346 d[5] = 2. * d[5] - 0.5 * (d[1] + d[2]);
2347 d[6] = 2. * d[6] - 0.5 * (d[2] + d[3]);
2348 d[7] = 2. * d[7] - 0.5 * (d[3] + d[0]);
2349 d[8] = 4. * d[8] - 0.5 * (d[4] + d[5] + d[6] + d[7]) -
2350 0.25 * (d[0] + d[1] + d[2] + d[3]);
2358 const double p1 = 0.5*(1.-sqrt(3./5.));
2383 const double a = sqrt(5./3.);
2384 const double p1 = 0.5*(1.-sqrt(3./5.));
2386 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2387 double l1x, l2x, l3x, l1y, l2y, l3y;
2389 l1x = (x - 1.) * (2. * x - 1);
2390 l2x = 4. * x * (1. - x);
2391 l3x = x * (2. * x - 1.);
2392 l1y = (y - 1.) * (2. * y - 1);
2393 l2y = 4. * y * (1. - y);
2394 l3y = y * (2. * y - 1.);
2396 shape(0) = l1x * l1y;
2397 shape(4) = l2x * l1y;
2398 shape(1) = l3x * l1y;
2399 shape(7) = l1x * l2y;
2400 shape(8) = l2x * l2y;
2401 shape(5) = l3x * l2y;
2402 shape(3) = l1x * l3y;
2403 shape(6) = l2x * l3y;
2404 shape(2) = l3x * l3y;
2410 const double a = sqrt(5./3.);
2411 const double p1 = 0.5*(1.-sqrt(3./5.));
2413 double x = a*(ip.
x-p1), y = a*(ip.
y-p1);
2414 double l1x, l2x, l3x, l1y, l2y, l3y;
2415 double d1x, d2x, d3x, d1y, d2y, d3y;
2417 l1x = (x - 1.) * (2. * x - 1);
2418 l2x = 4. * x * (1. - x);
2419 l3x = x * (2. * x - 1.);
2420 l1y = (y - 1.) * (2. * y - 1);
2421 l2y = 4. * y * (1. - y);
2422 l3y = y * (2. * y - 1.);
2424 d1x = a * (4. * x - 3.);
2425 d2x = a * (4. - 8. * x);
2426 d3x = a * (4. * x - 1.);
2427 d1y = a * (4. * y - 3.);
2428 d2y = a * (4. - 8. * y);
2429 d3y = a * (4. * y - 1.);
2431 dshape(0,0) = d1x * l1y;
2432 dshape(0,1) = l1x * d1y;
2434 dshape(4,0) = d2x * l1y;
2435 dshape(4,1) = l2x * d1y;
2437 dshape(1,0) = d3x * l1y;
2438 dshape(1,1) = l3x * d1y;
2440 dshape(7,0) = d1x * l2y;
2441 dshape(7,1) = l1x * d2y;
2443 dshape(8,0) = d2x * l2y;
2444 dshape(8,1) = l2x * d2y;
2446 dshape(5,0) = d3x * l2y;
2447 dshape(5,1) = l3x * d2y;
2449 dshape(3,0) = d1x * l3y;
2450 dshape(3,1) = l1x * d3y;
2452 dshape(6,0) = d2x * l3y;
2453 dshape(6,1) = l2x * d3y;
2455 dshape(2,0) = d3x * l3y;
2456 dshape(2,1) = l3x * d3y;
2499 double x = ip.
x, y = ip.
y;
2501 double w1x, w2x, w3x, w1y, w2y, w3y;
2502 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2504 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2505 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2507 l0x = (- 4.5) * w1x * w2x * w3x;
2508 l1x = ( 13.5) * x * w2x * w3x;
2509 l2x = (-13.5) * x * w1x * w3x;
2510 l3x = ( 4.5) * x * w1x * w2x;
2512 l0y = (- 4.5) * w1y * w2y * w3y;
2513 l1y = ( 13.5) * y * w2y * w3y;
2514 l2y = (-13.5) * y * w1y * w3y;
2515 l3y = ( 4.5) * y * w1y * w2y;
2517 shape(0) = l0x * l0y;
2518 shape(1) = l3x * l0y;
2519 shape(2) = l3x * l3y;
2520 shape(3) = l0x * l3y;
2521 shape(4) = l1x * l0y;
2522 shape(5) = l2x * l0y;
2523 shape(6) = l3x * l1y;
2524 shape(7) = l3x * l2y;
2525 shape(8) = l2x * l3y;
2526 shape(9) = l1x * l3y;
2527 shape(10) = l0x * l2y;
2528 shape(11) = l0x * l1y;
2529 shape(12) = l1x * l1y;
2530 shape(13) = l2x * l1y;
2531 shape(14) = l1x * l2y;
2532 shape(15) = l2x * l2y;
2538 double x = ip.
x, y = ip.
y;
2540 double w1x, w2x, w3x, w1y, w2y, w3y;
2541 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2542 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2544 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2545 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2547 l0x = (- 4.5) * w1x * w2x * w3x;
2548 l1x = ( 13.5) * x * w2x * w3x;
2549 l2x = (-13.5) * x * w1x * w3x;
2550 l3x = ( 4.5) * x * w1x * w2x;
2552 l0y = (- 4.5) * w1y * w2y * w3y;
2553 l1y = ( 13.5) * y * w2y * w3y;
2554 l2y = (-13.5) * y * w1y * w3y;
2555 l3y = ( 4.5) * y * w1y * w2y;
2557 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2558 d1x = 9. + (-45. + 40.5 * x) * x;
2559 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2560 d3x = 1. + (- 9. + 13.5 * x) * x;
2562 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2563 d1y = 9. + (-45. + 40.5 * y) * y;
2564 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2565 d3y = 1. + (- 9. + 13.5 * y) * y;
2567 dshape( 0,0) = d0x * l0y; dshape( 0,1) = l0x * d0y;
2568 dshape( 1,0) = d3x * l0y; dshape( 1,1) = l3x * d0y;
2569 dshape( 2,0) = d3x * l3y; dshape( 2,1) = l3x * d3y;
2570 dshape( 3,0) = d0x * l3y; dshape( 3,1) = l0x * d3y;
2571 dshape( 4,0) = d1x * l0y; dshape( 4,1) = l1x * d0y;
2572 dshape( 5,0) = d2x * l0y; dshape( 5,1) = l2x * d0y;
2573 dshape( 6,0) = d3x * l1y; dshape( 6,1) = l3x * d1y;
2574 dshape( 7,0) = d3x * l2y; dshape( 7,1) = l3x * d2y;
2575 dshape( 8,0) = d2x * l3y; dshape( 8,1) = l2x * d3y;
2576 dshape( 9,0) = d1x * l3y; dshape( 9,1) = l1x * d3y;
2577 dshape(10,0) = d0x * l2y; dshape(10,1) = l0x * d2y;
2578 dshape(11,0) = d0x * l1y; dshape(11,1) = l0x * d1y;
2579 dshape(12,0) = d1x * l1y; dshape(12,1) = l1x * d1y;
2580 dshape(13,0) = d2x * l1y; dshape(13,1) = l2x * d1y;
2581 dshape(14,0) = d1x * l2y; dshape(14,1) = l1x * d2y;
2582 dshape(15,0) = d2x * l2y; dshape(15,1) = l2x * d2y;
2588 double x = ip.
x, y = ip.
y;
2590 double w1x, w2x, w3x, w1y, w2y, w3y;
2591 double l0x, l1x, l2x, l3x, l0y, l1y, l2y, l3y;
2592 double d0x, d1x, d2x, d3x, d0y, d1y, d2y, d3y;
2593 double h0x, h1x, h2x, h3x, h0y, h1y, h2y, h3y;
2595 w1x = x - 1./3.; w2x = x - 2./3.; w3x = x - 1.;
2596 w1y = y - 1./3.; w2y = y - 2./3.; w3y = y - 1.;
2598 l0x = (- 4.5) * w1x * w2x * w3x;
2599 l1x = ( 13.5) * x * w2x * w3x;
2600 l2x = (-13.5) * x * w1x * w3x;
2601 l3x = ( 4.5) * x * w1x * w2x;
2603 l0y = (- 4.5) * w1y * w2y * w3y;
2604 l1y = ( 13.5) * y * w2y * w3y;
2605 l2y = (-13.5) * y * w1y * w3y;
2606 l3y = ( 4.5) * y * w1y * w2y;
2608 d0x = -5.5 + ( 18. - 13.5 * x) * x;
2609 d1x = 9. + (-45. + 40.5 * x) * x;
2610 d2x = -4.5 + ( 36. - 40.5 * x) * x;
2611 d3x = 1. + (- 9. + 13.5 * x) * x;
2613 d0y = -5.5 + ( 18. - 13.5 * y) * y;
2614 d1y = 9. + (-45. + 40.5 * y) * y;
2615 d2y = -4.5 + ( 36. - 40.5 * y) * y;
2616 d3y = 1. + (- 9. + 13.5 * y) * y;
2618 h0x = -27. * x + 18.;
2619 h1x = 81. * x - 45.;
2620 h2x = -81. * x + 36.;
2623 h0y = -27. * y + 18.;
2624 h1y = 81. * y - 45.;
2625 h2y = -81. * y + 36.;
2628 h( 0,0) = h0x * l0y; h( 0,1) = d0x * d0y; h( 0,2) = l0x * h0y;
2629 h( 1,0) = h3x * l0y; h( 1,1) = d3x * d0y; h( 1,2) = l3x * h0y;
2630 h( 2,0) = h3x * l3y; h( 2,1) = d3x * d3y; h( 2,2) = l3x * h3y;
2631 h( 3,0) = h0x * l3y; h( 3,1) = d0x * d3y; h( 3,2) = l0x * h3y;
2632 h( 4,0) = h1x * l0y; h( 4,1) = d1x * d0y; h( 4,2) = l1x * h0y;
2633 h( 5,0) = h2x * l0y; h( 5,1) = d2x * d0y; h( 5,2) = l2x * h0y;
2634 h( 6,0) = h3x * l1y; h( 6,1) = d3x * d1y; h( 6,2) = l3x * h1y;
2635 h( 7,0) = h3x * l2y; h( 7,1) = d3x * d2y; h( 7,2) = l3x * h2y;
2636 h( 8,0) = h2x * l3y; h( 8,1) = d2x * d3y; h( 8,2) = l2x * h3y;
2637 h( 9,0) = h1x * l3y; h( 9,1) = d1x * d3y; h( 9,2) = l1x * h3y;
2638 h(10,0) = h0x * l2y; h(10,1) = d0x * d2y; h(10,2) = l0x * h2y;
2639 h(11,0) = h0x * l1y; h(11,1) = d0x * d1y; h(11,2) = l0x * h1y;
2640 h(12,0) = h1x * l1y; h(12,1) = d1x * d1y; h(12,2) = l1x * h1y;
2641 h(13,0) = h2x * l1y; h(13,1) = d2x * d1y; h(13,2) = l2x * h1y;
2642 h(14,0) = h1x * l2y; h(14,1) = d1x * d2y; h(14,2) = l1x * h2y;
2643 h(15,0) = h2x * l2y; h(15,1) = d2x * d2y; h(15,2) = l2x * h2y;
2662 l3 = (0.33333333333333333333-x),
2663 l4 = (0.66666666666666666667-x);
2665 shape(0) = 4.5 * l2 * l3 * l4;
2666 shape(1) = 4.5 * l1 * l3 * l4;
2667 shape(2) = 13.5 * l1 * l2 * l4;
2668 shape(3) = -13.5 * l1 * l2 * l3;
2676 dshape(0,0) = -5.5 + x * (18. - 13.5 * x);
2677 dshape(1,0) = 1. - x * (9. - 13.5 * x);
2678 dshape(2,0) = 9. - x * (45. - 40.5 * x);
2679 dshape(3,0) = -4.5 + x * (36. - 40.5 * x);
2711 double x = ip.
x, y = ip.
y;
2712 double l1 = (-1. + x + y),
2716 shape(0) = -0.5*l1*(3.*l1 + 1.)*(3.*l1 + 2.);
2717 shape(1) = 0.5*x*(lx - 1.)*lx;
2718 shape(2) = 0.5*y*(-1. + ly)*ly;
2719 shape(3) = 4.5*x*l1*(3.*l1 + 1.);
2720 shape(4) = -4.5*x*lx*l1;
2721 shape(5) = 4.5*x*lx*y;
2722 shape(6) = 4.5*x*y*ly;
2723 shape(7) = -4.5*y*l1*ly;
2724 shape(8) = 4.5*y*l1*(1. + 3.*l1);
2725 shape(9) = -27.*x*y*l1;
2731 double x = ip.
x, y = ip.
y;
2733 dshape(0,0) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2734 dshape(1,0) = 1. + 4.5*x*(-2. + 3.*x);
2736 dshape(3,0) = 4.5*(2. + 9.*x*x - 5.*y + 3.*y*y + 2.*x*(-5. + 6.*y));
2737 dshape(4,0) = -4.5*(1. - 1.*y + x*(-8. + 9.*x + 6.*y));
2738 dshape(5,0) = 4.5*(-1. + 6.*x)*y;
2739 dshape(6,0) = 4.5*y*(-1. + 3.*y);
2740 dshape(7,0) = 4.5*(1. - 3.*y)*y;
2741 dshape(8,0) = 4.5*y*(-5. + 6.*x + 6.*y);
2742 dshape(9,0) = -27.*y*(-1. + 2.*x + y);
2744 dshape(0,1) = 0.5*(-11. + 36.*y - 9.*(x*(-4. + 3.*x) + 6.*x*y + 3.*y*y));
2746 dshape(2,1) = 1. + 4.5*y*(-2. + 3.*y);
2747 dshape(3,1) = 4.5*x*(-5. + 6.*x + 6.*y);
2748 dshape(4,1) = 4.5*(1. - 3.*x)*x;
2749 dshape(5,1) = 4.5*x*(-1. + 3.*x);
2750 dshape(6,1) = 4.5*x*(-1. + 6.*y);
2751 dshape(7,1) = -4.5*(1. + x*(-1. + 6.*y) + y*(-8. + 9.*y));
2752 dshape(8,1) = 4.5*(2. + 3.*x*x + y*(-10. + 9.*y) + x*(-5. + 12.*y));
2753 dshape(9,1) = -27.*x*(-1. + x + 2.*y);
2759 double x = ip.
x, y = ip.
y;
2761 h(0,0) = 18.-27.*(x+y);
2762 h(0,1) = 18.-27.*(x+y);
2763 h(0,2) = 18.-27.*(x+y);
2773 h(3,0) = -45.+81.*x+54.*y;
2774 h(3,1) = -22.5+54.*x+27.*y;
2777 h(4,0) = 36.-81.*x-27.*y;
2782 h(5,1) = -4.5+27.*x;
2786 h(6,1) = -4.5+27.*y;
2791 h(7,2) = 36.-27.*x-81.*y;
2794 h(8,1) = -22.5+27.*x+54.*y;
2795 h(8,2) = -45.+54.*x+81.*y;
2798 h(9,1) = 27.-54.*(x+y);
2871 double x = ip.
x, y = ip.
y, z = ip.
z;
2873 shape(0) = -((-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z)*
2874 (-1 + 3*x + 3*y + 3*z))/2.;
2875 shape(4) = (9*x*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2876 shape(5) = (-9*x*(-1 + 3*x)*(-1 + x + y + z))/2.;
2877 shape(1) = (x*(2 + 9*(-1 + x)*x))/2.;
2878 shape(6) = (9*y*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2879 shape(19) = -27*x*y*(-1 + x + y + z);
2880 shape(10) = (9*x*(-1 + 3*x)*y)/2.;
2881 shape(7) = (-9*y*(-1 + 3*y)*(-1 + x + y + z))/2.;
2882 shape(11) = (9*x*y*(-1 + 3*y))/2.;
2883 shape(2) = (y*(2 + 9*(-1 + y)*y))/2.;
2884 shape(8) = (9*z*(-1 + x + y + z)*(-2 + 3*x + 3*y + 3*z))/2.;
2885 shape(18) = -27*x*z*(-1 + x + y + z);
2886 shape(12) = (9*x*(-1 + 3*x)*z)/2.;
2887 shape(17) = -27*y*z*(-1 + x + y + z);
2888 shape(16) = 27*x*y*z;
2889 shape(14) = (9*y*(-1 + 3*y)*z)/2.;
2890 shape(9) = (-9*z*(-1 + x + y + z)*(-1 + 3*z))/2.;
2891 shape(13) = (9*x*z*(-1 + 3*z))/2.;
2892 shape(15) = (9*y*z*(-1 + 3*z))/2.;
2893 shape(3) = (z*(2 + 9*(-1 + z)*z))/2.;
2899 double x = ip.
x, y = ip.
y, z = ip.
z;
2901 dshape(0,0) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2902 x*(-4 + 6*y + 6*z)))/2.;
2903 dshape(0,1) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2904 x*(-4 + 6*y + 6*z)))/2.;
2905 dshape(0,2) = (-11 + 36*y + 36*z - 9*(3*pow(x,2) + 3*pow(y + z,2) +
2906 x*(-4 + 6*y + 6*z)))/2.;
2907 dshape(4,0) = (9*(9*pow(x,2) + (-1 + y + z)*(-2 + 3*y + 3*z) +
2908 2*x*(-5 + 6*y + 6*z)))/2.;
2909 dshape(4,1) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2910 dshape(4,2) = (9*x*(-5 + 6*x + 6*y + 6*z))/2.;
2911 dshape(5,0) = (-9*(1 - y - z + x*(-8 + 9*x + 6*y + 6*z)))/2.;
2912 dshape(5,1) = (9*(1 - 3*x)*x)/2.;
2913 dshape(5,2) = (9*(1 - 3*x)*x)/2.;
2914 dshape(1,0) = 1 + (9*x*(-2 + 3*x))/2.;
2917 dshape(6,0) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2918 dshape(6,1) = (9*(2 + 3*pow(x,2) - 10*y - 5*z + 3*(y + z)*(3*y + z) +
2919 x*(-5 + 12*y + 6*z)))/2.;
2920 dshape(6,2) = (9*y*(-5 + 6*x + 6*y + 6*z))/2.;
2921 dshape(19,0) = -27*y*(-1 + 2*x + y + z);
2922 dshape(19,1) = -27*x*(-1 + x + 2*y + z);
2923 dshape(19,2) = -27*x*y;
2924 dshape(10,0) = (9*(-1 + 6*x)*y)/2.;
2925 dshape(10,1) = (9*x*(-1 + 3*x))/2.;
2927 dshape(7,0) = (9*(1 - 3*y)*y)/2.;
2928 dshape(7,1) = (-9*(1 + x*(-1 + 6*y) - z + y*(-8 + 9*y + 6*z)))/2.;
2929 dshape(7,2) = (9*(1 - 3*y)*y)/2.;
2930 dshape(11,0) = (9*y*(-1 + 3*y))/2.;
2931 dshape(11,1) = (9*x*(-1 + 6*y))/2.;
2934 dshape(2,1) = 1 + (9*y*(-2 + 3*y))/2.;
2936 dshape(8,0) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2937 dshape(8,1) = (9*z*(-5 + 6*x + 6*y + 6*z))/2.;
2938 dshape(8,2) = (9*(2 + 3*pow(x,2) - 5*y - 10*z + 3*(y + z)*(y + 3*z) +
2939 x*(-5 + 6*y + 12*z)))/2.;
2940 dshape(18,0) = -27*z*(-1 + 2*x + y + z);
2941 dshape(18,1) = -27*x*z;
2942 dshape(18,2) = -27*x*(-1 + x + y + 2*z);
2943 dshape(12,0) = (9*(-1 + 6*x)*z)/2.;
2945 dshape(12,2) = (9*x*(-1 + 3*x))/2.;
2946 dshape(17,0) = -27*y*z;
2947 dshape(17,1) = -27*z*(-1 + x + 2*y + z);
2948 dshape(17,2) = -27*y*(-1 + x + y + 2*z);
2949 dshape(16,0) = 27*y*z;
2950 dshape(16,1) = 27*x*z;
2951 dshape(16,2) = 27*x*y;
2953 dshape(14,1) = (9*(-1 + 6*y)*z)/2.;
2954 dshape(14,2) = (9*y*(-1 + 3*y))/2.;
2955 dshape(9,0) = (9*(1 - 3*z)*z)/2.;
2956 dshape(9,1) = (9*(1 - 3*z)*z)/2.;
2957 dshape(9,2) = (9*(-1 + x + y + 8*z - 6*(x + y)*z - 9*pow(z,2)))/2.;
2958 dshape(13,0) = (9*z*(-1 + 3*z))/2.;
2960 dshape(13,2) = (9*x*(-1 + 6*z))/2.;
2962 dshape(15,1) = (9*z*(-1 + 3*z))/2.;
2963 dshape(15,2) = (9*y*(-1 + 6*z))/2.;
2966 dshape(3,2) = 1 + (9*z*(-2 + 3*z))/2.;
3032 shape(0) = 1. - ip.
x - ip.
y - ip.
z;
3041 if (dshape.
Height() == 4)
3043 double *A = &dshape(0,0);
3044 A[0] = -1.; A[4] = -1.; A[8] = -1.;
3045 A[1] = 1.; A[5] = 0.; A[9] = 0.;
3046 A[2] = 0.; A[6] = 1.; A[10] = 0.;
3047 A[3] = 0.; A[7] = 0.; A[11] = 1.;
3051 dshape(0,0) = -1.; dshape(0,1) = -1.; dshape(0,2) = -1.;
3052 dshape(1,0) = 1.; dshape(1,1) = 0.; dshape(1,2) = 0.;
3053 dshape(2,0) = 0.; dshape(2,1) = 1.; dshape(2,2) = 0.;
3054 dshape(3,0) = 0.; dshape(3,1) = 0.; dshape(3,2) = 1.;
3061 static int face_dofs[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
3064 *dofs = face_dofs[face];
3106 double L0, L1, L2, L3;
3108 L0 = 1. - ip.
x - ip.
y - ip.
z;
3113 shape(0) = L0 * ( 2.0 * L0 - 1.0 );
3114 shape(1) = L1 * ( 2.0 * L1 - 1.0 );
3115 shape(2) = L2 * ( 2.0 * L2 - 1.0 );
3116 shape(3) = L3 * ( 2.0 * L3 - 1.0 );
3117 shape(4) = 4.0 * L0 * L1;
3118 shape(5) = 4.0 * L0 * L2;
3119 shape(6) = 4.0 * L0 * L3;
3120 shape(7) = 4.0 * L1 * L2;
3121 shape(8) = 4.0 * L1 * L3;
3122 shape(9) = 4.0 * L2 * L3;
3133 L0 = 1.0 - x - y - z;
3135 dshape(0,0) = dshape(0,1) = dshape(0,2) = 1.0 - 4.0 * L0;
3136 dshape(1,0) = -1.0 + 4.0 * x; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
3137 dshape(2,0) = 0.0; dshape(2,1) = -1.0 + 4.0 * y; dshape(2,2) = 0.0;
3138 dshape(3,0) = dshape(3,1) = 0.0; dshape(3,2) = -1.0 + 4.0 * z;
3139 dshape(4,0) = 4.0 * (L0 - x); dshape(4,1) = dshape(4,2) = -4.0 * x;
3140 dshape(5,0) = dshape(5,2) = -4.0 * y; dshape(5,1) = 4.0 * (L0 - y);
3141 dshape(6,0) = dshape(6,1) = -4.0 * z; dshape(6,2) = 4.0 * (L0 - z);
3142 dshape(7,0) = 4.0 * y; dshape(7,1) = 4.0 * x; dshape(7,2) = 0.0;
3143 dshape(8,0) = 4.0 * z; dshape(8,1) = 0.0; dshape(8,2) = 4.0 * x;
3144 dshape(9,0) = 0.0; dshape(9,1) = 4.0 * z; dshape(9,2) = 4.0 * y;
3186 double x = ip.
x, y = ip.
y, z = ip.
z;
3187 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3189 shape(0) = ox * oy * oz;
3190 shape(1) = x * oy * oz;
3191 shape(2) = x * y * oz;
3192 shape(3) = ox * y * oz;
3193 shape(4) = ox * oy * z;
3194 shape(5) = x * oy * z;
3195 shape(6) = x * y * z;
3196 shape(7) = ox * y * z;
3202 double x = ip.
x, y = ip.
y, z = ip.
z;
3203 double ox = 1.-x, oy = 1.-y, oz = 1.-z;
3205 dshape(0,0) = - oy * oz;
3206 dshape(0,1) = - ox * oz;
3207 dshape(0,2) = - ox * oy;
3209 dshape(1,0) = oy * oz;
3210 dshape(1,1) = - x * oz;
3211 dshape(1,2) = - x * oy;
3213 dshape(2,0) = y * oz;
3214 dshape(2,1) = x * oz;
3215 dshape(2,2) = - x * y;
3217 dshape(3,0) = - y * oz;
3218 dshape(3,1) = ox * oz;
3219 dshape(3,2) = - ox * y;
3221 dshape(4,0) = - oy * z;
3222 dshape(4,1) = - ox * z;
3223 dshape(4,2) = ox * oy;
3225 dshape(5,0) = oy * z;
3226 dshape(5,1) = - x * z;
3227 dshape(5,2) = x * oy;
3229 dshape(6,0) = y * z;
3230 dshape(6,1) = x * z;
3231 dshape(6,2) = x * y;
3233 dshape(7,0) = - y * z;
3234 dshape(7,1) = ox * z;
3235 dshape(7,2) = ox * y;
3271 shape(0) = 1.0 - 2.0 * ip.
y;
3272 shape(1) = -1.0 + 2.0 * ( ip.
x + ip.
y );
3273 shape(2) = 1.0 - 2.0 * ip.
x;
3279 dshape(0,0) = 0.0; dshape(0,1) = -2.0;
3280 dshape(1,0) = 2.0; dshape(1,1) = 2.0;
3281 dshape(2,0) = -2.0; dshape(2,1) = 0.0;
3302 const double l1 = ip.
x+ip.
y-0.5, l2 = 1.-l1, l3 = ip.
x-ip.
y+0.5, l4 = 1.-l3;
3313 const double x2 = 2.*ip.
x, y2 = 2.*ip.
y;
3315 dshape(0,0) = 1. - x2; dshape(0,1) = -2. + y2;
3316 dshape(1,0) = x2; dshape(1,1) = 1. - y2;
3317 dshape(2,0) = 1. - x2; dshape(2,1) = y2;
3318 dshape(3,0) = -2. + x2; dshape(3,1) = 1. - y2;
3336 double x = ip.
x, y = ip.
y;
3339 shape(0,1) = y - 1.;
3342 shape(2,0) = x - 1.;
3354 const double RT0TriangleFiniteElement::nk[3][2] =
3355 { {0, -1}, {1, 1}, {-1, 0} };
3361 #ifdef MFEM_THREAD_SAFE
3367 for (k = 0; k < 3; k++)
3370 for (j = 0; j < 3; j++)
3373 if (j == k) { d -= 1.0; }
3374 if (fabs(d) > 1.0e-12)
3376 mfem::err <<
"RT0TriangleFiniteElement::GetLocalInterpolation (...)\n"
3377 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3393 for (k = 0; k < 3; k++)
3396 ip.
x = vk[0]; ip.
y = vk[1];
3399 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3400 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3401 for (j = 0; j < 3; j++)
3402 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3415 #ifdef MFEM_THREAD_SAFE
3419 for (
int k = 0; k < 3; k++)
3427 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3428 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3448 double x = ip.
x, y = ip.
y;
3451 shape(0,1) = y - 1.;
3456 shape(3,0) = x - 1.;
3469 const double RT0QuadFiniteElement::nk[4][2] =
3470 { {0, -1}, {1, 0}, {0, 1}, {-1, 0} };
3476 #ifdef MFEM_THREAD_SAFE
3482 for (k = 0; k < 4; k++)
3485 for (j = 0; j < 4; j++)
3488 if (j == k) { d -= 1.0; }
3489 if (fabs(d) > 1.0e-12)
3491 mfem::err <<
"RT0QuadFiniteElement::GetLocalInterpolation (...)\n"
3492 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3508 for (k = 0; k < 4; k++)
3511 ip.
x = vk[0]; ip.
y = vk[1];
3514 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3515 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3516 for (j = 0; j < 4; j++)
3517 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3530 #ifdef MFEM_THREAD_SAFE
3534 for (
int k = 0; k < 4; k++)
3542 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3543 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3571 double x = ip.
x, y = ip.
y;
3573 shape(0,0) = -2 * x * (-1 + x + 2 * y);
3574 shape(0,1) = -2 * (-1 + y) * (-1 + x + 2 * y);
3575 shape(1,0) = 2 * x * (x - y);
3576 shape(1,1) = 2 * (x - y) * (-1 + y);
3577 shape(2,0) = 2 * x * (-1 + 2 * x + y);
3578 shape(2,1) = 2 * y * (-1 + 2 * x + y);
3579 shape(3,0) = 2 * x * (-1 + x + 2 * y);
3580 shape(3,1) = 2 * y * (-1 + x + 2 * y);
3581 shape(4,0) = -2 * (-1 + x) * (x - y);
3582 shape(4,1) = 2 * y * (-x + y);
3583 shape(5,0) = -2 * (-1 + x) * (-1 + 2 * x + y);
3584 shape(5,1) = -2 * y * (-1 + 2 * x + y);
3585 shape(6,0) = -3 * x * (-2 + 2 * x + y);
3586 shape(6,1) = -3 * y * (-1 + 2 * x + y);
3587 shape(7,0) = -3 * x * (-1 + x + 2 * y);
3588 shape(7,1) = -3 * y * (-2 + x + 2 * y);
3594 double x = ip.
x, y = ip.
y;
3596 divshape(0) = -2 * (-4 + 3 * x + 6 * y);
3597 divshape(1) = 2 + 6 * x - 6 * y;
3598 divshape(2) = -4 + 12 * x + 6 * y;
3599 divshape(3) = -4 + 6 * x + 12 * y;
3600 divshape(4) = 2 - 6 * x + 6 * y;
3601 divshape(5) = -2 * (-4 + 6 * x + 3 * y);
3602 divshape(6) = -9 * (-1 + 2 * x + y);
3603 divshape(7) = -9 * (-1 + x + 2 * y);
3606 const double RT1TriangleFiniteElement::nk[8][2] =
3618 #ifdef MFEM_THREAD_SAFE
3624 for (k = 0; k < 8; k++)
3627 for (j = 0; j < 8; j++)
3630 if (j == k) { d -= 1.0; }
3631 if (fabs(d) > 1.0e-12)
3633 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3634 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3650 for (k = 0; k < 8; k++)
3653 ip.
x = vk[0]; ip.
y = vk[1];
3656 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3657 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3658 for (j = 0; j < 8; j++)
3659 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3671 #ifdef MFEM_THREAD_SAFE
3675 for (
int k = 0; k < 8; k++)
3683 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3684 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3727 double x = ip.
x, y = ip.
y;
3731 shape(0,1) = -( 1. - 3.*y + 2.*y*y)*( 2. - 3.*x);
3733 shape(1,1) = -( 1. - 3.*y + 2.*y*y)*(-1. + 3.*x);
3735 shape(2,0) = (-x + 2.*x*x)*( 2. - 3.*y);
3737 shape(3,0) = (-x + 2.*x*x)*(-1. + 3.*y);
3741 shape(4,1) = (-y + 2.*y*y)*(-1. + 3.*x);
3743 shape(5,1) = (-y + 2.*y*y)*( 2. - 3.*x);
3745 shape(6,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y);
3747 shape(7,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y);
3750 shape(8,0) = (4.*x - 4.*x*x)*( 2. - 3.*y);
3752 shape(9,0) = (4.*x - 4.*x*x)*(-1. + 3.*y);
3756 shape(10,1) = (4.*y - 4.*y*y)*( 2. - 3.*x);
3758 shape(11,1) = (4.*y - 4.*y*y)*(-1. + 3.*x);
3764 double x = ip.
x, y = ip.
y;
3766 divshape(0) = -(-3. + 4.*y)*( 2. - 3.*x);
3767 divshape(1) = -(-3. + 4.*y)*(-1. + 3.*x);
3768 divshape(2) = (-1. + 4.*x)*( 2. - 3.*y);
3769 divshape(3) = (-1. + 4.*x)*(-1. + 3.*y);
3770 divshape(4) = (-1. + 4.*y)*(-1. + 3.*x);
3771 divshape(5) = (-1. + 4.*y)*( 2. - 3.*x);
3772 divshape(6) = -(-3. + 4.*x)*(-1. + 3.*y);
3773 divshape(7) = -(-3. + 4.*x)*( 2. - 3.*y);
3774 divshape(8) = ( 4. - 8.*x)*( 2. - 3.*y);
3775 divshape(9) = ( 4. - 8.*x)*(-1. + 3.*y);
3776 divshape(10) = ( 4. - 8.*y)*( 2. - 3.*x);
3777 divshape(11) = ( 4. - 8.*y)*(-1. + 3.*x);
3780 const double RT1QuadFiniteElement::nk[12][2] =
3800 #ifdef MFEM_THREAD_SAFE
3806 for (k = 0; k < 12; k++)
3809 for (j = 0; j < 12; j++)
3812 if (j == k) { d -= 1.0; }
3813 if (fabs(d) > 1.0e-12)
3815 mfem::err <<
"RT1QuadFiniteElement::GetLocalInterpolation (...)\n"
3816 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
3832 for (k = 0; k < 12; k++)
3835 ip.
x = vk[0]; ip.
y = vk[1];
3838 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
3839 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
3840 for (j = 0; j < 12; j++)
3841 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
3853 #ifdef MFEM_THREAD_SAFE
3857 for (
int k = 0; k < 12; k++)
3865 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
3866 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
3870 const double RT2TriangleFiniteElement::M[15][15] =
3873 0, -5.3237900077244501311, 5.3237900077244501311, 16.647580015448900262,
3874 0, 24.442740046346700787, -16.647580015448900262, -12.,
3875 -19.118950038622250656, -47.237900077244501311, 0, -34.414110069520051180,
3876 12., 30.590320061795601049, 15.295160030897800524
3879 0, 1.5, -1.5, -15., 0, 2.625, 15., 15., -4.125, 30., 0, -14.625, -15.,
3883 0, -0.67620999227554986889, 0.67620999227554986889, 7.3524199845510997378,
3884 0, -3.4427400463467007866, -7.3524199845510997378, -12.,
3885 4.1189500386222506555, -0.76209992275549868892, 0, 7.4141100695200511800,
3886 12., -6.5903200617956010489, -3.2951600308978005244
3889 0, 0, 1.5, 0, 0, 1.5, -11.471370023173350393, 0, 2.4713700231733503933,
3890 -11.471370023173350393, 0, 2.4713700231733503933, 15.295160030897800524,
3891 0, -3.2951600308978005244
3894 0, 0, 4.875, 0, 0, 4.875, -16.875, 0, -16.875, -16.875, 0, -16.875, 10.5,
3898 0, 0, 1.5, 0, 0, 1.5, 2.4713700231733503933, 0, -11.471370023173350393,
3899 2.4713700231733503933, 0, -11.471370023173350393, -3.2951600308978005244,
3900 0, 15.295160030897800524
3903 -0.67620999227554986889, 0, -3.4427400463467007866, 0,
3904 7.3524199845510997378, 0.67620999227554986889, 7.4141100695200511800, 0,
3905 -0.76209992275549868892, 4.1189500386222506555, -12.,
3906 -7.3524199845510997378, -3.2951600308978005244, -6.5903200617956010489,
3910 1.5, 0, 2.625, 0, -15., -1.5, -14.625, 0, 30., -4.125, 15., 15., 10.5,
3914 -5.3237900077244501311, 0, 24.442740046346700787, 0, 16.647580015448900262,
3915 5.3237900077244501311, -34.414110069520051180, 0, -47.237900077244501311,
3916 -19.118950038622250656, -12., -16.647580015448900262, 15.295160030897800524,
3917 30.590320061795601049, 12.
3919 { 0, 0, 18., 0, 0, 6., -42., 0, -30., -26., 0, -14., 24., 32., 8.},
3920 { 0, 0, 6., 0, 0, 18., -14., 0, -26., -30., 0, -42., 8., 32., 24.},
3921 { 0, 0, -6., 0, 0, -4., 30., 0, 4., 22., 0, 4., -24., -16., 0},
3922 { 0, 0, -4., 0, 0, -8., 20., 0, 8., 36., 0, 8., -16., -32., 0},
3923 { 0, 0, -8., 0, 0, -4., 8., 0, 36., 8., 0, 20., 0, -32., -16.},
3924 { 0, 0, -4., 0, 0, -6., 4., 0, 22., 4., 0, 30., 0, -16., -24.}
3930 const double p = 0.11270166537925831148;
3967 double x = ip.
x, y = ip.
y;
3969 double Bx[15] = {1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y, 0., x*x*x,
3972 double By[15] = {0., 1., 0., x, 0., y, 0., x*x, 0., x*y, 0., y*y,
3976 for (
int i = 0; i < 15; i++)
3978 double cx = 0.0, cy = 0.0;
3979 for (
int j = 0; j < 15; j++)
3981 cx += M[i][j] * Bx[j];
3982 cy += M[i][j] * By[j];
3992 double x = ip.
x, y = ip.
y;
3994 double DivB[15] = {0., 0., 1., 0., 0., 1., 2.*x, 0., y, x, 0., 2.*y,
3995 4.*x*x, 4.*x*y, 4.*y*y
3998 for (
int i = 0; i < 15; i++)
4001 for (
int j = 0; j < 15; j++)
4003 div += M[i][j] * DivB[j];
4009 const double RT2QuadFiniteElement::pt[4] = {0.,1./3.,2./3.,1.};
4011 const double RT2QuadFiniteElement::dpt[3] = {0.25,0.5,0.75};
4053 double x = ip.
x, y = ip.
y;
4055 double ax0 = pt[0] - x;
4056 double ax1 = pt[1] - x;
4057 double ax2 = pt[2] - x;
4058 double ax3 = pt[3] - x;
4060 double by0 = dpt[0] - y;
4061 double by1 = dpt[1] - y;
4062 double by2 = dpt[2] - y;
4064 double ay0 = pt[0] - y;
4065 double ay1 = pt[1] - y;
4066 double ay2 = pt[2] - y;
4067 double ay3 = pt[3] - y;
4069 double bx0 = dpt[0] - x;
4070 double bx1 = dpt[1] - x;
4071 double bx2 = dpt[2] - x;
4073 double A01 = pt[0] - pt[1];
4074 double A02 = pt[0] - pt[2];
4075 double A12 = pt[1] - pt[2];
4076 double A03 = pt[0] - pt[3];
4077 double A13 = pt[1] - pt[3];
4078 double A23 = pt[2] - pt[3];
4080 double B01 = dpt[0] - dpt[1];
4081 double B02 = dpt[0] - dpt[2];
4082 double B12 = dpt[1] - dpt[2];
4084 double tx0 = (bx1*bx2)/(B01*B02);
4085 double tx1 = -(bx0*bx2)/(B01*B12);
4086 double tx2 = (bx0*bx1)/(B02*B12);
4088 double ty0 = (by1*by2)/(B01*B02);
4089 double ty1 = -(by0*by2)/(B01*B12);
4090 double ty2 = (by0*by1)/(B02*B12);
4094 shape(0, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx0;
4096 shape(1, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx1;
4098 shape(2, 1) = (ay1*ay2*ay3)/(A01*A02*A03)*tx2;
4100 shape(3, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty0;
4102 shape(4, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty1;
4104 shape(5, 0) = (ax0*ax1*ax2)/(A03*A13*A23)*ty2;
4108 shape(6, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx2;
4110 shape(7, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx1;
4112 shape(8, 1) = (ay0*ay1*ay2)/(A03*A13*A23)*tx0;
4114 shape(9, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty2;
4116 shape(10, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty1;
4118 shape(11, 0) = (ax1*ax2*ax3)/(A01*A02*A03)*ty0;
4121 shape(12, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty0;
4123 shape(13, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty1;
4125 shape(14, 0) = (ax0*ax2*ax3)/(A01*A12*A13)*ty2;
4128 shape(15, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty0;
4130 shape(16, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty1;
4132 shape(17, 0) = -(ax0*ax1*ax3)/(A02*A12*A23)*ty2;
4136 shape(18, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx0;
4138 shape(19, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx1;
4140 shape(20, 1) = (ay0*ay2*ay3)/(A01*A12*A13)*tx2;
4143 shape(21, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx0;
4145 shape(22, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx1;
4147 shape(23, 1) = -(ay0*ay1*ay3)/(A02*A12*A23)*tx2;
4153 double x = ip.
x, y = ip.
y;
4155 double a01 = pt[0]*pt[1];
4156 double a02 = pt[0]*pt[2];
4157 double a12 = pt[1]*pt[2];
4158 double a03 = pt[0]*pt[3];
4159 double a13 = pt[1]*pt[3];
4160 double a23 = pt[2]*pt[3];
4162 double bx0 = dpt[0] - x;
4163 double bx1 = dpt[1] - x;
4164 double bx2 = dpt[2] - x;
4166 double by0 = dpt[0] - y;
4167 double by1 = dpt[1] - y;
4168 double by2 = dpt[2] - y;
4170 double A01 = pt[0] - pt[1];
4171 double A02 = pt[0] - pt[2];
4172 double A12 = pt[1] - pt[2];
4173 double A03 = pt[0] - pt[3];
4174 double A13 = pt[1] - pt[3];
4175 double A23 = pt[2] - pt[3];
4177 double A012 = pt[0] + pt[1] + pt[2];
4178 double A013 = pt[0] + pt[1] + pt[3];
4179 double A023 = pt[0] + pt[2] + pt[3];
4180 double A123 = pt[1] + pt[2] + pt[3];
4182 double B01 = dpt[0] - dpt[1];
4183 double B02 = dpt[0] - dpt[2];
4184 double B12 = dpt[1] - dpt[2];
4186 double tx0 = (bx1*bx2)/(B01*B02);
4187 double tx1 = -(bx0*bx2)/(B01*B12);
4188 double tx2 = (bx0*bx1)/(B02*B12);
4190 double ty0 = (by1*by2)/(B01*B02);
4191 double ty1 = -(by0*by2)/(B01*B12);
4192 double ty2 = (by0*by1)/(B02*B12);
4195 divshape(0) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx0;
4196 divshape(1) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx1;
4197 divshape(2) = -(a12 + a13 + a23 - 2.*A123*y + 3.*y*y)/(A01*A02*A03)*tx2;
4199 divshape(3) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty0;
4200 divshape(4) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty1;
4201 divshape(5) = -(a01 + a02 + a12 - 2.*A012*x + 3.*x*x)/(A03*A13*A23)*ty2;
4203 divshape(6) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx2;
4204 divshape(7) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx1;
4205 divshape(8) = -(a01 + a02 + a12 - 2.*A012*y + 3.*y*y)/(A03*A13*A23)*tx0;
4207 divshape(9) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty2;
4208 divshape(10) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty1;
4209 divshape(11) = -(a12 + a13 + a23 - 2.*A123*x + 3.*x*x)/(A01*A02*A03)*ty0;
4211 divshape(12) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty0;
4212 divshape(13) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty1;
4213 divshape(14) = -(a02 + a03 + a23 - 2.*A023*x + 3.*x*x)/(A01*A12*A13)*ty2;
4215 divshape(15) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty0;
4216 divshape(16) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty1;
4217 divshape(17) = (a01 + a03 + a13 - 2.*A013*x + 3.*x*x)/(A02*A12*A23)*ty2;
4219 divshape(18) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx0;
4220 divshape(19) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx1;
4221 divshape(20) = -(a02 + a03 + a23 - 2.*A023*y + 3.*y*y)/(A01*A12*A13)*tx2;
4223 divshape(21) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx0;
4224 divshape(22) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx1;
4225 divshape(23) = (a01 + a03 + a13 - 2.*A013*y + 3.*y*y)/(A02*A12*A23)*tx2;
4228 const double RT2QuadFiniteElement::nk[24][2] =
4231 {0,-1}, {0,-1}, {0,-1},
4233 {1, 0}, {1, 0}, {1, 0},
4235 {0, 1}, {0, 1}, {0, 1},
4237 {-1,0}, {-1,0}, {-1,0},
4239 {1, 0}, {1, 0}, {1, 0},
4241 {1, 0}, {1, 0}, {1, 0},
4243 {0, 1}, {0, 1}, {0, 1},
4245 {0, 1}, {0, 1}, {0, 1}
4252 #ifdef MFEM_THREAD_SAFE
4258 for (k = 0; k < 24; k++)
4261 for (j = 0; j < 24; j++)
4264 if (j == k) { d -= 1.0; }
4265 if (fabs(d) > 1.0e-12)
4267 mfem::err <<
"RT2QuadFiniteElement::GetLocalInterpolation (...)\n"
4268 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
4284 for (k = 0; k < 24; k++)
4287 ip.
x = vk[0]; ip.
y = vk[1];
4290 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1];
4291 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1];
4292 for (j = 0; j < 24; j++)
4293 if (fabs (I(k,j) =
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]) < 1.0e-12)
4305 #ifdef MFEM_THREAD_SAFE
4309 for (
int k = 0; k < 24; k++)
4317 dofs(k) = (vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1] ) +
4318 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1] ));
4334 shape(0) = 2. - 3. * x;
4335 shape(1) = 3. * x - 1.;
4349 const double p = 0.11270166537925831148;
4359 const double p = 0.11270166537925831148;
4360 const double w = 1./((1-2*
p)*(1-2*p));
4363 shape(0) = (2*x-1)*(x-1+p)*w;
4364 shape(1) = 4*(x-1+
p)*(p-x)*w;
4365 shape(2) = (2*x-1)*(x-p)*w;
4371 const double p = 0.11270166537925831148;
4372 const double w = 1./((1-2*
p)*(1-2*p));
4375 dshape(0,0) = (-3+4*x+2*
p)*w;
4376 dshape(1,0) = (4-8*x)*w;
4377 dshape(2,0) = (-1+4*x-2*
p)*w;
4388 for (i = 1; i < m; i++)
4394 #ifndef MFEM_THREAD_SAFE
4399 for (i = 1; i <= m; i++)
4401 rwk(i) = rwk(i-1) * ( (double)(m) / (double)(i) );
4403 for (i = 0; i < m/2+1; i++)
4405 rwk(m-i) = ( rwk(i) *= rwk(m-i) );
4407 for (i = m-1; i >= 0; i -= 2)
4416 double w, wk, x = ip.
x;
4419 #ifdef MFEM_THREAD_SAFE
4423 k = (int) floor ( m * x + 0.5 );
4424 k = k > m ? m : k < 0 ? 0 : k;
4427 for (i = 0; i <= m; i++)
4430 wk *= ( rxxk(i) = x - (double)(i) / m );
4432 w = wk * ( rxxk(k) = x - (double)(k) / m );
4436 shape(0) = w * rwk(0) / rxxk(0);
4440 shape(0) = wk * rwk(0);
4444 shape(1) = w * rwk(m) / rxxk(m);
4448 shape(1) = wk * rwk(k);
4450 for (i = 1; i < m; i++)
4453 shape(i+1) = w * rwk(i) / rxxk(i);
4457 shape(k+1) = wk * rwk(k);
4464 double s, srx, w, wk, x = ip.
x;
4467 #ifdef MFEM_THREAD_SAFE
4471 k = (int) floor ( m * x + 0.5 );
4472 k = k > m ? m : k < 0 ? 0 : k;
4475 for (i = 0; i <= m; i++)
4478 wk *= ( rxxk(i) = x - (double)(i) / m );
4480 w = wk * ( rxxk(k) = x - (double)(k) / m );
4482 for (i = 0; i <= m; i++)
4484 rxxk(i) = 1.0 / rxxk(i);
4487 for (i = 0; i <= m; i++)
4496 dshape(0,0) = (s - w * rxxk(0)) * rwk(0) * rxxk(0);
4500 dshape(0,0) = wk * srx * rwk(0);
4504 dshape(1,0) = (s - w * rxxk(m)) * rwk(m) * rxxk(m);
4508 dshape(1,0) = wk * srx * rwk(k);
4510 for (i = 1; i < m; i++)
4513 dshape(i+1,0) = (s - w * rxxk(i)) * rwk(i) * rxxk(i);
4517 dshape(k+1,0) = wk * srx * rwk(k);
4546 double L0, L1, L2, L3;
4548 L1 = ip.
x; L2 = ip.
y; L3 = ip.
z; L0 = 1.0 - L1 - L2 - L3;
4549 shape(0) = 1.0 - 3.0 * L0;
4550 shape(1) = 1.0 - 3.0 * L1;
4551 shape(2) = 1.0 - 3.0 * L2;
4552 shape(3) = 1.0 - 3.0 * L3;
4558 dshape(0,0) = 3.0; dshape(0,1) = 3.0; dshape(0,2) = 3.0;
4559 dshape(1,0) = -3.0; dshape(1,1) = 0.0; dshape(1,2) = 0.0;
4560 dshape(2,0) = 0.0; dshape(2,1) = -3.0; dshape(2,2) = 0.0;
4561 dshape(3,0) = 0.0; dshape(3,1) = 0.0; dshape(3,2) = -3.0;
4582 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4603 dshape(0,0) = 0.0; dshape(0,1) = 0.0; dshape(0,2) = 0.0;
4617 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4618 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4619 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4620 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4621 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4622 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4623 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4624 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4626 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4627 I[ 9] = 1; J[ 9] = 2; K[ 9] = 0;
4628 I[10] = 2; J[10] = 1; K[10] = 0;
4629 I[11] = 0; J[11] = 2; K[11] = 0;
4630 I[12] = 2; J[12] = 0; K[12] = 1;
4631 I[13] = 1; J[13] = 2; K[13] = 1;
4632 I[14] = 2; J[14] = 1; K[14] = 1;
4633 I[15] = 0; J[15] = 2; K[15] = 1;
4634 I[16] = 0; J[16] = 0; K[16] = 2;
4635 I[17] = 1; J[17] = 0; K[17] = 2;
4636 I[18] = 1; J[18] = 1; K[18] = 2;
4637 I[19] = 0; J[19] = 1; K[19] = 2;
4639 I[20] = 2; J[20] = 2; K[20] = 0;
4640 I[21] = 2; J[21] = 0; K[21] = 2;
4641 I[22] = 1; J[22] = 2; K[22] = 2;
4642 I[23] = 2; J[23] = 1; K[23] = 2;
4643 I[24] = 0; J[24] = 2; K[24] = 2;
4644 I[25] = 2; J[25] = 2; K[25] = 1;
4646 I[26] = 2; J[26] = 2; K[26] = 2;
4648 else if (degree == 3)
4654 I[ 0] = 0; J[ 0] = 0; K[ 0] = 0;
4655 I[ 1] = 1; J[ 1] = 0; K[ 1] = 0;
4656 I[ 2] = 1; J[ 2] = 1; K[ 2] = 0;
4657 I[ 3] = 0; J[ 3] = 1; K[ 3] = 0;
4658 I[ 4] = 0; J[ 4] = 0; K[ 4] = 1;
4659 I[ 5] = 1; J[ 5] = 0; K[ 5] = 1;
4660 I[ 6] = 1; J[ 6] = 1; K[ 6] = 1;
4661 I[ 7] = 0; J[ 7] = 1; K[ 7] = 1;
4663 I[ 8] = 2; J[ 8] = 0; K[ 8] = 0;
4664 I[ 9] = 3; J[ 9] = 0; K[ 9] = 0;
4665 I[10] = 1; J[10] = 2; K[10] = 0;
4666 I[11] = 1; J[11] = 3; K[11] = 0;
4667 I[12] = 2; J[12] = 1; K[12] = 0;
4668 I[13] = 3; J[13] = 1; K[13] = 0;
4669 I[14] = 0; J[14] = 2; K[14] = 0;
4670 I[15] = 0; J[15] = 3; K[15] = 0;
4671 I[16] = 2; J[16] = 0; K[16] = 1;
4672 I[17] = 3; J[17] = 0; K[17] = 1;
4673 I[18] = 1; J[18] = 2; K[18] = 1;
4674 I[19] = 1; J[19] = 3; K[19] = 1;
4675 I[20] = 2; J[20] = 1; K[20] = 1;
4676 I[21] = 3; J[21] = 1; K[21] = 1;
4677 I[22] = 0; J[22] = 2; K[22] = 1;
4678 I[23] = 0; J[23] = 3; K[23] = 1;
4679 I[24] = 0; J[24] = 0; K[24] = 2;
4680 I[25] = 0; J[25] = 0; K[25] = 3;
4681 I[26] = 1; J[26] = 0; K[26] = 2;
4682 I[27] = 1; J[27] = 0; K[27] = 3;
4683 I[28] = 1; J[28] = 1; K[28] = 2;
4684 I[29] = 1; J[29] = 1; K[29] = 3;
4685 I[30] = 0; J[30] = 1; K[30] = 2;
4686 I[31] = 0; J[31] = 1; K[31] = 3;
4688 I[32] = 2; J[32] = 3; K[32] = 0;
4689 I[33] = 3; J[33] = 3; K[33] = 0;
4690 I[34] = 2; J[34] = 2; K[34] = 0;
4691 I[35] = 3; J[35] = 2; K[35] = 0;
4692 I[36] = 2; J[36] = 0; K[36] = 2;
4693 I[37] = 3; J[37] = 0; K[37] = 2;
4694 I[38] = 2; J[38] = 0; K[38] = 3;
4695 I[39] = 3; J[39] = 0; K[39] = 3;
4696 I[40] = 1; J[40] = 2; K[40] = 2;
4697 I[41] = 1; J[41] = 3; K[41] = 2;
4698 I[42] = 1; J[42] = 2; K[42] = 3;
4699 I[43] = 1; J[43] = 3; K[43] = 3;
4700 I[44] = 3; J[44] = 1; K[44] = 2;
4701 I[45] = 2; J[45] = 1; K[45] = 2;
4702 I[46] = 3; J[46] = 1; K[46] = 3;
4703 I[47] = 2; J[47] = 1; K[47] = 3;
4704 I[48] = 0; J[48] = 3; K[48] = 2;
4705 I[49] = 0; J[49] = 2; K[49] = 2;
4706 I[50] = 0; J[50] = 3; K[50] = 3;
4707 I[51] = 0; J[51] = 2; K[51] = 3;
4708 I[52] = 2; J[52] = 2; K[52] = 1;
4709 I[53] = 3; J[53] = 2; K[53] = 1;
4710 I[54] = 2; J[54] = 3; K[54] = 1;
4711 I[55] = 3; J[55] = 3; K[55] = 1;
4713 I[56] = 2; J[56] = 2; K[56] = 2;
4714 I[57] = 3; J[57] = 2; K[57] = 2;
4715 I[58] = 3; J[58] = 3; K[58] = 2;
4716 I[59] = 2; J[59] = 3; K[59] = 2;
4717 I[60] = 2; J[60] = 2; K[60] = 3;
4718 I[61] = 3; J[61] = 2; K[61] = 3;
4719 I[62] = 3; J[62] = 3; K[62] = 3;
4720 I[63] = 2; J[63] = 3; K[63] = 3;
4724 mfem_error (
"LagrangeHexFiniteElement::LagrangeHexFiniteElement");
4728 dof1d = fe1d ->
GetDof();
4730 #ifndef MFEM_THREAD_SAFE
4740 for (
int n = 0; n <
dof; n++)
4755 #ifdef MFEM_THREAD_SAFE
4756 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4763 for (
int n = 0; n <
dof; n++)
4765 shape(n) = shape1dx(I[n]) * shape1dy(J[n]) * shape1dz(K[n]);
4776 #ifdef MFEM_THREAD_SAFE
4777 Vector shape1dx(dof1d), shape1dy(dof1d), shape1dz(dof1d);
4778 DenseMatrix dshape1dx(dof1d,1), dshape1dy(dof1d,1), dshape1dz(dof1d,1);
4789 for (
int n = 0; n <
dof; n++)
4791 dshape(n,0) = dshape1dx(I[n],0) * shape1dy(J[n]) * shape1dz(K[n]);
4792 dshape(n,1) = shape1dx(I[n]) * dshape1dy(J[n],0) * shape1dz(K[n]);
4793 dshape(n,2) = shape1dx(I[n]) * shape1dy(J[n]) * dshape1dz(K[n],0);
4822 shape(0) = 1.0 - 2.0 * x;
4829 shape(1) = 2.0 * x - 1.0;
4830 shape(2) = 2.0 - 2.0 * x;
4841 dshape(0,0) = - 2.0;
4849 dshape(2,0) = - 2.0;
4876 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4877 L1 = 2.0 * ( ip.
x );
4878 L2 = 2.0 * ( ip.
y );
4887 for (i = 0; i < 6; i++)
4894 shape(0) = L0 - 1.0;
4901 shape(1) = L1 - 1.0;
4908 shape(2) = L2 - 1.0;
4912 shape(3) = 1.0 - L2;
4913 shape(4) = 1.0 - L0;
4914 shape(5) = 1.0 - L1;
4924 L0 = 2.0 * ( 1. - ip.
x - ip.
y );
4925 L1 = 2.0 * ( ip.
x );
4926 L2 = 2.0 * ( ip.
y );
4928 double DL0[2], DL1[2], DL2[2];
4929 DL0[0] = -2.0; DL0[1] = -2.0;
4930 DL1[0] = 2.0; DL1[1] = 0.0;
4931 DL2[0] = 0.0; DL2[1] = 2.0;
4933 for (i = 0; i < 6; i++)
4934 for (j = 0; j < 2; j++)
4941 for (j = 0; j < 2; j++)
4943 dshape(0,j) = DL0[j];
4944 dshape(3,j) = DL1[j];
4945 dshape(5,j) = DL2[j];
4950 for (j = 0; j < 2; j++)
4952 dshape(3,j) = DL0[j];
4953 dshape(1,j) = DL1[j];
4954 dshape(4,j) = DL2[j];
4959 for (j = 0; j < 2; j++)
4961 dshape(5,j) = DL0[j];
4962 dshape(4,j) = DL1[j];
4963 dshape(2,j) = DL2[j];
4968 for (j = 0; j < 2; j++)
4970 dshape(3,j) = - DL2[j];
4971 dshape(4,j) = - DL0[j];
4972 dshape(5,j) = - DL1[j];
5017 double L0, L1, L2, L3, L4, L5;
5018 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5019 L1 = 2.0 * ( ip.
x );
5020 L2 = 2.0 * ( ip.
y );
5021 L3 = 2.0 * ( ip.
z );
5022 L4 = 2.0 * ( ip.
x + ip.
y );
5023 L5 = 2.0 * ( ip.
y + ip.
z );
5036 for (i = 0; i < 10; i++)
5043 shape(0) = L0 - 1.0;
5051 shape(1) = L1 - 1.0;
5059 shape(2) = L2 - 1.0;
5067 shape(3) = L3 - 1.0;
5069 else if ((L4 <= 1.0) && (L5 <= 1.0))
5071 shape(4) = 1.0 - L5;
5073 shape(6) = 1.0 - L4;
5074 shape(8) = 1.0 - L0;
5076 else if ((L4 >= 1.0) && (L5 <= 1.0))
5078 shape(4) = 1.0 - L5;
5079 shape(5) = 1.0 - L1;
5080 shape(7) = L4 - 1.0;
5083 else if ((L4 <= 1.0) && (L5 >= 1.0))
5085 shape(5) = 1.0 - L3;
5086 shape(6) = 1.0 - L4;
5088 shape(9) = L5 - 1.0;
5090 else if ((L4 >= 1.0) && (L5 >= 1.0))
5093 shape(7) = L4 - 1.0;
5094 shape(8) = 1.0 - L2;
5095 shape(9) = L5 - 1.0;
5104 double L0, L1, L2, L3, L4, L5;
5105 L0 = 2.0 * ( 1. - ip.
x - ip.
y - ip.
z );
5106 L1 = 2.0 * ( ip.
x );
5107 L2 = 2.0 * ( ip.
y );
5108 L3 = 2.0 * ( ip.
z );
5109 L4 = 2.0 * ( ip.
x + ip.
y );
5110 L5 = 2.0 * ( ip.
y + ip.
z );
5112 double DL0[3], DL1[3], DL2[3], DL3[3], DL4[3], DL5[3];
5113 DL0[0] = -2.0; DL0[1] = -2.0; DL0[2] = -2.0;
5114 DL1[0] = 2.0; DL1[1] = 0.0; DL1[2] = 0.0;
5115 DL2[0] = 0.0; DL2[1] = 2.0; DL2[2] = 0.0;
5116 DL3[0] = 0.0; DL3[1] = 0.0; DL3[2] = 2.0;
5117 DL4[0] = 2.0; DL4[1] = 2.0; DL4[2] = 0.0;
5118 DL5[0] = 0.0; DL5[1] = 2.0; DL5[2] = 2.0;
5120 for (i = 0; i < 10; i++)
5121 for (j = 0; j < 3; j++)
5128 for (j = 0; j < 3; j++)
5130 dshape(0,j) = DL0[j];
5131 dshape(4,j) = DL1[j];
5132 dshape(5,j) = DL2[j];
5133 dshape(6,j) = DL3[j];
5138 for (j = 0; j < 3; j++)
5140 dshape(4,j) = DL0[j];
5141 dshape(1,j) = DL1[j];
5142 dshape(7,j) = DL2[j];
5143 dshape(8,j) = DL3[j];
5148 for (j = 0; j < 3; j++)
5150 dshape(5,j) = DL0[j];
5151 dshape(7,j) = DL1[j];
5152 dshape(2,j) = DL2[j];
5153 dshape(9,j) = DL3[j];
5158 for (j = 0; j < 3; j++)
5160 dshape(6,j) = DL0[j];
5161 dshape(8,j) = DL1[j];
5162 dshape(9,j) = DL2[j];
5163 dshape(3,j) = DL3[j];
5166 else if ((L4 <= 1.0) && (L5 <= 1.0))
5168 for (j = 0; j < 3; j++)
5170 dshape(4,j) = - DL5[j];
5171 dshape(5,j) = DL2[j];
5172 dshape(6,j) = - DL4[j];
5173 dshape(8,j) = - DL0[j];
5176 else if ((L4 >= 1.0) && (L5 <= 1.0))
5178 for (j = 0; j < 3; j++)
5180 dshape(4,j) = - DL5[j];
5181 dshape(5,j) = - DL1[j];
5182 dshape(7,j) = DL4[j];
5183 dshape(8,j) = DL3[j];
5186 else if ((L4 <= 1.0) && (L5 >= 1.0))
5188 for (j = 0; j < 3; j++)
5190 dshape(5,j) = - DL3[j];
5191 dshape(6,j) = - DL4[j];
5192 dshape(8,j) = DL1[j];
5193 dshape(9,j) = DL5[j];
5196 else if ((L4 >= 1.0) && (L5 >= 1.0))
5198 for (j = 0; j < 3; j++)
5200 dshape(5,j) = DL0[j];
5201 dshape(7,j) = DL4[j];
5202 dshape(8,j) = - DL2[j];
5203 dshape(9,j) = DL5[j];
5236 double x = ip.
x, y = ip.
y;
5238 Lx = 2.0 * ( 1. - x );
5239 Ly = 2.0 * ( 1. - y );
5248 for (i = 0; i < 9; i++)
5253 if ((x <= 0.5) && (y <= 0.5))
5255 shape(0) = (Lx - 1.0) * (Ly - 1.0);
5256 shape(4) = (2.0 - Lx) * (Ly - 1.0);
5257 shape(8) = (2.0 - Lx) * (2.0 - Ly);
5258 shape(7) = (Lx - 1.0) * (2.0 - Ly);
5260 else if ((x >= 0.5) && (y <= 0.5))
5262 shape(4) = Lx * (Ly - 1.0);
5263 shape(1) = (1.0 - Lx) * (Ly - 1.0);
5264 shape(5) = (1.0 - Lx) * (2.0 - Ly);
5265 shape(8) = Lx * (2.0 - Ly);
5267 else if ((x >= 0.5) && (y >= 0.5))
5269 shape(8) = Lx * Ly ;
5270 shape(5) = (1.0 - Lx) * Ly ;
5271 shape(2) = (1.0 - Lx) * (1.0 - Ly);
5272 shape(6) = Lx * (1.0 - Ly);
5274 else if ((x <= 0.5) && (y >= 0.5))
5276 shape(7) = (Lx - 1.0) * Ly ;
5277 shape(8) = (2.0 - Lx) * Ly ;
5278 shape(6) = (2.0 - Lx) * (1.0 - Ly);
5279 shape(3) = (Lx - 1.0) * (1.0 - Ly);
5287 double x = ip.
x, y = ip.
y;
5289 Lx = 2.0 * ( 1. - x );
5290 Ly = 2.0 * ( 1. - y );
5292 for (i = 0; i < 9; i++)
5293 for (j = 0; j < 2; j++)
5298 if ((x <= 0.5) && (y <= 0.5))
5300 dshape(0,0) = 2.0 * (1.0 - Ly);
5301 dshape(0,1) = 2.0 * (1.0 - Lx);
5303 dshape(4,0) = 2.0 * (Ly - 1.0);
5304 dshape(4,1) = -2.0 * (2.0 - Lx);
5306 dshape(8,0) = 2.0 * (2.0 - Ly);
5307 dshape(8,1) = 2.0 * (2.0 - Lx);
5309 dshape(7,0) = -2.0 * (2.0 - Ly);
5310 dshape(7,0) = 2.0 * (Lx - 1.0);
5312 else if ((x >= 0.5) && (y <= 0.5))
5314 dshape(4,0) = -2.0 * (Ly - 1.0);
5315 dshape(4,1) = -2.0 * Lx;
5317 dshape(1,0) = 2.0 * (Ly - 1.0);
5318 dshape(1,1) = -2.0 * (1.0 - Lx);
5320 dshape(5,0) = 2.0 * (2.0 - Ly);
5321 dshape(5,1) = 2.0 * (1.0 - Lx);
5323 dshape(8,0) = -2.0 * (2.0 - Ly);
5324 dshape(8,1) = 2.0 * Lx;
5326 else if ((x >= 0.5) && (y >= 0.5))
5328 dshape(8,0) = -2.0 * Ly;
5329 dshape(8,1) = -2.0 * Lx;
5331 dshape(5,0) = 2.0 * Ly;
5332 dshape(5,1) = -2.0 * (1.0 - Lx);
5334 dshape(2,0) = 2.0 * (1.0 - Ly);
5335 dshape(2,1) = 2.0 * (1.0 - Lx);
5337 dshape(6,0) = -2.0 * (1.0 - Ly);
5338 dshape(6,1) = 2.0 * Lx;
5340 else if ((x <= 0.5) && (y >= 0.5))
5342 dshape(7,0) = -2.0 * Ly;
5343 dshape(7,1) = -2.0 * (Lx - 1.0);
5345 dshape(8,0) = 2.0 * Ly ;
5346 dshape(8,1) = -2.0 * (2.0 - Lx);
5348 dshape(6,0) = 2.0 * (1.0 - Ly);
5349 dshape(6,1) = 2.0 * (2.0 - Lx);
5351 dshape(3,0) = -2.0 * (1.0 - Ly);
5352 dshape(3,1) = 2.0 * (Lx - 1.0);
5363 I[ 0] = 0.0; J[ 0] = 0.0; K[ 0] = 0.0;
5364 I[ 1] = 1.0; J[ 1] = 0.0; K[ 1] = 0.0;
5365 I[ 2] = 1.0; J[ 2] = 1.0; K[ 2] = 0.0;
5366 I[ 3] = 0.0; J[ 3] = 1.0; K[ 3] = 0.0;
5367 I[ 4] = 0.0; J[ 4] = 0.0; K[ 4] = 1.0;
5368 I[ 5] = 1.0; J[ 5] = 0.0; K[ 5] = 1.0;
5369 I[ 6] = 1.0; J[ 6] = 1.0; K[ 6] = 1.0;
5370 I[ 7] = 0.0; J[ 7] = 1.0; K[ 7] = 1.0;
5372 I[ 8] = 0.5; J[ 8] = 0.0; K[ 8] = 0.0;
5373 I[ 9] = 1.0; J[ 9] = 0.5; K[ 9] = 0.0;
5374 I[10] = 0.5; J[10] = 1.0; K[10] = 0.0;
5375 I[11] = 0.0; J[11] = 0.5; K[11] = 0.0;
5376 I[12] = 0.5; J[12] = 0.0; K[12] = 1.0;
5377 I[13] = 1.0; J[13] = 0.5; K[13] = 1.0;
5378 I[14] = 0.5; J[14] = 1.0; K[14] = 1.0;
5379 I[15] = 0.0; J[15] = 0.5; K[15] = 1.0;
5380 I[16] = 0.0; J[16] = 0.0; K[16] = 0.5;
5381 I[17] = 1.0; J[17] = 0.0; K[17] = 0.5;
5382 I[18] = 1.0; J[18] = 1.0; K[18] = 0.5;
5383 I[19] = 0.0; J[19] = 1.0; K[19] = 0.5;
5385 I[20] = 0.5; J[20] = 0.5; K[20] = 0.0;
5386 I[21] = 0.5; J[21] = 0.0; K[21] = 0.5;
5387 I[22] = 1.0; J[22] = 0.5; K[22] = 0.5;
5388 I[23] = 0.5; J[23] = 1.0; K[23] = 0.5;
5389 I[24] = 0.0; J[24] = 0.5; K[24] = 0.5;
5390 I[25] = 0.5; J[25] = 0.5; K[25] = 1.0;
5392 I[26] = 0.5; J[26] = 0.5; K[26] = 0.5;
5394 for (
int n = 0; n < 27; n++)
5407 double x = ip.
x, y = ip.
y, z = ip.
z;
5409 for (i = 0; i < 27; i++)
5414 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5429 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5444 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5459 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5474 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5489 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5504 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5535 shape(N[0]) = Lx * Ly * Lz;
5536 shape(N[1]) = (1 - Lx) * Ly * Lz;
5537 shape(N[2]) = (1 - Lx) * (1 - Ly) * Lz;
5538 shape(N[3]) = Lx * (1 - Ly) * Lz;
5539 shape(N[4]) = Lx * Ly * (1 - Lz);
5540 shape(N[5]) = (1 - Lx) * Ly * (1 - Lz);
5541 shape(N[6]) = (1 - Lx) * (1 - Ly) * (1 - Lz);
5542 shape(N[7]) = Lx * (1 - Ly) * (1 - Lz);
5550 double x = ip.
x, y = ip.
y, z = ip.
z;
5552 for (i = 0; i < 27; i++)
5553 for (j = 0; j < 3; j++)
5558 if ((x <= 0.5) && (y <= 0.5) && (z <= 0.5))
5573 else if ((x >= 0.5) && (y <= 0.5) && (z <= 0.5))
5588 else if ((x <= 0.5) && (y >= 0.5) && (z <= 0.5))
5603 else if ((x >= 0.5) && (y >= 0.5) && (z <= 0.5))
5618 else if ((x <= 0.5) && (y <= 0.5) && (z >= 0.5))
5633 else if ((x >= 0.5) && (y <= 0.5) && (z >= 0.5))
5648 else if ((x <= 0.5) && (y >= 0.5) && (z >= 0.5))
5679 dshape(N[0],0) = -2.0 * Ly * Lz ;
5680 dshape(N[0],1) = -2.0 * Lx * Lz ;
5681 dshape(N[0],2) = -2.0 * Lx * Ly ;
5683 dshape(N[1],0) = 2.0 * Ly * Lz ;
5684 dshape(N[1],1) = -2.0 * (1 - Lx) * Lz ;
5685 dshape(N[1],2) = -2.0 * (1 - Lx) * Ly ;
5687 dshape(N[2],0) = 2.0 * (1 - Ly) * Lz ;
5688 dshape(N[2],1) = 2.0 * (1 - Lx) * Lz ;
5689 dshape(N[2],2) = -2.0 * (1 - Lx) * (1 - Ly);
5691 dshape(N[3],0) = -2.0 * (1 - Ly) * Lz ;
5692 dshape(N[3],1) = 2.0 * Lx * Lz ;
5693 dshape(N[3],2) = -2.0 * Lx * (1 - Ly);
5695 dshape(N[4],0) = -2.0 * Ly * (1 - Lz);
5696 dshape(N[4],1) = -2.0 * Lx * (1 - Lz);
5697 dshape(N[4],2) = 2.0 * Lx * Ly ;
5699 dshape(N[5],0) = 2.0 * Ly * (1 - Lz);
5700 dshape(N[5],1) = -2.0 * (1 - Lx) * (1 - Lz);
5701 dshape(N[5],2) = 2.0 * (1 - Lx) * Ly ;
5703 dshape(N[6],0) = 2.0 * (1 - Ly) * (1 - Lz);
5704 dshape(N[6],1) = 2.0 * (1 - Lx) * (1 - Lz);
5705 dshape(N[6],2) = 2.0 * (1 - Lx) * (1 - Ly);
5707 dshape(N[7],0) = -2.0 * (1 - Ly) * (1 - Lz);
5708 dshape(N[7],1) = 2.0 * Lx * (1 - Lz);
5709 dshape(N[7],2) = 2.0 * Lx * (1 - Ly);
5769 double x = ip.
x, y = ip.
y, z = ip.
z;
5771 shape(0,0) = (1. - y) * (1. - z);
5775 shape(2,0) = y * (1. - z);
5779 shape(4,0) = z * (1. - y);
5788 shape(1,1) = x * (1. - z);
5792 shape(3,1) = (1. - x) * (1. - z);
5800 shape(7,1) = (1. - x) * z;
5805 shape(8,2) = (1. - x) * (1. - y);
5809 shape(9,2) = x * (1. - y);
5813 shape(10,2) = x * y;
5817 shape(11,2) = y * (1. - x);
5825 double x = ip.
x, y = ip.
y, z = ip.
z;
5827 curl_shape(0,0) = 0.;
5828 curl_shape(0,1) = y - 1.;
5829 curl_shape(0,2) = 1. - z;
5831 curl_shape(2,0) = 0.;
5832 curl_shape(2,1) = -y;
5833 curl_shape(2,2) = z - 1.;
5835 curl_shape(4,0) = 0;
5836 curl_shape(4,1) = 1. - y;
5837 curl_shape(4,2) = z;
5839 curl_shape(6,0) = 0.;
5840 curl_shape(6,1) = y;
5841 curl_shape(6,2) = -z;
5843 curl_shape(1,0) = x;
5844 curl_shape(1,1) = 0.;
5845 curl_shape(1,2) = 1. - z;
5847 curl_shape(3,0) = 1. - x;
5848 curl_shape(3,1) = 0.;
5849 curl_shape(3,2) = z - 1.;
5851 curl_shape(5,0) = -x;
5852 curl_shape(5,1) = 0.;
5853 curl_shape(5,2) = z;
5855 curl_shape(7,0) = x - 1.;
5856 curl_shape(7,1) = 0.;
5857 curl_shape(7,2) = -z;
5859 curl_shape(8,0) = x - 1.;
5860 curl_shape(8,1) = 1. - y;
5861 curl_shape(8,2) = 0.;
5863 curl_shape(9,0) = -x;
5864 curl_shape(9,1) = y - 1.;
5865 curl_shape(9,2) = 0;
5867 curl_shape(10,0) = x;
5868 curl_shape(10,1) = -y;
5869 curl_shape(10,2) = 0.;
5871 curl_shape(11,0) = 1. - x;
5872 curl_shape(11,1) = y;
5873 curl_shape(11,2) = 0.;
5876 const double Nedelec1HexFiniteElement::tk[12][3] =
5878 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5879 {1,0,0}, {0,1,0}, {1,0,0}, {0,1,0},
5880 {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}
5887 #ifdef MFEM_THREAD_SAFE
5892 for (k = 0; k < 12; k++)
5895 for (j = 0; j < 12; j++)
5897 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
5899 if (j == k) { d -= 1.0; }
5900 if (fabs(d) > 1.0e-12)
5902 mfem::err <<
"Nedelec1HexFiniteElement::GetLocalInterpolation (...)\n"
5903 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
5911 ip.
x = ip.
y = ip.
z = 0.0;
5918 for (k = 0; k < 12; k++)
5921 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
5924 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
5925 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
5926 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
5927 for (j = 0; j < 12; j++)
5928 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
5929 vshape(j,2)*vk[2])) < 1.0e-12)
5943 for (
int k = 0; k < 12; k++)
5951 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
5952 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
5953 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
5990 double x = ip.
x, y = ip.
y, z = ip.
z;
5992 shape(0,0) = 1. - y - z;
5997 shape(1,1) = 1. - x - z;
6002 shape(2,2) = 1. - x - y;
6021 curl_shape(0,0) = 0.;
6022 curl_shape(0,1) = -2.;
6023 curl_shape(0,2) = 2.;
6025 curl_shape(1,0) = 2.;
6026 curl_shape(1,1) = 0.;
6027 curl_shape(1,2) = -2.;
6029 curl_shape(2,0) = -2.;
6030 curl_shape(2,1) = 2.;
6031 curl_shape(2,2) = 0.;
6033 curl_shape(3,0) = 0.;
6034 curl_shape(3,1) = 0.;
6035 curl_shape(3,2) = 2.;
6037 curl_shape(4,0) = 0.;
6038 curl_shape(4,1) = -2.;
6039 curl_shape(4,2) = 0.;
6041 curl_shape(5,0) = 2.;
6042 curl_shape(5,1) = 0.;
6043 curl_shape(5,2) = 0.;
6046 const double Nedelec1TetFiniteElement::tk[6][3] =
6047 {{1,0,0}, {0,1,0}, {0,0,1}, {-1,1,0}, {-1,0,1}, {0,-1,1}};
6053 #ifdef MFEM_THREAD_SAFE
6058 for (k = 0; k < 6; k++)
6061 for (j = 0; j < 6; j++)
6063 double d = (
vshape(j,0)*tk[k][0] +
vshape(j,1)*tk[k][1] +
6065 if (j == k) { d -= 1.0; }
6066 if (fabs(d) > 1.0e-12)
6068 mfem::err <<
"Nedelec1TetFiniteElement::GetLocalInterpolation (...)\n"
6069 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6077 ip.
x = ip.
y = ip.
z = 0.0;
6084 for (k = 0; k < 6; k++)
6087 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6090 vk[0] =
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2];
6091 vk[1] =
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2];
6092 vk[2] =
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2];
6093 for (j = 0; j < 6; j++)
6094 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6095 vshape(j,2)*vk[2])) < 1.0e-12)
6109 for (
int k = 0; k < 6; k++)
6117 vk[0] * (
J(0,0)*tk[k][0]+
J(0,1)*tk[k][1]+
J(0,2)*tk[k][2] ) +
6118 vk[1] * (
J(1,0)*tk[k][0]+
J(1,1)*tk[k][1]+
J(1,2)*tk[k][2] ) +
6119 vk[2] * (
J(2,0)*tk[k][0]+
J(2,1)*tk[k][1]+
J(2,2)*tk[k][2] );
6156 double x = ip.
x, y = ip.
y, z = ip.
z;
6160 shape(0,2) = z - 1.;
6163 shape(1,1) = y - 1.;
6174 shape(4,0) = x - 1.;
6194 const double RT0HexFiniteElement::nk[6][3] =
6195 {{0,0,-1}, {0,-1,0}, {1,0,0}, {0,1,0}, {-1,0,0}, {0,0,1}};
6201 #ifdef MFEM_THREAD_SAFE
6207 for (k = 0; k < 6; k++)
6210 for (j = 0; j < 6; j++)
6212 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6214 if (j == k) { d -= 1.0; }
6215 if (fabs(d) > 1.0e-12)
6217 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6218 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6226 ip.
x = ip.
y = ip.
z = 0.0;
6234 for (k = 0; k < 6; k++)
6237 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6240 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6241 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6242 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6243 for (j = 0; j < 6; j++)
6244 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6245 vshape(j,2)*vk[2])) < 1.0e-12)
6258 #ifdef MFEM_THREAD_SAFE
6262 for (
int k = 0; k < 6; k++)
6271 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6272 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6273 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6402 double x = ip.
x, y = ip.
y, z = ip.
z;
6406 shape(2,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6409 shape(3,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6412 shape(0,2) = -(1. - 3.*z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6415 shape(1,2) = -(1. - 3.*z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6418 shape(4,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6421 shape(5,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6424 shape(6,1) = -(1. - 3.*y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6427 shape(7,1) = -(1. - 3.*y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6430 shape(8,0) = (-x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6433 shape(9,0) = (-x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6436 shape(10,0) = (-x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6439 shape(11,0) = (-x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6444 shape(13,1) = (-y + 2.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6447 shape(12,1) = (-y + 2.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6450 shape(15,1) = (-y + 2.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6453 shape(14,1) = (-y + 2.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6456 shape(17,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6459 shape(16,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6462 shape(19,0) = -(1. - 3.*x + 2.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6465 shape(18,0) = -(1. - 3.*x + 2.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6471 shape(20,2) = (-z + 2.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6474 shape(21,2) = (-z + 2.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6477 shape(22,2) = (-z + 2.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6480 shape(23,2) = (-z + 2.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6482 shape(24,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*( 2. - 3.*z);
6485 shape(25,0) = (4.*x - 4.*x*x)*( 2. - 3.*y)*(-1. + 3.*z);
6488 shape(26,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*( 2. - 3.*z);
6491 shape(27,0) = (4.*x - 4.*x*x)*(-1. + 3.*y)*(-1. + 3.*z);
6496 shape(28,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*( 2. - 3.*z);
6499 shape(29,1) = (4.*y - 4.*y*y)*( 2. - 3.*x)*(-1. + 3.*z);
6502 shape(30,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*( 2. - 3.*z);
6505 shape(31,1) = (4.*y - 4.*y*y)*(-1. + 3.*x)*(-1. + 3.*z);
6510 shape(32,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*( 2. - 3.*y);
6513 shape(33,2) = (4.*z - 4.*z*z)*( 2. - 3.*x)*(-1. + 3.*y);
6516 shape(34,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*( 2. - 3.*y);
6519 shape(35,2) = (4.*z - 4.*z*z)*(-1. + 3.*x)*(-1. + 3.*y);
6525 double x = ip.
x, y = ip.
y, z = ip.
z;
6527 divshape(2) = -(-3. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6528 divshape(3) = -(-3. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6529 divshape(0) = -(-3. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6530 divshape(1) = -(-3. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6532 divshape(4) = -(-3. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6533 divshape(5) = -(-3. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6534 divshape(6) = -(-3. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6535 divshape(7) = -(-3. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6537 divshape(8) = (-1. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6538 divshape(9) = (-1. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6539 divshape(10) = (-1. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6540 divshape(11) = (-1. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6542 divshape(13) = (-1. + 4.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6543 divshape(12) = (-1. + 4.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6544 divshape(15) = (-1. + 4.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6545 divshape(14) = (-1. + 4.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6547 divshape(17) = -(-3. + 4.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6548 divshape(16) = -(-3. + 4.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6549 divshape(19) = -(-3. + 4.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6550 divshape(18) = -(-3. + 4.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6552 divshape(20) = (-1. + 4.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6553 divshape(21) = (-1. + 4.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6554 divshape(22) = (-1. + 4.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6555 divshape(23) = (-1. + 4.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6557 divshape(24) = ( 4. - 8.*x)*( 2. - 3.*y)*( 2. - 3.*z);
6558 divshape(25) = ( 4. - 8.*x)*( 2. - 3.*y)*(-1. + 3.*z);
6559 divshape(26) = ( 4. - 8.*x)*(-1. + 3.*y)*( 2. - 3.*z);
6560 divshape(27) = ( 4. - 8.*x)*(-1. + 3.*y)*(-1. + 3.*z);
6562 divshape(28) = ( 4. - 8.*y)*( 2. - 3.*x)*( 2. - 3.*z);
6563 divshape(29) = ( 4. - 8.*y)*( 2. - 3.*x)*(-1. + 3.*z);
6564 divshape(30) = ( 4. - 8.*y)*(-1. + 3.*x)*( 2. - 3.*z);
6565 divshape(31) = ( 4. - 8.*y)*(-1. + 3.*x)*(-1. + 3.*z);
6567 divshape(32) = ( 4. - 8.*z)*( 2. - 3.*x)*( 2. - 3.*y);
6568 divshape(33) = ( 4. - 8.*z)*( 2. - 3.*x)*(-1. + 3.*y);
6569 divshape(34) = ( 4. - 8.*z)*(-1. + 3.*x)*( 2. - 3.*y);
6570 divshape(35) = ( 4. - 8.*z)*(-1. + 3.*x)*(-1. + 3.*y);
6573 const double RT1HexFiniteElement::nk[36][3] =
6575 {0, 0,-1}, {0, 0,-1}, {0, 0,-1}, {0, 0,-1},
6576 {0,-1, 0}, {0,-1, 0}, {0,-1, 0}, {0,-1, 0},
6577 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6578 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6579 {-1,0, 0}, {-1,0, 0}, {-1,0, 0}, {-1,0, 0},
6580 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
6581 {1, 0, 0}, {1, 0, 0}, {1, 0, 0}, {1, 0, 0},
6582 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
6583 {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}
6590 #ifdef MFEM_THREAD_SAFE
6596 for (k = 0; k < 36; k++)
6599 for (j = 0; j < 36; j++)
6601 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6603 if (j == k) { d -= 1.0; }
6604 if (fabs(d) > 1.0e-12)
6606 mfem::err <<
"RT0HexFiniteElement::GetLocalInterpolation (...)\n"
6607 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6615 ip.
x = ip.
y = ip.
z = 0.0;
6623 for (k = 0; k < 36; k++)
6626 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6629 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6630 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6631 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6632 for (j = 0; j < 36; j++)
6633 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6634 vshape(j,2)*vk[2])) < 1.0e-12)
6647 #ifdef MFEM_THREAD_SAFE
6651 for (
int k = 0; k < 36; k++)
6660 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6661 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6662 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6690 double x2 = 2.0*ip.
x, y2 = 2.0*ip.
y, z2 = 2.0*ip.
z;
6696 shape(1,0) = x2 - 2.0;
6701 shape(2,1) = y2 - 2.0;
6706 shape(3,2) = z2 - 2.0;
6718 const double RT0TetFiniteElement::nk[4][3] =
6719 {{.5,.5,.5}, {-.5,0,0}, {0,-.5,0}, {0,0,-.5}};
6725 #ifdef MFEM_THREAD_SAFE
6731 for (k = 0; k < 4; k++)
6734 for (j = 0; j < 4; j++)
6736 double d = (
vshape(j,0)*nk[k][0] +
vshape(j,1)*nk[k][1] +
6738 if (j == k) { d -= 1.0; }
6739 if (fabs(d) > 1.0e-12)
6741 mfem::err <<
"RT0TetFiniteElement::GetLocalInterpolation (...)\n"
6742 " k = " << k <<
", j = " << j <<
", d = " << d << endl;
6750 ip.
x = ip.
y = ip.
z = 0.0;
6758 for (k = 0; k < 4; k++)
6761 ip.
x = vk[0]; ip.
y = vk[1]; ip.
z = vk[2];
6764 vk[0] =
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2];
6765 vk[1] =
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2];
6766 vk[2] =
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2];
6767 for (j = 0; j < 4; j++)
6768 if (fabs (I(k,j) = (
vshape(j,0)*vk[0]+
vshape(j,1)*vk[1]+
6769 vshape(j,2)*vk[2])) < 1.0e-12)
6782 #ifdef MFEM_THREAD_SAFE
6786 for (
int k = 0; k < 4; k++)
6795 vk[0] * (
Jinv(0,0)*nk[k][0]+
Jinv(0,1)*nk[k][1]+
Jinv(0,2)*nk[k][2] ) +
6796 vk[1] * (
Jinv(1,0)*nk[k][0]+
Jinv(1,1)*nk[k][1]+
Jinv(1,2)*nk[k][2] ) +
6797 vk[2] * (
Jinv(2,0)*nk[k][0]+
Jinv(2,1)*nk[k][1]+
Jinv(2,2)*nk[k][2] );
6832 double x = 2. * ip.
x - 1.;
6833 double y = 2. * ip.
y - 1.;
6834 double z = 2. * ip.
z - 1.;
6835 double f5 = x * x - y * y;
6836 double f6 = y * y - z * z;
6838 shape(0) = (1./6.) * (1. - 3. * z - f5 - 2. * f6);
6839 shape(1) = (1./6.) * (1. - 3. * y - f5 + f6);
6840 shape(2) = (1./6.) * (1. + 3. * x + 2. * f5 + f6);
6841 shape(3) = (1./6.) * (1. + 3. * y - f5 + f6);
6842 shape(4) = (1./6.) * (1. - 3. * x + 2. * f5 + f6);
6843 shape(5) = (1./6.) * (1. + 3. * z - f5 - 2. * f6);
6849 const double a = 2./3.;
6851 double xt = a * (1. - 2. * ip.
x);
6852 double yt = a * (1. - 2. * ip.
y);
6853 double zt = a * (1. - 2. * ip.
z);
6857 dshape(0,2) = -1. - 2. * zt;
6860 dshape(1,1) = -1. - 2. * yt;
6863 dshape(2,0) = 1. - 2. * xt;
6868 dshape(3,1) = 1. - 2. * yt;
6871 dshape(4,0) = -1. - 2. * xt;
6877 dshape(5,2) = 1. - 2. * zt;
6891 for (
int i = 0; i <=
p; i++)
6905 for (
int i = 0; i <=
p; i++)
6907 for (
int j = 0; j < i; j++)
6909 double xij = x(i) - x(j);
6914 for (
int i = 0; i <=
p; i++)
6921 for (
int i = 0; i <
p; i++)
6925 mfem_error(
"Poly_1D::Basis::Basis : nodes are not increasing!");
6951 int i, k,
p = x.Size() - 1;
6961 for (k = 0; k <
p; k++)
6963 if (y >= (x(k) + x(k+1))/2)
6969 for (i = k+1; i <=
p; i++)
6976 l = lk * (y - x(k));
6978 for (i = 0; i < k; i++)
6980 u(i) = l * w(i) / (y - x(i));
6983 for (i++; i <=
p; i++)
6985 u(i) = l * w(i) / (y - x(i));
7010 int i, k,
p = x.Size() - 1;
7011 double l, lp, lk, sk, si;
7021 for (k = 0; k <
p; k++)
7023 if (y >= (x(k) + x(k+1))/2)
7029 for (i = k+1; i <=
p; i++)
7036 l = lk * (y - x(k));
7039 for (i = 0; i < k; i++)
7041 si = 1.0/(y - x(i));
7043 u(i) = l * si * w(i);
7046 for (i++; i <=
p; i++)
7048 si = 1.0/(y - x(i));
7050 u(i) = l * si * w(i);
7054 for (i = 0; i < k; i++)
7056 d(i) = (lp * w(i) - u(i))/(y - x(i));
7059 for (i++; i <=
p; i++)
7061 d(i) = (lp * w(i) - u(i))/(y - x(i));
7077 "Basis::Eval with second order derivatives not implemented for"
7078 " etype = " << etype);
7091 int i, k,
p = x.Size() - 1;
7092 double l, lp, lp2, lk, sk, si, sk2;
7103 for (k = 0; k <
p; k++)
7105 if (y >= (x(k) + x(k+1))/2)
7111 for (i = k+1; i <=
p; i++)
7118 l = lk * (y - x(k));
7122 for (i = 0; i < k; i++)
7124 si = 1.0/(y - x(i));
7127 u(i) = l * si * w(i);
7130 for (i++; i <=
p; i++)
7132 si = 1.0/(y - x(i));
7135 u(i) = l * si * w(i);
7138 lp2 = lp * sk + l * sk2 + sk * lk;
7140 for (i = 0; i < k; i++)
7142 d(i) = (lp * w(i) - u(i))/(y - x(i));
7143 d2(i) = (lp2 * w(i) - 2 * d(i))/(y - x(i));
7146 d2(k) = sk2 * u(k) + sk * d(k);
7147 for (i++; i <=
p; i++)
7149 d(i) = (lp * w(i) - u(i))/(y - x(i));
7150 d2(i) = (lp2 * w(i) - 2 * d(i))/(y - x(i));
7167 for (
int i = 0; i <=
p; i++)
7169 binom(i,0) = binom(i,i) = 1;
7170 for (
int j = 1; j < i; j++)
7172 binom(i,j) = binom(i-1,j) + binom(i-1,j-1);
7181 for (
int i = 0; i <=
p; i++)
7184 double s = sin(M_PI_2*(i + 0.5)/(p + 1));
7189 void Poly_1D::CalcMono(
const int p,
const double x,
double *u)
7193 for (
int n = 1; n <=
p; n++)
7199 void Poly_1D::CalcMono(
const int p,
const double x,
double *u,
double *d)
7204 for (
int n = 1; n <=
p; n++)
7224 for (i = 1; i <
p; i++)
7231 for (i--; i > 0; i--)
7241 double *u,
double *d)
7252 const double xpy = x + y, ptx = p*x;
7255 for (i = 1; i <
p; i++)
7257 d[i] = b[i]*z*(i*xpy - ptx);
7264 for (i--; i > 0; i--)
7286 const double xpy = x + y, ptx = p*x;
7289 for (i = 1; i <
p; i++)
7291 d[i] = b[i]*z*(i*xpy - ptx);
7296 for (i--; i > 0; i--)
7311 if (p == 0) {
return; }
7312 u[1] = z = 2.*x - 1.;
7313 for (
int n = 1; n <
p; n++)
7315 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7328 if (p == 0) {
return; }
7329 u[1] = z = 2.*x - 1.;
7331 for (
int n = 1; n <
p; n++)
7333 u[n+1] = ((2*n + 1)*z*u[n] - n*u[n-1])/(n + 1);
7334 d[n+1] = (4*n + 2)*u[n] + d[n-1];
7338 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u)
7345 if (p == 0) {
return; }
7346 u[1] = z = 2.*x - 1.;
7347 for (
int n = 1; n <
p; n++)
7349 u[n+1] = 2*z*u[n] - u[n-1];
7353 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d)
7366 if (p == 0) {
return; }
7367 u[1] = z = 2.*x - 1.;
7369 for (
int n = 1; n <
p; n++)
7371 u[n+1] = 2*z*u[n] - u[n-1];
7372 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7376 void Poly_1D::CalcChebyshev(
const int p,
const double x,
double *u,
double *d,
7392 if (p == 0) {
return; }
7393 u[1] = z = 2.*x - 1.;
7396 for (
int n = 1; n <
p; n++)
7398 u[n+1] = 2*z*u[n] - u[n-1];
7399 d[n+1] = (n + 1)*(z*d[n]/n + 2*u[n]);
7400 dd[n+1] = (n + 1)*(2.*(n + 1)*d[n] + z*dd[n])/n;
7411 if (points_container.find(btype) == points_container.end())
7416 if (pts.
Size() <=
p)
7422 pts[
p] =
new double[p + 1];
7432 if ( bases_container.find(btype) == bases_container.end() )
7438 if (bases.
Size() <=
p)
7442 if (bases[p] == NULL)
7452 for (PointsMap::iterator it = points_container.begin();
7453 it != points_container.end() ; ++it)
7456 for (
int i = 0 ; i < pts.
Size() ; ++i )
7463 for (BasisMap::iterator it = bases_container.begin();
7464 it != bases_container.end() ; ++it)
7467 for (
int i = 0 ; i < bases.
Size() ; ++i )
7493 for (
int i = 1; i <
p; i++)
7501 const int p1 = p + 1;
7512 for (
int i = 1; i <
p; i++)
7516 for (
int i = 1; i <
p; i++)
7520 for (
int i = 1; i <
p; i++)
7524 for (
int i = 1; i <
p; i++)
7530 for (
int j = 1; j <
p; j++)
7532 for (
int i = 1; i <
p; i++)
7541 const int p1 = p + 1;
7545 dof_map[0 + (0 + 0*p1)*p1] = 0;
7546 dof_map[p + (0 + 0*p1)*p1] = 1;
7547 dof_map[p + (p + 0*p1)*p1] = 2;
7548 dof_map[0 + (p + 0*p1)*p1] = 3;
7549 dof_map[0 + (0 + p*p1)*p1] = 4;
7550 dof_map[p + (0 + p*p1)*p1] = 5;
7551 dof_map[p + (p + p*p1)*p1] = 6;
7552 dof_map[0 + (p + p*p1)*p1] = 7;
7557 for (
int i = 1; i <
p; i++)
7559 dof_map[i + (0 + 0*p1)*p1] = o++;
7561 for (
int i = 1; i <
p; i++)
7563 dof_map[p + (i + 0*p1)*p1] = o++;
7565 for (
int i = 1; i <
p; i++)
7567 dof_map[i + (p + 0*p1)*p1] = o++;
7569 for (
int i = 1; i <
p; i++)
7571 dof_map[0 + (i + 0*p1)*p1] = o++;
7573 for (
int i = 1; i <
p; i++)
7575 dof_map[i + (0 + p*p1)*p1] = o++;
7577 for (
int i = 1; i <
p; i++)
7579 dof_map[p + (i + p*p1)*p1] = o++;
7581 for (
int i = 1; i <
p; i++)
7583 dof_map[i + (p + p*p1)*p1] = o++;
7585 for (
int i = 1; i <
p; i++)
7587 dof_map[0 + (i + p*p1)*p1] = o++;
7589 for (
int i = 1; i <
p; i++)
7591 dof_map[0 + (0 + i*p1)*p1] = o++;
7593 for (
int i = 1; i <
p; i++)
7595 dof_map[p + (0 + i*p1)*p1] = o++;
7597 for (
int i = 1; i <
p; i++)
7599 dof_map[p + (p + i*p1)*p1] = o++;
7601 for (
int i = 1; i <
p; i++)
7603 dof_map[0 + (p + i*p1)*p1] = o++;
7607 for (
int j = 1; j <
p; j++)
7609 for (
int i = 1; i <
p; i++)
7611 dof_map[i + ((p-j) + 0*p1)*p1] = o++;
7614 for (
int j = 1; j <
p; j++)
7616 for (
int i = 1; i <
p; i++)
7618 dof_map[i + (0 + j*p1)*p1] = o++;
7621 for (
int j = 1; j <
p; j++)
7623 for (
int i = 1; i <
p; i++)
7625 dof_map[p + (i + j*p1)*p1] = o++;
7628 for (
int j = 1; j <
p; j++)
7630 for (
int i = 1; i <
p; i++)
7632 dof_map[(p-i) + (p + j*p1)*p1] = o++;
7635 for (
int j = 1; j <
p; j++)
7637 for (
int i = 1; i <
p; i++)
7639 dof_map[0 + ((p-i) + j*p1)*p1] = o++;
7642 for (
int j = 1; j <
p; j++)
7644 for (
int i = 1; i <
p; i++)
7646 dof_map[i + (j + p*p1)*p1] = o++;
7651 for (
int k = 1; k <
p; k++)
7653 for (
int j = 1; j <
p; j++)
7655 for (
int i = 1; i <
p; i++)
7657 dof_map[i + (j + k*p1)*p1] = o++;
7664 MFEM_ABORT(
"invalid dimension: " << dims);
7675 MFEM_ABORT(
"invalid DofMapType: " << dmtype);
7690 const int dims,
const int p,
const DofMapType dmtype)
7692 Pow(p + 1, dims), p,
7706 cbasis1d(
poly1d.GetBasis(p, VerifyClosed(cbtype))),
7707 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(obtype))) { }
7714 #ifndef MFEM_THREAD_SAFE
7722 for (
int i = 1; i <
p; i++)
7731 const int p =
order;
7733 #ifdef MFEM_THREAD_SAFE
7739 shape(0) = shape_x(0);
7740 shape(1) = shape_x(p);
7741 for (
int i = 1; i <
p; i++)
7743 shape(i+1) = shape_x(i);
7750 const int p =
order;
7752 #ifdef MFEM_THREAD_SAFE
7753 Vector shape_x(p+1), dshape_x(p+1);
7758 dshape(0,0) = dshape_x(0);
7759 dshape(1,0) = dshape_x(p);
7760 for (
int i = 1; i <
p; i++)
7762 dshape(i+1,0) = dshape_x(i);
7769 const int p =
order;
7771 #ifdef MFEM_THREAD_SAFE
7772 Vector shape_x(p+1), dshape_x(p+1), d2shape_x(p+1);
7777 Hessian(0,0) = d2shape_x(0);
7778 Hessian(1,0) = d2shape_x(p);
7779 for (
int i = 1; i <
p; i++)
7781 Hessian(i+1,0) = d2shape_x(i);
7787 const int p =
order;
7795 for (
int i = 1; i <
p; i++)
7804 for (
int i = 1; i <
p; i++)
7818 #ifndef MFEM_THREAD_SAFE
7819 const int p1 = p + 1;
7830 for (
int j = 0; j <=
p; j++)
7832 for (
int i = 0; i <=
p; i++)
7842 const int p =
order;
7844 #ifdef MFEM_THREAD_SAFE
7845 Vector shape_x(p+1), shape_y(p+1);
7851 for (
int o = 0, j = 0; j <=
p; j++)
7852 for (
int i = 0; i <=
p; i++)
7854 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
7861 const int p =
order;
7863 #ifdef MFEM_THREAD_SAFE
7864 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
7870 for (
int o = 0, j = 0; j <=
p; j++)
7872 for (
int i = 0; i <=
p; i++)
7874 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
7875 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
7883 const int p =
order;
7885 #ifdef MFEM_THREAD_SAFE
7886 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1),
7887 d2shape_x(p+1), d2shape_y(p+1);
7893 for (
int o = 0, j = 0; j <=
p; j++)
7895 for (
int i = 0; i <=
p; i++)
7897 Hessian(
dof_map[o],0) = d2shape_x(i)* shape_y(j);
7898 Hessian(
dof_map[o],1) = dshape_x(i)* dshape_y(j);
7899 Hessian(
dof_map[o],2) = shape_x(i)*d2shape_y(j); o++;
7906 const int p =
order;
7909 #ifdef MFEM_THREAD_SAFE
7910 Vector shape_x(p+1), shape_y(p+1);
7913 for (
int i = 0; i <=
p; i++)
7922 for (
int o = 0, j = 0; j <=
p; j++)
7923 for (
int i = 0; i <=
p; i++)
7925 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j);
7929 for (
int o = 0, j = 0; j <=
p; j++)
7930 for (
int i = 0; i <=
p; i++)
7932 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j);
7936 for (
int o = 0, j = 0; j <=
p; j++)
7937 for (
int i = 0; i <=
p; i++)
7939 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j);
7943 for (
int o = 0, j = 0; j <=
p; j++)
7944 for (
int i = 0; i <=
p; i++)
7946 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j);
7958 #ifndef MFEM_THREAD_SAFE
7959 const int p1 = p + 1;
7973 for (
int k = 0; k <=
p; k++)
7974 for (
int j = 0; j <=
p; j++)
7975 for (
int i = 0; i <=
p; i++)
7984 const int p =
order;
7986 #ifdef MFEM_THREAD_SAFE
7987 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
7994 for (
int o = 0, k = 0; k <=
p; k++)
7995 for (
int j = 0; j <=
p; j++)
7996 for (
int i = 0; i <=
p; i++)
7998 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
8005 const int p =
order;
8007 #ifdef MFEM_THREAD_SAFE
8008 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8009 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8016 for (
int o = 0, k = 0; k <=
p; k++)
8017 for (
int j = 0; j <=
p; j++)
8018 for (
int i = 0; i <=
p; i++)
8020 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
8021 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
8022 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
8029 const int p =
order;
8031 #ifdef MFEM_THREAD_SAFE
8032 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8033 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8034 Vector d2shape_x(p+1), d2shape_y(p+1), d2shape_z(p+1);
8041 for (
int o = 0, k = 0; k <=
p; k++)
8042 for (
int j = 0; j <=
p; j++)
8043 for (
int i = 0; i <=
p; i++)
8045 Hessian(
dof_map[o],0) = d2shape_x(i)* shape_y(j)* shape_z(k);
8046 Hessian(
dof_map[o],1) = dshape_x(i)* dshape_y(j)* shape_z(k);
8047 Hessian(
dof_map[o],2) = dshape_x(i)* shape_y(j)* dshape_z(k);
8048 Hessian(
dof_map[o],3) = shape_x(i)*d2shape_y(j)* shape_z(k);
8049 Hessian(
dof_map[o],4) = shape_x(i)* dshape_y(j)* dshape_z(k);
8050 Hessian(
dof_map[o],5) = shape_x(i)* shape_y(j)*d2shape_z(k);
8057 const int p =
order;
8060 #ifdef MFEM_THREAD_SAFE
8061 Vector shape_x(p+1), shape_y(p+1);
8064 for (
int i = 0; i <=
p; i++)
8073 for (
int o = 0, k = 0; k <=
p; k++)
8074 for (
int j = 0; j <=
p; j++)
8075 for (
int i = 0; i <=
p; i++)
8077 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_x(k);
8081 for (
int o = 0, k = 0; k <=
p; k++)
8082 for (
int j = 0; j <=
p; j++)
8083 for (
int i = 0; i <=
p; i++)
8085 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_x(k);
8089 for (
int o = 0, k = 0; k <=
p; k++)
8090 for (
int j = 0; j <=
p; j++)
8091 for (
int i = 0; i <=
p; i++)
8093 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_x(k);
8097 for (
int o = 0, k = 0; k <=
p; k++)
8098 for (
int j = 0; j <=
p; j++)
8099 for (
int i = 0; i <=
p; i++)
8101 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_x(k);
8105 for (
int o = 0, k = 0; k <=
p; k++)
8106 for (
int j = 0; j <=
p; j++)
8107 for (
int i = 0; i <=
p; i++)
8109 dofs(
dof_map[o++]) = shape_x(i)*shape_x(j)*shape_y(k);
8113 for (
int o = 0, k = 0; k <=
p; k++)
8114 for (
int j = 0; j <=
p; j++)
8115 for (
int i = 0; i <=
p; i++)
8117 dofs(
dof_map[o++]) = shape_y(i)*shape_x(j)*shape_y(k);
8121 for (
int o = 0, k = 0; k <=
p; k++)
8122 for (
int j = 0; j <=
p; j++)
8123 for (
int i = 0; i <=
p; i++)
8125 dofs(
dof_map[o++]) = shape_y(i)*shape_y(j)*shape_y(k);
8129 for (
int o = 0, k = 0; k <=
p; k++)
8130 for (
int j = 0; j <=
p; j++)
8131 for (
int i = 0; i <=
p; i++)
8133 dofs(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_y(k);
8143 #ifndef MFEM_THREAD_SAFE
8152 for (
int i = 1; i <
p; i++)
8161 const int p =
order;
8163 #ifdef MFEM_THREAD_SAFE
8170 shape(0) = shape_x(0);
8171 shape(1) = shape_x(p);
8172 for (
int i = 1; i <
p; i++)
8174 shape(i+1) = shape_x(i);
8181 const int p =
order;
8183 #ifdef MFEM_THREAD_SAFE
8184 Vector shape_x(p+1), dshape_x(p+1);
8190 dshape(0,0) = dshape_x(0);
8191 dshape(1,0) = dshape_x(p);
8192 for (
int i = 1; i <
p; i++)
8194 dshape(i+1,0) = dshape_x(i);
8208 #ifndef MFEM_THREAD_SAFE
8209 const int p1 = p + 1;
8218 for (
int j = 0; j <=
p; j++)
8219 for (
int i = 0; i <=
p; i++)
8228 const int p =
order;
8230 #ifdef MFEM_THREAD_SAFE
8231 Vector shape_x(p+1), shape_y(p+1);
8238 for (
int o = 0, j = 0; j <=
p; j++)
8239 for (
int i = 0; i <=
p; i++)
8241 shape(
dof_map[o++]) = shape_x(i)*shape_y(j);
8248 const int p =
order;
8250 #ifdef MFEM_THREAD_SAFE
8251 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
8258 for (
int o = 0, j = 0; j <=
p; j++)
8259 for (
int i = 0; i <=
p; i++)
8261 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j);
8262 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j); o++;
8276 #ifndef MFEM_THREAD_SAFE
8277 const int p1 = p + 1;
8288 for (
int k = 0; k <=
p; k++)
8289 for (
int j = 0; j <=
p; j++)
8290 for (
int i = 0; i <=
p; i++)
8298 const int p =
order;
8300 #ifdef MFEM_THREAD_SAFE
8301 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8308 for (
int o = 0, k = 0; k <=
p; k++)
8309 for (
int j = 0; j <=
p; j++)
8310 for (
int i = 0; i <=
p; i++)
8312 shape(
dof_map[o++]) = shape_x(i)*shape_y(j)*shape_z(k);
8319 const int p =
order;
8321 #ifdef MFEM_THREAD_SAFE
8322 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
8323 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
8330 for (
int o = 0, k = 0; k <=
p; k++)
8331 for (
int j = 0; j <=
p; j++)
8332 for (
int i = 0; i <=
p; i++)
8334 dshape(
dof_map[o],0) = dshape_x(i)* shape_y(j)* shape_z(k);
8335 dshape(
dof_map[o],1) = shape_x(i)*dshape_y(j)* shape_z(k);
8336 dshape(
dof_map[o],2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
8353 #ifndef MFEM_THREAD_SAFE
8367 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8377 for (
int i = 1; i <
p; i++)
8381 for (
int i = 1; i <
p; i++)
8385 for (
int i = 1; i <
p; i++)
8391 for (
int j = 1; j <
p; j++)
8392 for (
int i = 1; i + j <
p; i++)
8394 const double w = cp[i] + cp[j] + cp[p-i-j];
8399 for (
int k = 0; k <
dof; k++)
8407 for (
int j = 0; j <=
p; j++)
8408 for (
int i = 0; i + j <=
p; i++)
8410 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8421 const int p =
order;
8423 #ifdef MFEM_THREAD_SAFE
8424 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
dof);
8431 for (
int o = 0, j = 0; j <=
p; j++)
8432 for (
int i = 0; i + j <=
p; i++)
8434 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
8443 const int p =
order;
8445 #ifdef MFEM_THREAD_SAFE
8446 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8447 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8455 for (
int o = 0, j = 0; j <=
p; j++)
8456 for (
int i = 0; i + j <=
p; i++)
8459 du(o,0) = ((dshape_x(i)* shape_l(k)) -
8460 ( shape_x(i)*dshape_l(k)))*shape_y(j);
8461 du(o,1) = ((dshape_y(j)* shape_l(k)) -
8462 ( shape_y(j)*dshape_l(k)))*shape_x(i);
8466 Ti.
Mult(du, dshape);
8472 const int p =
order;
8473 #ifdef MFEM_THREAD_SAFE
8474 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
8475 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
8476 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_l(p + 1);
8484 for (
int o = 0, j = 0; j <=
p; j++)
8485 for (
int i = 0; i + j <=
p; i++)
8489 ddu(o,0) = ((ddshape_x(i) * shape_l(k)) - 2. * (dshape_x(i) * dshape_l(k)) +
8490 (shape_x(i) * ddshape_l(k))) * shape_y(j);
8491 ddu(o,1) = (((shape_x(i) * ddshape_l(k)) - dshape_x(i) * dshape_l(k)) * shape_y(
8492 j)) + (((dshape_x(i) * shape_l(k)) - (shape_x(i) * dshape_l(k))) * dshape_y(j));
8493 ddu(o,2) = ((ddshape_y(j) * shape_l(k)) - 2. * (dshape_y(j) * dshape_l(k)) +
8494 (shape_y(j) * ddshape_l(k))) * shape_x(i);
8498 Ti.
Mult(ddu, ddshape);
8508 #ifndef MFEM_THREAD_SAFE
8525 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8536 for (
int i = 1; i <
p; i++)
8540 for (
int i = 1; i <
p; i++)
8544 for (
int i = 1; i <
p; i++)
8548 for (
int i = 1; i <
p; i++)
8552 for (
int i = 1; i <
p; i++)
8556 for (
int i = 1; i <
p; i++)
8562 for (
int j = 1; j <
p; j++)
8563 for (
int i = 1; i + j <
p; i++)
8565 double w = cp[i] + cp[j] + cp[p-i-j];
8568 for (
int j = 1; j <
p; j++)
8569 for (
int i = 1; i + j <
p; i++)
8571 double w = cp[i] + cp[j] + cp[p-i-j];
8574 for (
int j = 1; j <
p; j++)
8575 for (
int i = 1; i + j <
p; i++)
8577 double w = cp[i] + cp[j] + cp[p-i-j];
8580 for (
int j = 1; j <
p; j++)
8581 for (
int i = 1; i + j <
p; i++)
8583 double w = cp[i] + cp[j] + cp[p-i-j];
8588 for (
int k = 1; k <
p; k++)
8589 for (
int j = 1; j + k <
p; j++)
8590 for (
int i = 1; i + j + k <
p; i++)
8592 double w = cp[i] + cp[j] + cp[k] + cp[p-i-j-k];
8597 for (
int m = 0; m <
dof; m++)
8606 for (
int k = 0; k <=
p; k++)
8607 for (
int j = 0; j + k <=
p; j++)
8608 for (
int i = 0; i + j + k <=
p; i++)
8610 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8621 const int p =
order;
8623 #ifdef MFEM_THREAD_SAFE
8624 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8633 for (
int o = 0, k = 0; k <=
p; k++)
8634 for (
int j = 0; j + k <=
p; j++)
8635 for (
int i = 0; i + j + k <=
p; i++)
8637 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
8646 const int p =
order;
8648 #ifdef MFEM_THREAD_SAFE
8649 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8650 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8659 for (
int o = 0, k = 0; k <=
p; k++)
8660 for (
int j = 0; j + k <=
p; j++)
8661 for (
int i = 0; i + j + k <=
p; i++)
8663 int l = p - i - j - k;
8664 du(o,0) = ((dshape_x(i)* shape_l(l)) -
8665 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
8666 du(o,1) = ((dshape_y(j)* shape_l(l)) -
8667 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
8668 du(o,2) = ((dshape_z(k)* shape_l(l)) -
8669 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
8673 Ti.
Mult(du, dshape);
8679 const int p =
order;
8681 #ifdef MFEM_THREAD_SAFE
8682 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
8683 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
8684 Vector ddshape_x(p + 1), ddshape_y(p + 1), ddshape_z(p + 1), ddshape_l(p + 1);
8693 for (
int o = 0, k = 0; k <=
p; k++)
8694 for (
int j = 0; j + k <=
p; j++)
8695 for (
int i = 0; i + j + k <=
p; i++)
8698 int l = p - i - j - k;
8699 ddu(o,0) = ((ddshape_x(i) * shape_l(l)) - 2. * (dshape_x(i) * dshape_l(l)) +
8700 (shape_x(i) * ddshape_l(l))) * shape_y(j) * shape_z(k);
8701 ddu(o,1) = ((dshape_y(j) * ((dshape_x(i) * shape_l(l)) -
8702 (shape_x(i) * dshape_l(l)))) +
8703 (shape_y(j) * ((ddshape_l(l) * shape_x(i)) -
8704 (dshape_x(i) * dshape_l(l)))))* shape_z(k);
8705 ddu(o,2) = ((dshape_z(k) * ((dshape_x(i) * shape_l(l)) -
8706 (shape_x(i) * dshape_l(l)))) +
8707 (shape_z(k) * ((ddshape_l(l) * shape_x(i)) -
8708 (dshape_x(i) * dshape_l(l)))))* shape_y(j);
8709 ddu(o,3) = ((ddshape_y(j) * shape_l(l)) - 2. * (dshape_y(j) * dshape_l(l)) +
8710 (shape_y(j) * ddshape_l(l))) * shape_x(i) * shape_z(k);
8711 ddu(o,4) = ((dshape_z(k) * ((dshape_y(j) * shape_l(l)) -
8712 (shape_y(j)*dshape_l(l))) ) +
8713 (shape_z(k)* ((ddshape_l(l)*shape_y(j)) -
8714 (dshape_y(j) * dshape_l(l)) ) ) )* shape_x(i);
8715 ddu(o,5) = ((ddshape_z(k) * shape_l(l)) - 2. * (dshape_z(k) * dshape_l(l)) +
8716 (shape_z(k) * ddshape_l(l))) * shape_y(j) * shape_x(i);
8719 Ti.
Mult(ddu, ddshape);
8726 #ifndef MFEM_THREAD_SAFE
8736 Index(
int p) { p2p3 = 2*p + 3; }
8737 int operator()(
int i,
int j) {
return ((p2p3-j)*j)/2+i; }
8751 for (
int i = 1; i <
p; i++)
8756 for (
int i = 1; i <
p; i++)
8761 for (
int i = 1; i <
p; i++)
8768 for (
int j = 1; j <
p; j++)
8769 for (
int i = 1; i + j <
p; i++)
8778 const int p,
const double l1,
const double l2,
double *shape)
8780 const double l3 = 1. - l1 - l2;
8790 for (
int o = 0, j = 0; j <=
p; j++)
8794 for (
int i = 0; i <= p - j; i++)
8804 const int p,
const double l1,
const double l2,
8805 double *dshape_1d,
double *dshape)
8807 const int dof = ((p + 1)*(p + 2))/2;
8808 const double l3 = 1. - l1 - l2;
8812 for (
int o = 0, j = 0; j <=
p; j++)
8816 for (
int i = 0; i <= p - j; i++)
8818 dshape[o++] = s*dshape_1d[i];
8823 for (
int i = 0; i <=
p; i++)
8827 for (
int o = i, j = 0; j <= p - i; j++)
8829 dshape[dof + o] = s*dshape_1d[j];
8839 #ifdef MFEM_THREAD_SAFE
8843 for (
int i = 0; i <
dof; i++)
8852 #ifdef MFEM_THREAD_SAFE
8857 for (
int d = 0; d < 2; d++)
8859 for (
int i = 0; i <
dof; i++)
8871 #ifndef MFEM_THREAD_SAFE
8881 int tri(
int k) {
return (k*(k + 1))/2; }
8882 int tet(
int k) {
return (k*(k + 1)*(k + 2))/6; }
8883 Index(
int p_) { p = p_;
dof = tet(p + 1); }
8884 int operator()(
int i,
int j,
int k)
8885 {
return dof - tet(p - k) - tri(p + 1 - k - j) + i; }
8901 for (
int i = 1; i <
p; i++)
8906 for (
int i = 1; i <
p; i++)
8911 for (
int i = 1; i <
p; i++)
8916 for (
int i = 1; i <
p; i++)
8921 for (
int i = 1; i <
p; i++)
8926 for (
int i = 1; i <
p; i++)
8933 for (
int j = 1; j <
p; j++)
8934 for (
int i = 1; i + j <
p; i++)
8939 for (
int j = 1; j <
p; j++)
8940 for (
int i = 1; i + j <
p; i++)
8945 for (
int j = 1; j <
p; j++)
8946 for (
int i = 1; i + j <
p; i++)
8951 for (
int j = 1; j <
p; j++)
8952 for (
int i = 1; i + j <
p; i++)
8959 for (
int k = 1; k <
p; k++)
8960 for (
int j = 1; j + k <
p; j++)
8961 for (
int i = 1; i + j + k <
p; i++)
8970 const int p,
const double l1,
const double l2,
const double l3,
8973 const double l4 = 1. - l1 - l2 - l3;
8982 for (
int o = 0, k = 0; k <=
p; k++)
8985 const double ek = bp[k]*l3k;
8987 for (
int j = 0; j <= p - k; j++)
8990 double ekj = ek*bpk[j]*l2j;
8991 for (
int i = 0; i <= p - k - j; i++)
9003 const int p,
const double l1,
const double l2,
const double l3,
9004 double *dshape_1d,
double *dshape)
9006 const int dof = ((p + 1)*(p + 2)*(p + 3))/6;
9007 const double l4 = 1. - l1 - l2 - l3;
9015 for (
int o = 0, k = 0; k <=
p; k++)
9018 const double ek = bp[k]*l3k;
9020 for (
int j = 0; j <= p - k; j++)
9023 double ekj = ek*bpk[j]*l2j;
9024 for (
int i = 0; i <= p - k - j; i++)
9026 dshape[o++] = dshape_1d[i]*ekj;
9037 for (
int ok = 0, k = 0; k <=
p; k++)
9040 const double ek = bp[k]*l3k;
9042 for (
int i = 0; i <= p - k; i++)
9045 double eki = ek*bpk[i]*l1i;
9047 for (
int j = 0; j <= p - k - i; j++)
9049 dshape[dof + o] = dshape_1d[j]*eki;
9055 ok += ((p - k + 2)*(p - k + 1))/2;
9062 for (
int j = 0; j <=
p; j++)
9065 const double ej = bp[j]*l2j;
9067 for (
int i = 0; i <= p - j; i++)
9070 double eji = ej*bpj[i]*l1i;
9071 int m = ((p + 2)*(p + 1))/2;
9072 int n = ((p - j + 2)*(p - j + 1))/2;
9073 for (
int o = i, k = 0; k <= p - j - i; k++)
9078 dshape[2*dof + o - n] = dshape_1d[k]*eji;
9091 #ifdef MFEM_THREAD_SAFE
9095 for (
int i = 0; i <
dof; i++)
9104 #ifdef MFEM_THREAD_SAFE
9109 for (
int d = 0; d < 3; d++)
9111 for (
int i = 0; i <
dof; i++)
9126 #ifndef MFEM_THREAD_SAFE
9137 t_dof[0] = 0; s_dof[0] = 0;
9138 t_dof[1] = 1; s_dof[1] = 0;
9139 t_dof[2] = 2; s_dof[2] = 0;
9140 t_dof[3] = 0; s_dof[3] = 1;
9141 t_dof[4] = 1; s_dof[4] = 1;
9142 t_dof[5] = 2; s_dof[5] = 1;
9146 for (
int i=1; i<
p; i++)
9148 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 0 * ne + i] = 0;
9149 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 1 * ne + i] = 0;
9150 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 2 * ne + i] = 0;
9151 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i; s_dof[5 + 3 * ne + i] = 1;
9152 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i; s_dof[5 + 4 * ne + i] = 1;
9153 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i; s_dof[5 + 5 * ne + i] = 1;
9154 t_dof[5 + 6 * ne + i] = 0; s_dof[5 + 6 * ne + i] = i + 1;
9155 t_dof[5 + 7 * ne + i] = 1; s_dof[5 + 7 * ne + i] = i + 1;
9156 t_dof[5 + 8 * ne + i] = 2; s_dof[5 + 8 * ne + i] = i + 1;
9161 int nt = (p-1)*(p-2)/2;
9162 for (
int j=1; j<
p; j++)
9164 for (
int i=1; i<p-j; i++)
9166 int l = j - p + (((2 * p - 1) - i) * i) / 2;
9167 t_dof[6 + 9 * ne + k] = 3 * p + l; s_dof[6 + 9 * ne + k] = 0;
9168 t_dof[6 + 9 * ne + nt + k] = 3 * p + k; s_dof[6 + 9 * ne + nt + k] = 1;
9175 int nq = (p-1)*(p-1);
9176 for (
int j=1; j<
p; j++)
9178 for (
int i=1; i<
p; i++)
9180 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
9181 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
9182 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
9184 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
9185 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
9186 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
9194 for (
int k=1; k<
p; k++)
9197 for (
int j=1; j<
p; j++)
9199 for (
int i=1; i<j; i++)
9201 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
9202 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9211 for (
int i=0; i<
dof; i++)
9222 #ifdef MFEM_THREAD_SAFE
9232 for (
int i=0; i<
dof; i++)
9234 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
9241 #ifdef MFEM_THREAD_SAFE
9255 for (
int i=0; i<
dof; i++)
9257 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
9258 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
9259 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
9270 #ifndef MFEM_THREAD_SAFE
9290 for (
int i=1; i<
p; i++)
9292 t_dof[5 + 0 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 0 * ne + i] = 0;
9293 t_dof[5 + 1 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 1 * ne + i] = 0;
9294 t_dof[5 + 2 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 2 * ne + i] = 0;
9295 t_dof[5 + 3 * ne + i] = 2 + 0 * ne + i;
s_dof[5 + 3 * ne + i] = 1;
9296 t_dof[5 + 4 * ne + i] = 2 + 1 * ne + i;
s_dof[5 + 4 * ne + i] = 1;
9297 t_dof[5 + 5 * ne + i] = 2 + 2 * ne + i;
s_dof[5 + 5 * ne + i] = 1;
9298 t_dof[5 + 6 * ne + i] = 0;
s_dof[5 + 6 * ne + i] = i + 1;
9299 t_dof[5 + 7 * ne + i] = 1;
s_dof[5 + 7 * ne + i] = i + 1;
9300 t_dof[5 + 8 * ne + i] = 2;
s_dof[5 + 8 * ne + i] = i + 1;
9305 int nt = (p-1)*(p-2)/2;
9306 for (
int j=1; j<
p; j++)
9308 for (
int i=1; i<j; i++)
9310 t_dof[6 + 9 * ne + k] = 3 * p + k;
s_dof[6 + 9 * ne + k] = 0;
9311 t_dof[6 + 9 * ne + nt + k] = 3 * p + k;
s_dof[6 + 9 * ne + nt + k] = 1;
9318 int nq = (p-1)*(p-1);
9319 for (
int j=1; j<
p; j++)
9321 for (
int i=1; i<
p; i++)
9323 t_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 2 + 0 * ne + i;
9324 t_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 2 + 1 * ne + i;
9325 t_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 2 + 2 * ne + i;
9327 s_dof[6 + 9 * ne + 2 * nt + 0 * nq + k] = 1 + j;
9328 s_dof[6 + 9 * ne + 2 * nt + 1 * nq + k] = 1 + j;
9329 s_dof[6 + 9 * ne + 2 * nt + 2 * nq + k] = 1 + j;
9337 for (
int k=1; k<
p; k++)
9340 for (
int j=1; j<
p; j++)
9342 for (
int i=1; i<j; i++)
9344 t_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 3 * p + l;
9345 s_dof[6 + 9 * ne + 2 * nt + 3 * nq + m] = 1 + k;
9354 for (
int i=0; i<
dof; i++)
9365 #ifdef MFEM_THREAD_SAFE
9375 for (
int i=0; i<
dof; i++)
9384 #ifdef MFEM_THREAD_SAFE
9398 for (
int i=0; i<
dof; i++)
9412 #ifndef MFEM_THREAD_SAFE
9417 for (
int i = 0; i <=
p; i++)
9432 #ifdef MFEM_THREAD_SAFE
9442 const int p =
order;
9448 for (
int i = 0; i <=
p; i++)
9455 for (
int i = 0; i <=
p; i++)
9467 #ifndef MFEM_THREAD_SAFE
9478 for (
int i = 0; i <=
p; i++)
9494 #ifdef MFEM_THREAD_SAFE
9505 dofs[vertex*
order] = 1.0;
9514 #ifndef MFEM_THREAD_SAFE
9521 for (
int o = 0, j = 0; j <=
p; j++)
9522 for (
int i = 0; i <=
p; i++)
9531 const int p =
order;
9533 #ifdef MFEM_THREAD_SAFE
9534 Vector shape_x(p+1), shape_y(p+1);
9540 for (
int o = 0, j = 0; j <=
p; j++)
9541 for (
int i = 0; i <=
p; i++)
9543 shape(o++) = shape_x(i)*shape_y(j);
9550 const int p =
order;
9552 #ifdef MFEM_THREAD_SAFE
9553 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9559 for (
int o = 0, j = 0; j <=
p; j++)
9560 for (
int i = 0; i <=
p; i++)
9562 dshape(o,0) = dshape_x(i)* shape_y(j);
9563 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9569 const int p =
order;
9572 #ifdef MFEM_THREAD_SAFE
9573 Vector shape_x(p+1), shape_y(p+1);
9576 for (
int i = 0; i <=
p; i++)
9585 for (
int o = 0, j = 0; j <=
p; j++)
9586 for (
int i = 0; i <=
p; i++)
9588 dofs[o++] = shape_x(i)*shape_x(j);
9592 for (
int o = 0, j = 0; j <=
p; j++)
9593 for (
int i = 0; i <=
p; i++)
9595 dofs[o++] = shape_y(i)*shape_x(j);
9599 for (
int o = 0, j = 0; j <=
p; j++)
9600 for (
int i = 0; i <=
p; i++)
9602 dofs[o++] = shape_y(i)*shape_y(j);
9606 for (
int o = 0, j = 0; j <=
p; j++)
9607 for (
int i = 0; i <=
p; i++)
9609 dofs[o++] = shape_x(i)*shape_y(j);
9619 #ifndef MFEM_THREAD_SAFE
9632 for (
int o = 0, j = 0; j <=
p; j++)
9633 for (
int i = 0; i <=
p; i++)
9643 const int p =
order;
9645 #ifdef MFEM_THREAD_SAFE
9646 Vector shape_x(p+1), shape_y(p+1);
9652 for (
int o = 0, j = 0; j <=
p; j++)
9653 for (
int i = 0; i <=
p; i++)
9655 shape(o++) = shape_x(i)*shape_y(j);
9662 const int p =
order;
9664 #ifdef MFEM_THREAD_SAFE
9665 Vector shape_x(p+1), shape_y(p+1), dshape_x(p+1), dshape_y(p+1);
9671 for (
int o = 0, j = 0; j <=
p; j++)
9672 for (
int i = 0; i <=
p; i++)
9674 dshape(o,0) = dshape_x(i)* shape_y(j);
9675 dshape(o,1) = shape_x(i)*dshape_y(j); o++;
9681 const int p =
order;
9686 case 0: dofs[0] = 1.0;
break;
9687 case 1: dofs[
p] = 1.0;
break;
9688 case 2: dofs[p*(p + 2)] = 1.0;
break;
9689 case 3: dofs[p*(p + 1)] = 1.0;
break;
9699 #ifndef MFEM_THREAD_SAFE
9708 for (
int o = 0, k = 0; k <=
p; k++)
9709 for (
int j = 0; j <=
p; j++)
9710 for (
int i = 0; i <=
p; i++)
9719 const int p =
order;
9721 #ifdef MFEM_THREAD_SAFE
9722 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9729 for (
int o = 0, k = 0; k <=
p; k++)
9730 for (
int j = 0; j <=
p; j++)
9731 for (
int i = 0; i <=
p; i++)
9733 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9740 const int p =
order;
9742 #ifdef MFEM_THREAD_SAFE
9743 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9744 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9751 for (
int o = 0, k = 0; k <=
p; k++)
9752 for (
int j = 0; j <=
p; j++)
9753 for (
int i = 0; i <=
p; i++)
9755 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9756 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9757 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9763 const int p =
order;
9766 #ifdef MFEM_THREAD_SAFE
9767 Vector shape_x(p+1), shape_y(p+1);
9770 for (
int i = 0; i <=
p; i++)
9779 for (
int o = 0, k = 0; k <=
p; k++)
9780 for (
int j = 0; j <=
p; j++)
9781 for (
int i = 0; i <=
p; i++)
9783 dofs[o++] = shape_x(i)*shape_x(j)*shape_x(k);
9787 for (
int o = 0, k = 0; k <=
p; k++)
9788 for (
int j = 0; j <=
p; j++)
9789 for (
int i = 0; i <=
p; i++)
9791 dofs[o++] = shape_y(i)*shape_x(j)*shape_x(k);
9795 for (
int o = 0, k = 0; k <=
p; k++)
9796 for (
int j = 0; j <=
p; j++)
9797 for (
int i = 0; i <=
p; i++)
9799 dofs[o++] = shape_y(i)*shape_y(j)*shape_x(k);
9803 for (
int o = 0, k = 0; k <=
p; k++)
9804 for (
int j = 0; j <=
p; j++)
9805 for (
int i = 0; i <=
p; i++)
9807 dofs[o++] = shape_x(i)*shape_y(j)*shape_x(k);
9811 for (
int o = 0, k = 0; k <=
p; k++)
9812 for (
int j = 0; j <=
p; j++)
9813 for (
int i = 0; i <=
p; i++)
9815 dofs[o++] = shape_x(i)*shape_x(j)*shape_y(k);
9819 for (
int o = 0, k = 0; k <=
p; k++)
9820 for (
int j = 0; j <=
p; j++)
9821 for (
int i = 0; i <=
p; i++)
9823 dofs[o++] = shape_y(i)*shape_x(j)*shape_y(k);
9827 for (
int o = 0, k = 0; k <=
p; k++)
9828 for (
int j = 0; j <=
p; j++)
9829 for (
int i = 0; i <=
p; i++)
9831 dofs[o++] = shape_y(i)*shape_y(j)*shape_y(k);
9835 for (
int o = 0, k = 0; k <=
p; k++)
9836 for (
int j = 0; j <=
p; j++)
9837 for (
int i = 0; i <=
p; i++)
9839 dofs[o++] = shape_x(i)*shape_y(j)*shape_y(k);
9849 #ifndef MFEM_THREAD_SAFE
9864 for (
int o = 0, k = 0; k <=
p; k++)
9865 for (
int j = 0; j <=
p; j++)
9866 for (
int i = 0; i <=
p; i++)
9876 const int p =
order;
9878 #ifdef MFEM_THREAD_SAFE
9879 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9886 for (
int o = 0, k = 0; k <=
p; k++)
9887 for (
int j = 0; j <=
p; j++)
9888 for (
int i = 0; i <=
p; i++)
9890 shape(o++) = shape_x(i)*shape_y(j)*shape_z(k);
9897 const int p =
order;
9899 #ifdef MFEM_THREAD_SAFE
9900 Vector shape_x(p+1), shape_y(p+1), shape_z(p+1);
9901 Vector dshape_x(p+1), dshape_y(p+1), dshape_z(p+1);
9908 for (
int o = 0, k = 0; k <=
p; k++)
9909 for (
int j = 0; j <=
p; j++)
9910 for (
int i = 0; i <=
p; i++)
9912 dshape(o,0) = dshape_x(i)* shape_y(j)* shape_z(k);
9913 dshape(o,1) = shape_x(i)*dshape_y(j)* shape_z(k);
9914 dshape(o,2) = shape_x(i)* shape_y(j)*dshape_z(k); o++;
9920 const int p =
order;
9925 case 0: dofs[0] = 1.0;
break;
9926 case 1: dofs[
p] = 1.0;
break;
9927 case 2: dofs[p*(p + 2)] = 1.0;
break;
9928 case 3: dofs[p*(p + 1)] = 1.0;
break;
9929 case 4: dofs[p*(p + 1)*(p + 1)] = 1.0;
break;
9930 case 5: dofs[p + p*(p + 1)*(p + 1)] = 1.0;
break;
9931 case 6: dofs[
dof - 1] = 1.0;
break;
9932 case 7: dofs[
dof - p - 1] = 1.0;
break;
9943 #ifndef MFEM_THREAD_SAFE
9953 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
9956 for (
int o = 0, j = 0; j <=
p; j++)
9957 for (
int i = 0; i + j <=
p; i++)
9959 double w = op[i] + op[j] + op[p-i-j];
9964 for (
int k = 0; k <
dof; k++)
9971 for (
int o = 0, j = 0; j <=
p; j++)
9972 for (
int i = 0; i + j <=
p; i++)
9974 T(o++, k) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
9985 const int p =
order;
9987 #ifdef MFEM_THREAD_SAFE
9988 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1), u(
dof);
9995 for (
int o = 0, j = 0; j <=
p; j++)
9996 for (
int i = 0; i + j <=
p; i++)
9998 u(o++) = shape_x(i)*shape_y(j)*shape_l(p-i-j);
10007 const int p =
order;
10009 #ifdef MFEM_THREAD_SAFE
10010 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
10011 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
10019 for (
int o = 0, j = 0; j <=
p; j++)
10020 for (
int i = 0; i + j <=
p; i++)
10023 du(o,0) = ((dshape_x(i)* shape_l(k)) -
10024 ( shape_x(i)*dshape_l(k)))*shape_y(j);
10025 du(o,1) = ((dshape_y(j)* shape_l(k)) -
10026 ( shape_y(j)*dshape_l(k)))*shape_x(i);
10030 Ti.
Mult(du, dshape);
10038 for (
int i = 0; i <
dof; i++)
10041 dofs[i] = pow(1.0 - ip.
x - ip.
y,
order);
10045 for (
int i = 0; i <
dof; i++)
10048 dofs[i] = pow(ip.
x,
order);
10052 for (
int i = 0; i <
dof; i++)
10055 dofs[i] = pow(ip.
y,
order);
10066 #ifndef MFEM_THREAD_SAFE
10076 for (
int o = 0, j = 0; j <=
p; j++)
10077 for (
int i = 0; i + j <=
p; i++)
10093 #ifdef MFEM_THREAD_SAFE
10106 case 0: dofs[0] = 1.0;
break;
10107 case 1: dofs[
order] = 1.0;
break;
10108 case 2: dofs[
dof-1] = 1.0;
break;
10119 #ifndef MFEM_THREAD_SAFE
10131 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10134 for (
int o = 0, k = 0; k <=
p; k++)
10135 for (
int j = 0; j + k <=
p; j++)
10136 for (
int i = 0; i + j + k <=
p; i++)
10138 double w = op[i] + op[j] + op[k] + op[p-i-j-k];
10143 for (
int m = 0; m <
dof; m++)
10151 for (
int o = 0, k = 0; k <=
p; k++)
10152 for (
int j = 0; j + k <=
p; j++)
10153 for (
int i = 0; i + j + k <=
p; i++)
10155 T(o++, m) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10166 const int p =
order;
10168 #ifdef MFEM_THREAD_SAFE
10169 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10178 for (
int o = 0, k = 0; k <=
p; k++)
10179 for (
int j = 0; j + k <=
p; j++)
10180 for (
int i = 0; i + j + k <=
p; i++)
10182 u(o++) = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
10191 const int p =
order;
10193 #ifdef MFEM_THREAD_SAFE
10194 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
10195 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
10204 for (
int o = 0, k = 0; k <=
p; k++)
10205 for (
int j = 0; j + k <=
p; j++)
10206 for (
int i = 0; i + j + k <=
p; i++)
10208 int l = p - i - j - k;
10209 du(o,0) = ((dshape_x(i)* shape_l(l)) -
10210 ( shape_x(i)*dshape_l(l)))*shape_y(j)*shape_z(k);
10211 du(o,1) = ((dshape_y(j)* shape_l(l)) -
10212 ( shape_y(j)*dshape_l(l)))*shape_x(i)*shape_z(k);
10213 du(o,2) = ((dshape_z(k)* shape_l(l)) -
10214 ( shape_z(k)*dshape_l(l)))*shape_x(i)*shape_y(j);
10218 Ti.
Mult(du, dshape);
10226 for (
int i = 0; i <
dof; i++)
10229 dofs[i] = pow(1.0 - ip.
x - ip.
y - ip.
z,
order);
10233 for (
int i = 0; i <
dof; i++)
10236 dofs[i] = pow(ip.
x,
order);
10240 for (
int i = 0; i <
dof; i++)
10243 dofs[i] = pow(ip.
y,
order);
10247 for (
int i = 0; i <
dof; i++)
10250 dofs[i] = pow(ip.
z,
order);
10261 #ifndef MFEM_THREAD_SAFE
10271 for (
int o = 0, k = 0; k <=
p; k++)
10272 for (
int j = 0; j + k <=
p; j++)
10273 for (
int i = 0; i + j + k <=
p; i++)
10290 #ifdef MFEM_THREAD_SAFE
10303 case 0: dofs[0] = 1.0;
break;
10304 case 1: dofs[
order] = 1.0;
break;
10305 case 2: dofs[(
order*(
order+3))/2] = 1.0;
break;
10306 case 3: dofs[
dof-1] = 1.0;
break;
10317 #ifndef MFEM_THREAD_SAFE
10329 for (
int k=0; k<=
p; k++)
10332 for (
int j=0; j<=
p; j++)
10334 for (
int i=0; i<=j; i++)
10346 for (
int i=0; i<
dof; i++)
10357 #ifdef MFEM_THREAD_SAFE
10367 for (
int i=0; i<
dof; i++)
10369 shape[i] = t_shape[t_dof[i]] * s_shape[s_dof[i]];
10376 #ifdef MFEM_THREAD_SAFE
10390 for (
int i=0; i<
dof; i++)
10392 dshape(i, 0) = t_dshape(t_dof[i],0) * s_shape[s_dof[i]];
10393 dshape(i, 1) = t_dshape(t_dof[i],1) * s_shape[s_dof[i]];
10394 dshape(i, 2) = t_shape[t_dof[i]] * s_dshape(s_dof[i],0);
10405 #ifndef MFEM_THREAD_SAFE
10417 for (
int k=0; k<=
p; k++)
10420 for (
int j=0; j<=
p; j++)
10422 for (
int i=0; i<=j; i++)
10434 for (
int i=0; i<
dof; i++)
10445 #ifdef MFEM_THREAD_SAFE
10455 for (
int i=0; i<
dof; i++)
10464 #ifdef MFEM_THREAD_SAFE
10478 for (
int i=0; i<
dof; i++)
10487 const double RT_QuadrilateralElement::nk[8] =
10488 { 0., -1., 1., 0., 0., 1., -1., 0. };
10501 const int dof2 =
dof/2;
10503 #ifndef MFEM_THREAD_SAFE
10514 for (
int i = 0; i <=
p; i++)
10516 dof_map[1*dof2 + i + 0*(p + 1)] = o++;
10518 for (
int i = 0; i <=
p; i++)
10520 dof_map[0*dof2 + (p + 1) + i*(p + 2)] = o++;
10522 for (
int i = 0; i <=
p; i++)
10524 dof_map[1*dof2 + (p - i) + (p + 1)*(p + 1)] = o++;
10526 for (
int i = 0; i <=
p; i++)
10528 dof_map[0*dof2 + 0 + (p - i)*(p + 2)] = o++;
10532 for (
int j = 0; j <=
p; j++)
10533 for (
int i = 1; i <=
p; i++)
10535 dof_map[0*dof2 + i + j*(p + 2)] = o++;
10537 for (
int j = 1; j <=
p; j++)
10538 for (
int i = 0; i <=
p; i++)
10540 dof_map[1*dof2 + i + j*(p + 1)] = o++;
10545 for (
int j = 0; j <=
p; j++)
10546 for (
int i = 0; i <= p/2; i++)
10548 int idx = 0*dof2 + i + j*(p + 2);
10549 dof_map[idx] = -1 - dof_map[idx];
10552 for (
int j = p/2 + 1; j <=
p; j++)
10554 int idx = 0*dof2 + (p/2 + 1) + j*(p + 2);
10558 for (
int j = 0; j <= p/2; j++)
10559 for (
int i = 0; i <=
p; i++)
10561 int idx = 1*dof2 + i + j*(p + 1);
10562 dof_map[idx] = -1 - dof_map[idx];
10565 for (
int i = 0; i <= p/2; i++)
10567 int idx = 1*dof2 + i + (p/2 + 1)*(p + 1);
10572 for (
int j = 0; j <=
p; j++)
10573 for (
int i = 0; i <= p + 1; i++)
10576 if ((idx =
dof_map[o++]) < 0)
10587 for (
int j = 0; j <= p + 1; j++)
10588 for (
int i = 0; i <=
p; i++)
10591 if ((idx =
dof_map[o++]) < 0)
10607 const int pp1 =
order;
10609 #ifdef MFEM_THREAD_SAFE
10610 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10619 for (
int j = 0; j < pp1; j++)
10620 for (
int i = 0; i <= pp1; i++)
10623 if ((idx =
dof_map[o++]) < 0)
10625 idx = -1 - idx, s = -1;
10631 shape(idx,0) = s*shape_cx(i)*shape_oy(j);
10634 for (
int j = 0; j <= pp1; j++)
10635 for (
int i = 0; i < pp1; i++)
10638 if ((idx =
dof_map[o++]) < 0)
10640 idx = -1 - idx, s = -1;
10647 shape(idx,1) = s*shape_ox(i)*shape_cy(j);
10654 const int pp1 =
order;
10656 #ifdef MFEM_THREAD_SAFE
10657 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10658 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1);
10667 for (
int j = 0; j < pp1; j++)
10668 for (
int i = 0; i <= pp1; i++)
10671 if ((idx =
dof_map[o++]) < 0)
10673 idx = -1 - idx, s = -1;
10679 divshape(idx) = s*dshape_cx(i)*shape_oy(j);
10681 for (
int j = 0; j <= pp1; j++)
10682 for (
int i = 0; i < pp1; i++)
10685 if ((idx =
dof_map[o++]) < 0)
10687 idx = -1 - idx, s = -1;
10693 divshape(idx) = s*shape_ox(i)*dshape_cy(j);
10698 const double RT_HexahedronElement::nk[18] =
10699 { 0.,0.,-1., 0.,-1.,0., 1.,0.,0., 0.,1.,0., -1.,0.,0., 0.,0.,1. };
10712 const int dof3 =
dof/3;
10714 #ifndef MFEM_THREAD_SAFE
10728 for (
int j = 0; j <=
p; j++)
10729 for (
int i = 0; i <=
p; i++)
10731 dof_map[2*dof3 + i + ((p - j) + 0*(p + 1))*(p + 1)] = o++;
10733 for (
int j = 0; j <=
p; j++)
10734 for (
int i = 0; i <=
p; i++)
10736 dof_map[1*dof3 + i + (0 + j*(p + 2))*(p + 1)] = o++;
10738 for (
int j = 0; j <=
p; j++)
10739 for (
int i = 0; i <=
p; i++)
10741 dof_map[0*dof3 + (p + 1) + (i + j*(p + 1))*(p + 2)] = o++;
10743 for (
int j = 0; j <=
p; j++)
10744 for (
int i = 0; i <=
p; i++)
10746 dof_map[1*dof3 + (p - i) + ((p + 1) + j*(p + 2))*(p + 1)] = o++;
10748 for (
int j = 0; j <=
p; j++)
10749 for (
int i = 0; i <=
p; i++)
10751 dof_map[0*dof3 + 0 + ((p - i) + j*(p + 1))*(p + 2)] = o++;
10753 for (
int j = 0; j <=
p; j++)
10754 for (
int i = 0; i <=
p; i++)
10756 dof_map[2*dof3 + i + (j + (p + 1)*(p + 1))*(p + 1)] = o++;
10761 for (
int k = 0; k <=
p; k++)
10762 for (
int j = 0; j <=
p; j++)
10763 for (
int i = 1; i <=
p; i++)
10765 dof_map[0*dof3 + i + (j + k*(p + 1))*(p + 2)] = o++;
10768 for (
int k = 0; k <=
p; k++)
10769 for (
int j = 1; j <=
p; j++)
10770 for (
int i = 0; i <=
p; i++)
10772 dof_map[1*dof3 + i + (j + k*(p + 2))*(p + 1)] = o++;
10775 for (
int k = 1; k <=
p; k++)
10776 for (
int j = 0; j <=
p; j++)
10777 for (
int i = 0; i <=
p; i++)
10779 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
10787 for (
int k = 0; k <=
p; k++)
10788 for (
int j = 0; j <=
p; j++)
10789 for (
int i = 0; i <= p/2; i++)
10791 int idx = 0*dof3 + i + (j + k*(p + 1))*(p + 2);
10792 dof_map[idx] = -1 - dof_map[idx];
10795 for (
int k = 0; k <=
p; k++)
10796 for (
int j = 0; j <= p/2; j++)
10797 for (
int i = 0; i <=
p; i++)
10799 int idx = 1*dof3 + i + (j + k*(p + 2))*(p + 1);
10800 dof_map[idx] = -1 - dof_map[idx];
10803 for (
int k = 0; k <= p/2; k++)
10804 for (
int j = 0; j <=
p; j++)
10805 for (
int i = 0; i <=
p; i++)
10807 int idx = 2*dof3 + i + (j + k*(p + 1))*(p + 1);
10808 dof_map[idx] = -1 - dof_map[idx];
10813 for (
int k = 0; k <=
p; k++)
10814 for (
int j = 0; j <=
p; j++)
10815 for (
int i = 0; i <= p + 1; i++)
10818 if ((idx =
dof_map[o++]) < 0)
10830 for (
int k = 0; k <=
p; k++)
10831 for (
int j = 0; j <= p + 1; j++)
10832 for (
int i = 0; i <=
p; i++)
10835 if ((idx =
dof_map[o++]) < 0)
10847 for (
int k = 0; k <= p + 1; k++)
10848 for (
int j = 0; j <=
p; j++)
10849 for (
int i = 0; i <=
p; i++)
10852 if ((idx =
dof_map[o++]) < 0)
10868 const int pp1 =
order;
10870 #ifdef MFEM_THREAD_SAFE
10871 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10872 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10884 for (
int k = 0; k < pp1; k++)
10885 for (
int j = 0; j < pp1; j++)
10886 for (
int i = 0; i <= pp1; i++)
10889 if ((idx =
dof_map[o++]) < 0)
10891 idx = -1 - idx, s = -1;
10897 shape(idx,0) = s*shape_cx(i)*shape_oy(j)*shape_oz(k);
10902 for (
int k = 0; k < pp1; k++)
10903 for (
int j = 0; j <= pp1; j++)
10904 for (
int i = 0; i < pp1; i++)
10907 if ((idx =
dof_map[o++]) < 0)
10909 idx = -1 - idx, s = -1;
10916 shape(idx,1) = s*shape_ox(i)*shape_cy(j)*shape_oz(k);
10920 for (
int k = 0; k <= pp1; k++)
10921 for (
int j = 0; j < pp1; j++)
10922 for (
int i = 0; i < pp1; i++)
10925 if ((idx =
dof_map[o++]) < 0)
10927 idx = -1 - idx, s = -1;
10935 shape(idx,2) = s*shape_ox(i)*shape_oy(j)*shape_cz(k);
10942 const int pp1 =
order;
10944 #ifdef MFEM_THREAD_SAFE
10945 Vector shape_cx(pp1 + 1), shape_ox(pp1), shape_cy(pp1 + 1), shape_oy(pp1);
10946 Vector shape_cz(pp1 + 1), shape_oz(pp1);
10947 Vector dshape_cx(pp1 + 1), dshape_cy(pp1 + 1), dshape_cz(pp1 + 1);
10959 for (
int k = 0; k < pp1; k++)
10960 for (
int j = 0; j < pp1; j++)
10961 for (
int i = 0; i <= pp1; i++)
10964 if ((idx =
dof_map[o++]) < 0)
10966 idx = -1 - idx, s = -1;
10972 divshape(idx) = s*dshape_cx(i)*shape_oy(j)*shape_oz(k);
10975 for (
int k = 0; k < pp1; k++)
10976 for (
int j = 0; j <= pp1; j++)
10977 for (
int i = 0; i < pp1; i++)
10980 if ((idx =
dof_map[o++]) < 0)
10982 idx = -1 - idx, s = -1;
10988 divshape(idx) = s*shape_ox(i)*dshape_cy(j)*shape_oz(k);
10991 for (
int k = 0; k <= pp1; k++)
10992 for (
int j = 0; j < pp1; j++)
10993 for (
int i = 0; i < pp1; i++)
10996 if ((idx =
dof_map[o++]) < 0)
10998 idx = -1 - idx, s = -1;
11004 divshape(idx) = s*shape_ox(i)*shape_oy(j)*dshape_cz(k);
11009 const double RT_TriangleElement::nk[6] =
11010 { 0., -1., 1., 1., -1., 0. };
11012 const double RT_TriangleElement::c = 1./3.;
11022 #ifndef MFEM_THREAD_SAFE
11032 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11037 for (
int i = 0; i <=
p; i++)
11042 for (
int i = 0; i <=
p; i++)
11047 for (
int i = 0; i <=
p; i++)
11054 for (
int j = 0; j <
p; j++)
11055 for (
int i = 0; i + j <
p; i++)
11057 double w = iop[i] + iop[j] + iop[p-1-i-j];
11065 for (
int k = 0; k <
dof; k++)
11071 const double *n_k = nk + 2*dof2nk[k];
11074 for (
int j = 0; j <=
p; j++)
11075 for (
int i = 0; i + j <=
p; i++)
11077 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
11078 T(o++, k) = s*n_k[0];
11079 T(o++, k) = s*n_k[1];
11081 for (
int i = 0; i <=
p; i++)
11083 double s = shape_x(i)*shape_y(p-i);
11084 T(o++, k) = s*((ip.
x - c)*n_k[0] + (ip.
y - c)*n_k[1]);
11095 const int p =
order - 1;
11097 #ifdef MFEM_THREAD_SAFE
11098 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11107 for (
int j = 0; j <=
p; j++)
11108 for (
int i = 0; i + j <=
p; i++)
11110 double s = shape_x(i)*shape_y(j)*shape_l(p-i-j);
11111 u(o,0) = s; u(o,1) = 0; o++;
11112 u(o,0) = 0; u(o,1) = s; o++;
11114 for (
int i = 0; i <=
p; i++)
11116 double s = shape_x(i)*shape_y(p-i);
11117 u(o,0) = (ip.
x - c)*s;
11118 u(o,1) = (ip.
y - c)*s;
11128 const int p =
order - 1;
11130 #ifdef MFEM_THREAD_SAFE
11131 Vector shape_x(p + 1), shape_y(p + 1), shape_l(p + 1);
11132 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_l(p + 1);
11141 for (
int j = 0; j <=
p; j++)
11142 for (
int i = 0; i + j <=
p; i++)
11145 divu(o++) = (dshape_x(i)*shape_l(k) -
11146 shape_x(i)*dshape_l(k))*shape_y(j);
11147 divu(o++) = (dshape_y(j)*shape_l(k) -
11148 shape_y(j)*dshape_l(k))*shape_x(i);
11150 for (
int i = 0; i <=
p; i++)
11153 divu(o++) = ((shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j) +
11154 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i));
11157 Ti.
Mult(divu, divshape);
11161 const double RT_TetrahedronElement::nk[12] =
11162 { 1,1,1, -1,0,0, 0,-1,0, 0,0,-1 };
11165 const double RT_TetrahedronElement::c = 1./4.;
11175 #ifndef MFEM_THREAD_SAFE
11187 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11193 for (
int j = 0; j <=
p; j++)
11194 for (
int i = 0; i + j <=
p; i++)
11196 double w = bop[i] + bop[j] + bop[p-i-j];
11200 for (
int j = 0; j <=
p; j++)
11201 for (
int i = 0; i + j <=
p; i++)
11203 double w = bop[i] + bop[j] + bop[p-i-j];
11207 for (
int j = 0; j <=
p; j++)
11208 for (
int i = 0; i + j <=
p; i++)
11210 double w = bop[i] + bop[j] + bop[p-i-j];
11214 for (
int j = 0; j <=
p; j++)
11215 for (
int i = 0; i + j <=
p; i++)
11217 double w = bop[i] + bop[j] + bop[p-i-j];
11223 for (
int k = 0; k <
p; k++)
11224 for (
int j = 0; j + k <
p; j++)
11225 for (
int i = 0; i + j + k <
p; i++)
11227 double w = iop[i] + iop[j] + iop[k] + iop[p-1-i-j-k];
11237 for (
int m = 0; m <
dof; m++)
11244 const double *nm = nk + 3*dof2nk[m];
11247 for (
int k = 0; k <=
p; k++)
11248 for (
int j = 0; j + k <=
p; j++)
11249 for (
int i = 0; i + j + k <=
p; i++)
11251 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11252 T(o++, m) = s * nm[0];
11253 T(o++, m) = s * nm[1];
11254 T(o++, m) = s * nm[2];
11256 for (
int j = 0; j <=
p; j++)
11257 for (
int i = 0; i + j <=
p; i++)
11259 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11260 T(o++, m) = s*((ip.
x - c)*nm[0] + (ip.
y - c)*nm[1] +
11272 const int p =
order - 1;
11274 #ifdef MFEM_THREAD_SAFE
11275 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11285 for (
int k = 0; k <=
p; k++)
11286 for (
int j = 0; j + k <=
p; j++)
11287 for (
int i = 0; i + j + k <=
p; i++)
11289 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(p-i-j-k);
11290 u(o,0) = s; u(o,1) = 0; u(o,2) = 0; o++;
11291 u(o,0) = 0; u(o,1) = s; u(o,2) = 0; o++;
11292 u(o,0) = 0; u(o,1) = 0; u(o,2) = s; o++;
11294 for (
int j = 0; j <=
p; j++)
11295 for (
int i = 0; i + j <=
p; i++)
11297 double s = shape_x(i)*shape_y(j)*shape_z(p-i-j);
11298 u(o,0) = (ip.
x - c)*s; u(o,1) = (ip.
y - c)*s; u(o,2) = (ip.
z - c)*s;
11308 const int p =
order - 1;
11310 #ifdef MFEM_THREAD_SAFE
11311 Vector shape_x(p + 1), shape_y(p + 1), shape_z(p + 1), shape_l(p + 1);
11312 Vector dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1), dshape_l(p + 1);
11322 for (
int k = 0; k <=
p; k++)
11323 for (
int j = 0; j + k <=
p; j++)
11324 for (
int i = 0; i + j + k <=
p; i++)
11326 int l = p - i - j - k;
11327 divu(o++) = (dshape_x(i)*shape_l(l) -
11328 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
11329 divu(o++) = (dshape_y(j)*shape_l(l) -
11330 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
11331 divu(o++) = (dshape_z(k)*shape_l(l) -
11332 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
11334 for (
int j = 0; j <=
p; j++)
11335 for (
int i = 0; i + j <=
p; i++)
11339 (shape_x(i) + (ip.
x - c)*dshape_x(i))*shape_y(j)*shape_z(k) +
11340 (shape_y(j) + (ip.
y - c)*dshape_y(j))*shape_x(i)*shape_z(k) +
11341 (shape_z(k) + (ip.
z - c)*dshape_z(k))*shape_x(i)*shape_y(j);
11344 Ti.
Mult(divu, divshape);
11348 const double ND_HexahedronElement::tk[18] =
11349 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,0.,0., 0.,-1.,0., 0.,0.,-1. };
11352 const int cb_type,
const int ob_type)
11361 const int dof3 =
dof/3;
11363 #ifndef MFEM_THREAD_SAFE
11377 for (
int i = 0; i <
p; i++)
11379 dof_map[0*dof3 + i + (0 + 0*(p + 1))*
p] = o++;
11381 for (
int i = 0; i <
p; i++)
11383 dof_map[1*dof3 + p + (i + 0*
p)*(p + 1)] = o++;
11385 for (
int i = 0; i <
p; i++)
11387 dof_map[0*dof3 + i + (p + 0*(p + 1))*
p] = o++;
11389 for (
int i = 0; i <
p; i++)
11391 dof_map[1*dof3 + 0 + (i + 0*
p)*(p + 1)] = o++;
11393 for (
int i = 0; i <
p; i++)
11395 dof_map[0*dof3 + i + (0 + p*(p + 1))*
p] = o++;
11397 for (
int i = 0; i <
p; i++)
11399 dof_map[1*dof3 + p + (i + p*
p)*(p + 1)] = o++;
11401 for (
int i = 0; i <
p; i++)
11403 dof_map[0*dof3 + i + (p + p*(p + 1))*
p] = o++;
11405 for (
int i = 0; i <
p; i++)
11407 dof_map[1*dof3 + 0 + (i + p*
p)*(p + 1)] = o++;
11409 for (
int i = 0; i <
p; i++)
11411 dof_map[2*dof3 + 0 + (0 + i*(p + 1))*(p + 1)] = o++;
11413 for (
int i = 0; i <
p; i++)
11415 dof_map[2*dof3 + p + (0 + i*(p + 1))*(p + 1)] = o++;
11417 for (
int i = 0; i <
p; i++)
11419 dof_map[2*dof3 + p + (p + i*(p + 1))*(p + 1)] = o++;
11421 for (
int i = 0; i <
p; i++)
11423 dof_map[2*dof3 + 0 + (p + i*(p + 1))*(p + 1)] = o++;
11428 for (
int j = 1; j <
p; j++)
11429 for (
int i = 0; i <
p; i++)
11431 dof_map[0*dof3 + i + ((p - j) + 0*(p + 1))*p] = o++;
11433 for (
int j = 0; j <
p; j++)
11434 for (
int i = 1; i <
p; i++)
11436 dof_map[1*dof3 + i + ((p - 1 - j) + 0*p)*(p + 1)] = -1 - (o++);
11439 for (
int k = 1; k <
p; k++)
11440 for (
int i = 0; i <
p; i++)
11442 dof_map[0*dof3 + i + (0 + k*(p + 1))*
p] = o++;
11444 for (
int k = 0; k <
p; k++)
11445 for (
int i = 1; i <
p; i++ )
11447 dof_map[2*dof3 + i + (0 + k*(p + 1))*(p + 1)] = o++;
11450 for (
int k = 1; k <
p; k++)
11451 for (
int j = 0; j <
p; j++)
11453 dof_map[1*dof3 + p + (j + k*
p)*(p + 1)] = o++;
11455 for (
int k = 0; k <
p; k++)
11456 for (
int j = 1; j <
p; j++)
11458 dof_map[2*dof3 + p + (j + k*(p + 1))*(p + 1)] = o++;
11461 for (
int k = 1; k <
p; k++)
11462 for (
int i = 0; i <
p; i++)
11464 dof_map[0*dof3 + (p - 1 - i) + (p + k*(p + 1))*p] = -1 - (o++);
11466 for (
int k = 0; k <
p; k++)
11467 for (
int i = 1; i <
p; i++)
11469 dof_map[2*dof3 + (p - i) + (p + k*(p + 1))*(p + 1)] = o++;
11472 for (
int k = 1; k <
p; k++)
11473 for (
int j = 0; j <
p; j++)
11475 dof_map[1*dof3 + 0 + ((p - 1 - j) + k*p)*(p + 1)] = -1 - (o++);
11477 for (
int k = 0; k <
p; k++)
11478 for (
int j = 1; j <
p; j++)
11480 dof_map[2*dof3 + 0 + ((p - j) + k*(p + 1))*(p + 1)] = o++;
11483 for (
int j = 1; j <
p; j++)
11484 for (
int i = 0; i <
p; i++)
11486 dof_map[0*dof3 + i + (j + p*(p + 1))*
p] = o++;
11488 for (
int j = 0; j <
p; j++)
11489 for (
int i = 1; i <
p; i++)
11491 dof_map[1*dof3 + i + (j + p*
p)*(p + 1)] = o++;
11496 for (
int k = 1; k <
p; k++)
11497 for (
int j = 1; j <
p; j++)
11498 for (
int i = 0; i <
p; i++)
11500 dof_map[0*dof3 + i + (j + k*(p + 1))*
p] = o++;
11503 for (
int k = 1; k <
p; k++)
11504 for (
int j = 0; j <
p; j++)
11505 for (
int i = 1; i <
p; i++)
11507 dof_map[1*dof3 + i + (j + k*
p)*(p + 1)] = o++;
11510 for (
int k = 0; k <
p; k++)
11511 for (
int j = 1; j <
p; j++)
11512 for (
int i = 1; i <
p; i++)
11514 dof_map[2*dof3 + i + (j + k*(p + 1))*(p + 1)] = o++;
11520 for (
int k = 0; k <=
p; k++)
11521 for (
int j = 0; j <=
p; j++)
11522 for (
int i = 0; i <
p; i++)
11525 if ((idx =
dof_map[o++]) < 0)
11527 dof2tk[idx = -1 - idx] = 3;
11536 for (
int k = 0; k <=
p; k++)
11537 for (
int j = 0; j <
p; j++)
11538 for (
int i = 0; i <=
p; i++)
11541 if ((idx =
dof_map[o++]) < 0)
11543 dof2tk[idx = -1 - idx] = 4;
11552 for (
int k = 0; k <
p; k++)
11553 for (
int j = 0; j <=
p; j++)
11554 for (
int i = 0; i <=
p; i++)
11557 if ((idx =
dof_map[o++]) < 0)
11559 dof2tk[idx = -1 - idx] = 5;
11572 const int p =
order;
11574 #ifdef MFEM_THREAD_SAFE
11575 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11576 Vector shape_cz(p + 1), shape_oz(p);
11588 for (
int k = 0; k <=
p; k++)
11589 for (
int j = 0; j <=
p; j++)
11590 for (
int i = 0; i <
p; i++)
11593 if ((idx =
dof_map[o++]) < 0)
11595 idx = -1 - idx, s = -1;
11601 shape(idx,0) = s*shape_ox(i)*shape_cy(j)*shape_cz(k);
11606 for (
int k = 0; k <=
p; k++)
11607 for (
int j = 0; j <
p; j++)
11608 for (
int i = 0; i <=
p; i++)
11611 if ((idx =
dof_map[o++]) < 0)
11613 idx = -1 - idx, s = -1;
11620 shape(idx,1) = s*shape_cx(i)*shape_oy(j)*shape_cz(k);
11624 for (
int k = 0; k <
p; k++)
11625 for (
int j = 0; j <=
p; j++)
11626 for (
int i = 0; i <=
p; i++)
11629 if ((idx =
dof_map[o++]) < 0)
11631 idx = -1 - idx, s = -1;
11639 shape(idx,2) = s*shape_cx(i)*shape_cy(j)*shape_oz(k);
11646 const int p =
order;
11648 #ifdef MFEM_THREAD_SAFE
11649 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11650 Vector shape_cz(p + 1), shape_oz(p);
11651 Vector dshape_cx(p + 1), dshape_cy(p + 1), dshape_cz(p + 1);
11663 for (
int k = 0; k <=
p; k++)
11664 for (
int j = 0; j <=
p; j++)
11665 for (
int i = 0; i <
p; i++)
11668 if ((idx =
dof_map[o++]) < 0)
11670 idx = -1 - idx, s = -1;
11676 curl_shape(idx,0) = 0.;
11677 curl_shape(idx,1) = s*shape_ox(i)* shape_cy(j)*dshape_cz(k);
11678 curl_shape(idx,2) = -s*shape_ox(i)*dshape_cy(j)* shape_cz(k);
11681 for (
int k = 0; k <=
p; k++)
11682 for (
int j = 0; j <
p; j++)
11683 for (
int i = 0; i <=
p; i++)
11686 if ((idx =
dof_map[o++]) < 0)
11688 idx = -1 - idx, s = -1;
11694 curl_shape(idx,0) = -s* shape_cx(i)*shape_oy(j)*dshape_cz(k);
11695 curl_shape(idx,1) = 0.;
11696 curl_shape(idx,2) = s*dshape_cx(i)*shape_oy(j)* shape_cz(k);
11699 for (
int k = 0; k <
p; k++)
11700 for (
int j = 0; j <=
p; j++)
11701 for (
int i = 0; i <=
p; i++)
11704 if ((idx =
dof_map[o++]) < 0)
11706 idx = -1 - idx, s = -1;
11712 curl_shape(idx,0) = s* shape_cx(i)*dshape_cy(j)*shape_oz(k);
11713 curl_shape(idx,1) = -s*dshape_cx(i)* shape_cy(j)*shape_oz(k);
11714 curl_shape(idx,2) = 0.;
11739 const bool closed)
const
11744 i < (closed ?
dof2quad_array.Size() : dof2quad_array_open.Size());
11748 if (d2q.
IntRule == &ir && d2q.
mode == mode) {
return d2q; }
11752 const int ndof = closed ?
order + 1 :
order;
11753 const int nqpt = (int)floor(pow(ir.
GetNPoints(), 1.0/
dim) + 0.5);
11763 Vector val(ndof), grad(ndof);
11764 for (
int i = 0; i < nqpt; i++)
11778 for (
int j = 0; j < ndof; j++)
11780 d2q->
B[i+nqpt*j] = d2q->
Bt[j+ndof*i] = val(j);
11781 d2q->
G[i+nqpt*j] = d2q->
Gt[j+ndof*i] = grad(j);
11791 dof2quad_array_open.Append(d2q);
11799 for (
int i = 0; i < dof2quad_array_open.Size(); i++)
11801 delete dof2quad_array_open[i];
11805 const double ND_QuadrilateralElement::tk[8] =
11806 { 1.,0., 0.,1., -1.,0., 0.,-1. };
11819 const int dof2 =
dof/2;
11821 #ifndef MFEM_THREAD_SAFE
11832 for (
int i = 0; i <
p; i++)
11836 for (
int j = 0; j <
p; j++)
11838 dof_map[1*dof2 + p + j*(p + 1)] = o++;
11840 for (
int i = 0; i <
p; i++)
11842 dof_map[0*dof2 + (p - 1 - i) + p*p] = -1 - (o++);
11844 for (
int j = 0; j <
p; j++)
11846 dof_map[1*dof2 + 0 + (p - 1 - j)*(p + 1)] = -1 - (o++);
11851 for (
int j = 1; j <
p; j++)
11852 for (
int i = 0; i <
p; i++)
11857 for (
int j = 0; j <
p; j++)
11858 for (
int i = 1; i <
p; i++)
11860 dof_map[1*dof2 + i + j*(p + 1)] = o++;
11866 for (
int j = 0; j <=
p; j++)
11867 for (
int i = 0; i <
p; i++)
11870 if ((idx =
dof_map[o++]) < 0)
11872 dof2tk[idx = -1 - idx] = 2;
11881 for (
int j = 0; j <
p; j++)
11882 for (
int i = 0; i <=
p; i++)
11885 if ((idx =
dof_map[o++]) < 0)
11887 dof2tk[idx = -1 - idx] = 3;
11900 const int p =
order;
11902 #ifdef MFEM_THREAD_SAFE
11903 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11913 for (
int j = 0; j <=
p; j++)
11914 for (
int i = 0; i <
p; i++)
11917 if ((idx =
dof_map[o++]) < 0)
11919 idx = -1 - idx, s = -1;
11925 shape(idx,0) = s*shape_ox(i)*shape_cy(j);
11929 for (
int j = 0; j <
p; j++)
11930 for (
int i = 0; i <=
p; i++)
11933 if ((idx =
dof_map[o++]) < 0)
11935 idx = -1 - idx, s = -1;
11942 shape(idx,1) = s*shape_cx(i)*shape_oy(j);
11949 const int p =
order;
11951 #ifdef MFEM_THREAD_SAFE
11952 Vector shape_cx(p + 1), shape_ox(p), shape_cy(p + 1), shape_oy(p);
11953 Vector dshape_cx(p + 1), dshape_cy(p + 1);
11963 for (
int j = 0; j <=
p; j++)
11964 for (
int i = 0; i <
p; i++)
11967 if ((idx =
dof_map[o++]) < 0)
11969 idx = -1 - idx, s = -1;
11975 curl_shape(idx,0) = -s*shape_ox(i)*dshape_cy(j);
11978 for (
int j = 0; j <
p; j++)
11979 for (
int i = 0; i <=
p; i++)
11982 if ((idx =
dof_map[o++]) < 0)
11984 idx = -1 - idx, s = -1;
11990 curl_shape(idx,0) = s*dshape_cx(i)*shape_oy(j);
11995 const double ND_TetrahedronElement::tk[18] =
11996 { 1.,0.,0., 0.,1.,0., 0.,0.,1., -1.,1.,0., -1.,0.,1., 0.,-1.,1. };
11998 const double ND_TetrahedronElement::c = 1./4.;
12008 const int pm1 = p - 1, pm2 = p - 2, pm3 = p - 3;
12010 #ifndef MFEM_THREAD_SAFE
12021 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12026 for (
int i = 0; i <
p; i++)
12031 for (
int i = 0; i <
p; i++)
12036 for (
int i = 0; i <
p; i++)
12041 for (
int i = 0; i <
p; i++)
12046 for (
int i = 0; i <
p; i++)
12051 for (
int i = 0; i <
p; i++)
12058 for (
int j = 0; j <= pm2; j++)
12059 for (
int i = 0; i + j <= pm2; i++)
12061 double w = fop[i] + fop[j] + fop[pm2-i-j];
12067 for (
int j = 0; j <= pm2; j++)
12068 for (
int i = 0; i + j <= pm2; i++)
12070 double w = fop[i] + fop[j] + fop[pm2-i-j];
12076 for (
int j = 0; j <= pm2; j++)
12077 for (
int i = 0; i + j <= pm2; i++)
12079 double w = fop[i] + fop[j] + fop[pm2-i-j];
12085 for (
int j = 0; j <= pm2; j++)
12086 for (
int i = 0; i + j <= pm2; i++)
12088 double w = fop[i] + fop[j] + fop[pm2-i-j];
12096 for (
int k = 0; k <= pm3; k++)
12097 for (
int j = 0; j + k <= pm3; j++)
12098 for (
int i = 0; i + j + k <= pm3; i++)
12100 double w = iop[i] + iop[j] + iop[k] + iop[pm3-i-j-k];
12110 for (
int m = 0; m <
dof; m++)
12113 const double *tm = tk + 3*dof2tk[m];
12121 for (
int k = 0; k <= pm1; k++)
12122 for (
int j = 0; j + k <= pm1; j++)
12123 for (
int i = 0; i + j + k <= pm1; i++)
12125 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
12126 T(o++, m) = s * tm[0];
12127 T(o++, m) = s * tm[1];
12128 T(o++, m) = s * tm[2];
12130 for (
int k = 0; k <= pm1; k++)
12131 for (
int j = 0; j + k <= pm1; j++)
12133 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
12134 T(o++, m) = s*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
12135 T(o++, m) = s*((ip.
z - c)*tm[0] - (ip.
x - c)*tm[2]);
12137 for (
int k = 0; k <= pm1; k++)
12140 shape_y(pm1-k)*shape_z(k)*((ip.
z - c)*tm[1] - (ip.
y - c)*tm[2]);
12151 const int pm1 =
order - 1;
12153 #ifdef MFEM_THREAD_SAFE
12154 const int p =
order;
12155 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12165 for (
int k = 0; k <= pm1; k++)
12166 for (
int j = 0; j + k <= pm1; j++)
12167 for (
int i = 0; i + j + k <= pm1; i++)
12169 double s = shape_x(i)*shape_y(j)*shape_z(k)*shape_l(pm1-i-j-k);
12170 u(n,0) = s; u(n,1) = 0.; u(n,2) = 0.; n++;
12171 u(n,0) = 0.; u(n,1) = s; u(n,2) = 0.; n++;
12172 u(n,0) = 0.; u(n,1) = 0.; u(n,2) = s; n++;
12174 for (
int k = 0; k <= pm1; k++)
12175 for (
int j = 0; j + k <= pm1; j++)
12177 double s = shape_x(pm1-j-k)*shape_y(j)*shape_z(k);
12178 u(n,0) = s*(ip.
y - c); u(n,1) = -s*(ip.
x - c); u(n,2) = 0.; n++;
12179 u(n,0) = s*(ip.
z - c); u(n,1) = 0.; u(n,2) = -s*(ip.
x - c); n++;
12181 for (
int k = 0; k <= pm1; k++)
12183 double s = shape_y(pm1-k)*shape_z(k);
12184 u(n,0) = 0.; u(n,1) = s*(ip.
z - c); u(n,2) = -s*(ip.
y - c); n++;
12193 const int pm1 =
order - 1;
12195 #ifdef MFEM_THREAD_SAFE
12196 const int p =
order;
12197 Vector shape_x(p), shape_y(p), shape_z(p), shape_l(p);
12198 Vector dshape_x(p), dshape_y(p), dshape_z(p), dshape_l(p);
12208 for (
int k = 0; k <= pm1; k++)
12209 for (
int j = 0; j + k <= pm1; j++)
12210 for (
int i = 0; i + j + k <= pm1; i++)
12213 const double dx = (dshape_x(i)*shape_l(l) -
12214 shape_x(i)*dshape_l(l))*shape_y(j)*shape_z(k);
12215 const double dy = (dshape_y(j)*shape_l(l) -
12216 shape_y(j)*dshape_l(l))*shape_x(i)*shape_z(k);
12217 const double dz = (dshape_z(k)*shape_l(l) -
12218 shape_z(k)*dshape_l(l))*shape_x(i)*shape_y(j);
12220 u(n,0) = 0.; u(n,1) = dz; u(n,2) = -dy; n++;
12221 u(n,0) = -dz; u(n,1) = 0.; u(n,2) = dx; n++;
12222 u(n,0) = dy; u(n,1) = -dx; u(n,2) = 0.; n++;
12224 for (
int k = 0; k <= pm1; k++)
12225 for (
int j = 0; j + k <= pm1; j++)
12227 int i = pm1 - j - k;
12230 u(n,0) = shape_x(i)*(ip.
x - c)*shape_y(j)*dshape_z(k);
12231 u(n,1) = shape_x(i)*shape_y(j)*(ip.
y - c)*dshape_z(k);
12233 -((dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k) +
12234 (dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_x(i)*shape_z(k));
12237 u(n,0) = -shape_x(i)*(ip.
x - c)*dshape_y(j)*shape_z(k);
12238 u(n,1) = (shape_x(i)*shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)) +
12239 (dshape_x(i)*(ip.
x - c) + shape_x(i))*shape_y(j)*shape_z(k));
12240 u(n,2) = -shape_x(i)*dshape_y(j)*shape_z(k)*(ip.
z - c);
12243 for (
int k = 0; k <= pm1; k++)
12247 u(n,0) = -((dshape_y(j)*(ip.
y - c) + shape_y(j))*shape_z(k) +
12248 shape_y(j)*(dshape_z(k)*(ip.
z - c) + shape_z(k)));
12253 Ti.
Mult(u, curl_shape);
12257 const double ND_TriangleElement::tk[8] =
12258 { 1.,0., -1.,1., 0.,-1., 0.,1. };
12260 const double ND_TriangleElement::c = 1./3.;
12270 const int pm1 = p - 1, pm2 = p - 2;
12272 #ifndef MFEM_THREAD_SAFE
12282 Vector shape_x(p), shape_y(p), shape_l(p);
12287 for (
int i = 0; i <
p; i++)
12292 for (
int i = 0; i <
p; i++)
12297 for (
int i = 0; i <
p; i++)
12304 for (
int j = 0; j <= pm2; j++)
12305 for (
int i = 0; i + j <= pm2; i++)
12307 double w = iop[i] + iop[j] + iop[pm2-i-j];
12315 for (
int m = 0; m <
dof; m++)
12318 const double *tm = tk + 2*dof2tk[m];
12325 for (
int j = 0; j <= pm1; j++)
12326 for (
int i = 0; i + j <= pm1; i++)
12328 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
12329 T(n++, m) = s * tm[0];
12330 T(n++, m) = s * tm[1];
12332 for (
int j = 0; j <= pm1; j++)
12335 shape_x(pm1-j)*shape_y(j)*((ip.
y - c)*tm[0] - (ip.
x - c)*tm[1]);
12346 const int pm1 =
order - 1;
12348 #ifdef MFEM_THREAD_SAFE
12349 const int p =
order;
12350 Vector shape_x(p), shape_y(p), shape_l(p);
12359 for (
int j = 0; j <= pm1; j++)
12360 for (
int i = 0; i + j <= pm1; i++)
12362 double s = shape_x(i)*shape_y(j)*shape_l(pm1-i-j);
12363 u(n,0) = s; u(n,1) = 0; n++;
12364 u(n,0) = 0; u(n,1) = s; n++;
12366 for (
int j = 0; j <= pm1; j++)
12368 double s = shape_x(pm1-j)*shape_y(j);
12369 u(n,0) = s*(ip.
y - c);
12370 u(n,1) = -s*(ip.
x - c);
12380 const int pm1 =
order - 1;
12382 #ifdef MFEM_THREAD_SAFE
12383 const int p =
order;
12384 Vector shape_x(p), shape_y(p), shape_l(p);
12385 Vector dshape_x(p), dshape_y(p), dshape_l(p);
12394 for (
int j = 0; j <= pm1; j++)
12395 for (
int i = 0; i + j <= pm1; i++)
12398 const double dx = (dshape_x(i)*shape_l(l) -
12399 shape_x(i)*dshape_l(l)) * shape_y(j);
12400 const double dy = (dshape_y(j)*shape_l(l) -
12401 shape_y(j)*dshape_l(l)) * shape_x(i);
12407 for (
int j = 0; j <= pm1; j++)
12411 curlu(n++) = -((dshape_x(i)*(ip.
x - c) + shape_x(i)) * shape_y(j) +
12412 (dshape_y(j)*(ip.
y - c) + shape_y(j)) * shape_x(i));
12416 Ti.
Mult(curlu, curl2d);
12420 const double ND_SegmentElement::tk[1] = { 1. };
12425 obasis1d(
poly1d.GetBasis(p - 1, VerifyOpen(ob_type))),
12431 for (
int i = 0; i <
p; i++)
12458 kv[0]->CalcShape(shape,
ijk[0], ip.
x);
12461 for (
int i = 0; i <=
order; i++)
12463 sum += (shape(i) *=
weights(i));
12475 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
12477 double sum = 0.0, dsum = 0.0;
12478 for (
int i = 0; i <=
order; i++)
12481 dsum += ( grad(i) *=
weights(i));
12485 add(sum, grad, -dsum*sum*sum,
shape_x, grad);
12495 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
12496 kv[0]->CalcD2Shape(hess,
ijk[0], ip.
x);
12498 double sum = 0.0, dsum = 0.0, d2sum = 0.0;
12499 for (
int i = 0; i <=
order; i++)
12502 dsum += ( grad(i) *=
weights(i));
12503 d2sum += ( hess(i) *=
weights(i));
12507 add(sum, hess, -2*dsum*sum*sum, grad, hess);
12508 add(1.0, hess, (-d2sum + 2*dsum*dsum*sum)*sum*sum,
shape_x, hess);
12537 for (
int o = 0, j = 0; j <=
orders[1]; j++)
12539 const double sy =
shape_y(j);
12540 for (
int i = 0; i <=
orders[0]; i++, o++)
12552 double sum, dsum[2];
12560 sum = dsum[0] = dsum[1] = 0.0;
12561 for (
int o = 0, j = 0; j <=
orders[1]; j++)
12564 for (
int i = 0; i <=
orders[0]; i++, o++)
12574 dsum[0] *= sum*sum;
12575 dsum[1] *= sum*sum;
12577 for (
int o = 0; o <
dof; o++)
12579 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
12580 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
12587 double sum, dsum[2], d2sum[3];
12598 sum = dsum[0] = dsum[1] = 0.0;
12599 d2sum[0] = d2sum[1] = d2sum[2] = 0.0;
12600 for (
int o = 0, j = 0; j <=
orders[1]; j++)
12603 for (
int i = 0; i <=
orders[0]; i++, o++)
12606 sum += (
u(o) = sx*sy*
weights(o) );
12608 dsum[0] += (
du(o,0) = dsx*sy*
weights(o) );
12609 dsum[1] += (
du(o,1) = sx*dsy*
weights(o) );
12611 d2sum[0] += ( hessian(o,0) = d2sx*sy*
weights(o) );
12612 d2sum[1] += ( hessian(o,1) = dsx*dsy*
weights(o) );
12613 d2sum[2] += ( hessian(o,2) = sx*d2sy*
weights(o) );
12625 for (
int o = 0; o <
dof; o++)
12627 hessian(o,0) = hessian(o,0)*sum
12628 - 2*
du(o,0)*sum*dsum[0]
12629 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
12631 hessian(o,1) = hessian(o,1)*sum
12632 -
du(o,0)*sum*dsum[1]
12633 -
du(o,1)*sum*dsum[0]
12634 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
12636 hessian(o,2) = hessian(o,2)*sum
12637 - 2*
du(o,1)*sum*dsum[1]
12638 + u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[2]);
12675 for (
int o = 0, k = 0; k <=
orders[2]; k++)
12677 const double sz =
shape_z(k);
12678 for (
int j = 0; j <=
orders[1]; j++)
12680 const double sy_sz =
shape_y(j)*sz;
12681 for (
int i = 0; i <=
orders[0]; i++, o++)
12694 double sum, dsum[3];
12704 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
12705 for (
int o = 0, k = 0; k <=
orders[2]; k++)
12708 for (
int j = 0; j <=
orders[1]; j++)
12710 const double sy_sz =
shape_y(j)* sz;
12711 const double dsy_sz =
dshape_y(j)* sz;
12712 const double sy_dsz =
shape_y(j)*dsz;
12713 for (
int i = 0; i <=
orders[0]; i++, o++)
12725 dsum[0] *= sum*sum;
12726 dsum[1] *= sum*sum;
12727 dsum[2] *= sum*sum;
12729 for (
int o = 0; o <
dof; o++)
12731 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
12732 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
12733 dshape(o,2) = dshape(o,2)*sum -
u(o)*dsum[2];
12740 double sum, dsum[3], d2sum[6];
12754 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
12755 d2sum[0] = d2sum[1] = d2sum[2] = d2sum[3] = d2sum[4] = d2sum[5] = 0.0;
12757 for (
int o = 0, k = 0; k <=
orders[2]; k++)
12760 for (
int j = 0; j <=
orders[1]; j++)
12763 for (
int i = 0; i <=
orders[0]; i++, o++)
12766 sum += (
u(o) = sx*sy*sz*
weights(o) );
12768 dsum[0] += (
du(o,0) = dsx*sy*sz*
weights(o) );
12769 dsum[1] += (
du(o,1) = sx*dsy*sz*
weights(o) );
12770 dsum[2] += (
du(o,2) = sx*sy*dsz*
weights(o) );
12772 d2sum[0] += ( hessian(o,0) = d2sx*sy*sz*
weights(o) );
12773 d2sum[1] += ( hessian(o,1) = dsx*dsy*sz*
weights(o) );
12774 d2sum[2] += ( hessian(o,2) = dsx*sy*dsz*
weights(o) );
12776 d2sum[3] += ( hessian(o,3) = sx*dsy*dsz*
weights(o) );
12778 d2sum[4] += ( hessian(o,4) = sx*sy*d2sz*
weights(o) );
12779 d2sum[5] += ( hessian(o,5) = sx*d2sy*sz*
weights(o) );
12797 for (
int o = 0; o <
dof; o++)
12799 hessian(o,0) = hessian(o,0)*sum
12800 - 2*
du(o,0)*sum*dsum[0]
12801 + u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
12803 hessian(o,1) = hessian(o,1)*sum
12804 -
du(o,0)*sum*dsum[1]
12805 -
du(o,1)*sum*dsum[0]
12806 + u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
12808 hessian(o,2) = hessian(o,2)*sum
12809 -
du(o,0)*sum*dsum[2]
12810 -
du(o,2)*sum*dsum[0]
12811 + u[o]*sum*(2*dsum[0]*dsum[2] - d2sum[2]);
12813 hessian(o,3) = hessian(o,3)*sum
12814 -
du(o,1)*sum*dsum[2]
12815 -
du(o,2)*sum*dsum[1]
12816 + u[o]*sum*(2*dsum[1]*dsum[2] - d2sum[3]);
12818 hessian(o,4) = hessian(o,4)*sum
12819 - 2*
du(o,2)*sum*dsum[2]
12820 + u[o]*sum*(2*dsum[2]*dsum[2] - d2sum[4]);
12822 hessian(o,5) = hessian(o,5)*sum
12823 - 2*
du(o,1)*sum*dsum[1]
12824 + u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[5]);
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for all finite elements.
RefinedLinear3DFiniteElement()
Construct the RefinedLinear3DFiniteElement.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
void Set(const double *p, const int dim)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void MultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
Multiply a matrix A with the transpose of a matrix B: A*Bt.
RT0TriangleFiniteElement()
Construct the RT0TriangleFiniteElement.
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the ND_SegmentElement of order p and open BasisType ob_type.
int Size() const
Return the logical size of the array.
void Get(double *p, const int dim) const
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
RT2TriangleFiniteElement()
Construct the RT2TriangleFiniteElement.
int GetDim() const
Returns the reference space dimension for the finite element.
GaussQuad2DFiniteElement()
Construct the GaussQuad2DFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
void trans(const Vector &u, Vector &x)
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Class for an integration rule - an Array of IntegrationPoint.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
L2Pos_WedgeElement(const int p)
Construct the L2Pos_WedgeElement of order p.
CrouzeixRaviartQuadFiniteElement()
Construct the CrouzeixRaviartQuadFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
P2SegmentFiniteElement()
Construct the P2SegmentFiniteElement.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Linear3DFiniteElement()
Construct the Linear3DFiniteElement.
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
virtual void CalcPhysLinLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
static double CalcDelta(const int p, const double x)
Evaluate a representation of a Delta function at point x.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
RT1TriangleFiniteElement()
Construct the RT1TriangleFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Project the rows of the matrix coefficient in an RT space.
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Project the rows of the matrix coefficient in an ND space.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
RefinedBiLinear2DFiniteElement()
Construct the RefinedBiLinear2DFiniteElement.
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
NodalTensorFiniteElement(const int dims, const int p, const int btype, const DofMapType dmtype)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
L2Pos_TriangleElement(const int p)
Construct the L2Pos_TriangleElement of order p.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
H1Pos_SegmentElement(const int p)
Construct the H1Pos_SegmentElement of order p.
Basis(const int p, const double *nodes, EvalType etype=Barycentric)
Create a nodal or positive (Bernstein) basis.
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Base class for vector Coefficients that optionally depend on time and space.
void SetRow(int r, const double *row)
void InvRightScaling(const Vector &s)
InvRightScaling: this = this * diag(1./s);.
virtual void CalcPhysHessian(ElementTransformation &Trans, DenseMatrix &Hessian) const
Evaluate the Hessian of all shape functions of a scalar finite element in reference space at the give...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Array< const KnotVector * > kv
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in physical space at the po...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual function which evaluates the values of all shape functions at a given point ip and stores the...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
void GivePolyPoints(const int np, double *pts, const int type)
Class for finite elements utilizing the always positive Bernstein basis.
L2Pos_TetrahedronElement(const int p)
Construct the L2Pos_TetrahedronElement of order p.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
PointFiniteElement()
Construct the PointFiniteElement.
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
void SetSize(int s)
Resize the vector to size s.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
virtual void CalcPhysLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
Evaluate the Laplacian of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Compute the Hessian of second order partial derivatives at ip.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
FiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Construct FiniteElement with given.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
H1Pos_SegmentElement SegmentFE
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
H1Pos_TetrahedronElement(const int p)
Construct the H1Pos_TetrahedronElement of order p.
int dim
Dimension of reference space.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
double InnerProduct(const double *x, const double *y) const
Compute y^t A x.
LagrangeHexFiniteElement(int degree)
Construct the LagrangeHexFiniteElement with the provided degree.
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_SegmentElement of order p and BasisType btype.
BiQuadPos2DFiniteElement()
Construct the BiQuadPos2DFiniteElement.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Data type dense matrix using column-major storage.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
GaussBiQuad2DFiniteElement()
Construct the GaussBiQuad2DFiniteElement.
int Size() const
Returns the size of the vector.
Array< double > Gt
Transpose of G.
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number...
~VectorTensorFiniteElement()
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
RefinedTriLinear3DFiniteElement()
Construct the RefinedTriLinear3DFiniteElement.
P0QuadFiniteElement()
Construct the P0QuadFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Quadratic3DFiniteElement()
Construct the Quadratic3DFiniteElement.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
void Factor()
Factor the current DenseMatrix, *a.
Geometry::Type geom_type
Geometry::Type of the reference element.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Intermediate class for finite elements whose basis functions return vector values.
static void CalcLegendre(const int p, const double x, double *u)
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get the matrix I that defines nodal interpolation between this element and the refined element fine_f...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
const IntegrationPoint & GetCenter(int GeomType)
Return the center of the given Geometry::Type, GeomType.
RT1HexFiniteElement()
Construct the RT1HexFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
H1Pos_HexahedronElement(const int p)
Construct the H1Pos_HexahedronElement of order p.
RT0QuadFiniteElement()
Construct the RT0QuadFiniteElement.
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
double * GetData() const
Return a pointer to the beginning of the Vector data.
RT1QuadFiniteElement()
Construct the RT1QuadFiniteElement.
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
const DofToQuad & GetTensorDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode, const bool closed) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Linear2DFiniteElement()
Construct the Linear2DFiniteElement.
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Get coordinates of a closed (GaussLegendre) set of points if degree p.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Possible basis types. Note that not all elements can use all BasisType(s).
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
void add(const Vector &v1, const Vector &v2, Vector &v)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Cubic2DFiniteElement()
Construct the Cubic2DFiniteElement.
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_HexahedronElement of order p and BasisType btype.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
L2Pos_HexahedronElement(const int p)
Construct the L2Pos_HexahedronElement of order p.
ND_TriangleElement(const int p)
Construct the ND_TriangleElement of order p.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
static void CalcBasis(const int p, const double x, double *u)
Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degre...
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
int GetHeight() const
Get the height of the matrix.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
static void CalcBinomTerms(const int p, const double x, const double y, double *u)
Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocate...
const double * GetPoints(const int p, const int btype)
Get the coordinates of the points of the given BasisType, btype.
H1Pos_TriangleElement(const int p)
Construct the H1Pos_TriangleElement of order p.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Poly_1D::Basis & obasis1d
Cubic3DFiniteElement()
Construct the Cubic3DFiniteElement.
Linear1DFiniteElement()
Construct the Linear1DFiniteElement.
A 1D element with uniform nodes.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
RT0HexFiniteElement()
Construct the RT0HexFiniteElement.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Class for standard nodal finite elements.
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
CrouzeixRaviartFiniteElement()
Construct the CrouzeixRaviartFiniteElement.
static void CalcShape(const int p, const double x, const double y, double *shape)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
VectorTensorFiniteElement(const int dims, const int d, const int p, const int cbtype, const int obtype, const int M, const DofMapType dmtype)
Class for finite elements with basis functions that return scalar values.
void SetSize(int m, int n)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat)
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void CalcAdjugateTranspose(const DenseMatrix &a, DenseMatrix &adjat)
Calculate the transposed adjugate of a matrix (for NxN matrices, N=1,2,3)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Poly_1D::Basis & cbasis1d
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
RefinedLinear1DFiniteElement()
Construct the RefinedLinear1DFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_HexahedronElement of order p and closed and open BasisType cb_type and ob_type...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
static void ChebyshevPoints(const int p, double *x)
Compute the points for the Chebyshev polynomials of order p and place them in the already allocated x...
void AddMult_a_VWt(const double a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
Cubic1DFiniteElement()
Construct the Cubic1DFiniteElement.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
H1Pos_WedgeElement(const int p)
Construct the H1Pos_WedgeElement of order p.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
ND_TetrahedronElement(const int p)
Construct the ND_TetrahedronElement of order p.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Nedelec1TetFiniteElement()
Construct the Nedelec1TetFiniteElement.
RT2QuadFiniteElement()
Construct the RT2QuadFiniteElement.
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
H1_QuadrilateralElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_QuadrilateralElement of order p and BasisType btype.
GaussLinear2DFiniteElement()
Construct the GaussLinear2DFiniteElement.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void Invert()
Replaces the current matrix with its inverse.
class FiniteElement * FE
The FiniteElement that created and owns this object.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
static int VerifyOpen(int b_type)
Ensure that the BasisType of b_type is open (doesn't have Quadrature1D points on the boundary)...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
L2Pos_QuadrilateralElement(const int p)
Construct the L2Pos_QuadrilateralElement of order p.
P1TetNonConfFiniteElement()
Construct the P1TetNonConfFiniteElement.
P0SegmentFiniteElement(int Ord=0)
Construct the P0SegmentFiniteElement with dummy order Ord.
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void AddMult_a_VVt(const double a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
A 3D linear element on a tetrahedron with nodes at the vertices of the tetrahedron.
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_SegmentElement of order p and BasisType btype.
Nedelec1HexFiniteElement()
Construct the Nedelec1HexFiniteElement.
int orders[Geometry::MaxDim]
Anisotropic orders.
void Set2(const double x1, const double x2)
virtual ~FiniteElement()
Deconstruct the FiniteElement.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
A 2D linear element on triangle with nodes at the vertices of the triangle.
int GetVDim()
Returns dimension of the vector.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_QuadrilateralElement of order p and BasisType btype.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void GetColumn(int c, Vector &col) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual function which evaluates the values of all partial derivatives of all shape functions at a gi...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Get coordinates of an open (GaussLegendre) set of points if degree p.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
class H1_WedgeElement WedgeFE
L2_WedgeElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_WedgeElement of order p and BasisType btype.
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Get matrix I "Interpolation" defined through local L2-projection in the space defined by the fine_fe...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_TetrahedronElement of order p and BasisType btype.
RT0TetFiniteElement()
Construct the RT0TetFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Threshold(double eps)
Replace small entries, abs(a_ij) <= eps, with zero.
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Set3(const double x1, const double x2, const double x3)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Array< double > Bt
Transpose of B.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
P0HexFiniteElement()
Construct the P0HexFiniteElement.
double * Data() const
Returns the matrix data array.
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
P1SegmentFiniteElement()
Construct the P1SegmentFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
void LocalInterpolation_ND(const VectorFiniteElement &cfe, const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
double p(const Vector &x, double t)
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
H1Pos_TriangleElement TriangleFE
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the ND_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
BiCubic2DFiniteElement()
Construct the BiCubic2DFiniteElement.
~LagrangeHexFiniteElement()
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
P0TetFiniteElement()
Construct the P0TetFiniteElement.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Base class for Matrix Coefficients that optionally depend on time and space.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void MultAAt(const DenseMatrix &a, DenseMatrix &aat)
Calculate the matrix A.At.
static const int * Binom(const int p)
Get a pointer to an array containing the binomial coefficients "p choose k" for k=0,...,p for the given p.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TetrahedronElement of order p and BasisType btype.
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
class Linear3DFiniteElement TetrahedronFE
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
L2Pos_TriangleElement TriangleFE
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Linear2DFiniteElement TriangleFE
A 2D bi-linear element on a square with nodes at the vertices of the square.
Array< double > B
Basis functions evaluated at quadrature points.
const Array< int > & GetDofMap() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
Quad1DFiniteElement()
Construct the Quad1DFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Get the dofs associated with the given face. *dofs is set to an internal array of the local dofc on t...
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
H1Pos_QuadrilateralElement(const int p)
Construct the H1Pos_QuadrilateralElement of order p.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void LocalRestriction_ND(const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &R) const
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_TriangleElement of order p and BasisType btype.
Class for integration point with weight.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
Full multidimensional representation which does not use tensor product structure. The ordering of the...
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
L2Pos_SegmentElement SegmentFE
const Poly_1D::Basis & GetBasis1D() const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
const DofToQuad & GetDofToQuadOpen(const IntegrationRule &ir, DofToQuad::Mode mode) const
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
int dof
Number of degrees of freedom.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
H1_WedgeElement(const int p, const int btype=BasisType::GaussLobatto)
Construct the H1_WedgeElement of order p and BasisType btype.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
static int VerifyClosed(int b_type)
Ensure that the BasisType of b_type is closed (has Quadrature1D points on the boundary).
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Implements CalcDivShape methods.
virtual void AssembleElementMatrix2(const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans, DenseMatrix &elmat)
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
RefinedLinear2DFiniteElement()
Construct the RefinedLinear2DFiniteElement.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Array< double > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
RT_TetrahedronElement(const int p)
Construct the RT_TetrahedronElement of order p.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
BiQuad2DFiniteElement()
Construct the BiQuad2DFiniteElement.
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Get the dofs associated with the given face. *dofs is set to an internal array of the local dofc on t...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
P0TriangleFiniteElement()
Construct the P0TriangleFiniteElement.
static int VerifyNodal(int b_type)
Ensure that the BasisType of b_type nodal (satisfies the interpolation property). ...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
H1Ser_QuadrilateralElement(const int p)
Construct the H1Ser_QuadrilateralElement of order p.
RT_TriangleElement(const int p)
Construct the RT_TriangleElement of order p.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
void Eval(const double x, Vector &u) const
L2Pos_SegmentElement(const int p)
Construct the L2Pos_SegmentElement of order p.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
void MultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
Multiply the transpose of a matrix A with a matrix B: At*B.
void InvertLinearTrans(ElementTransformation &trans, const IntegrationPoint &pt, Vector &x)
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void Mult(const double *x, double *y) const
Matrix vector multiplication.
static void CalcBernstein(const int p, const double x, double *u)
Compute the values of the Bernstein basis functions of order p at coordinate x and store the results ...
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Quad2DFiniteElement()
Construct the Quad2DFiniteElement.
int GetWidth() const
Get the width of the matrix.
void LocalRestriction_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &R) const
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
Describes the function space on each element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
void pts(int iphi, int t, double x[])
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
GaussBiLinear2DFiniteElement()
Construct the FiniteElement.
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_HexahedronElement of order p and closed and open BasisType cb_type and ob_type...
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Arbitrary order H1 elements in 3D on a wedge.
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
QuadPos1DFiniteElement()
Construct the QuadPos1DFiniteElement.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
P1OnQuadFiniteElement()
Construct the P1OnQuadFiniteElement.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
RotTriLinearHexFiniteElement()
Construct the RotTriLinearHexFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Project_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
double FNorm2() const
Compute the square of the Frobenius norm of the matrix.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Linear1DFiniteElement SegmentFE
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_HexahedronElement of order p and BasisType btype.
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
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)
Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p assuming t...
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
const IntegrationRule * IntRule
IntegrationRule that defines the quadrature points at which the basis functions of the FE are evaluat...
TriLinear3DFiniteElement()
Construct the TriLinear3DFiniteElement.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
const DofToQuad & GetTensorDofToQuad(const class TensorBasisElement &tb, const IntegrationRule &ir, DofToQuad::Mode mode) const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
L2_TriangleElement(const int p, const int btype=BasisType::GaussLegendre)
Construct the L2_TriangleElement of order p and BasisType btype.
int order
Order/degree of the shape functions.
BiLinear2DFiniteElement()
Construct the BiLinear2DFiniteElement.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Lagrange1DFiniteElement(int degree)
Construct the Lagrange1DFiniteElement with the provided degree.
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
No derivatives implemented.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
Implements CalcCurlShape methods.
virtual void ProjectDelta(int vertex, Vector &dofs) const
Project a delta function centered on the given vertex in the local finite dimensional space represent...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...