46 MFEM_VERIFY(
Jtr != NULL,
47 "Requires a target Jacobian, use SetTargetJacobian().");
56 const double cos_Jpr = (col1 * col2) / norm_prod,
57 sin_Jpr = fabs(Jpr.
Det()) / norm_prod;
62 const double cos_Jtr = (col1 * col2) / norm_prod,
63 sin_Jtr = fabs(
Jtr->
Det()) / norm_prod;
65 return 0.5 * (1.0 - cos_Jpr * cos_Jtr - sin_Jpr * sin_Jtr);
70 MFEM_VERIFY(
Jtr != NULL,
71 "Requires a target Jacobian, use SetTargetJacobian().");
80 double norm_c1 = col1.
Norml2(),
83 double cos_Jpr_12 = (col1 * col2) / (norm_c1 * norm_c2),
84 cos_Jpr_13 = (col1 * col3) / (norm_c1 * norm_c3),
85 cos_Jpr_23 = (col2 * col3) / (norm_c2 * norm_c3);
86 double sin_Jpr_12 = std::sqrt(1.0 - cos_Jpr_12 * cos_Jpr_12),
87 sin_Jpr_13 = std::sqrt(1.0 - cos_Jpr_13 * cos_Jpr_13),
88 sin_Jpr_23 = std::sqrt(1.0 - cos_Jpr_23 * cos_Jpr_23);
96 double cos_Jtr_12 = (col1 * col2) / (norm_c1 * norm_c2),
97 cos_Jtr_13 = (col1 * col3) / (norm_c1 * norm_c3),
98 cos_Jtr_23 = (col2 * col3) / (norm_c2 * norm_c3);
99 double sin_Jtr_12 = std::sqrt(1.0 - cos_Jtr_12 * cos_Jtr_12),
100 sin_Jtr_13 = std::sqrt(1.0 - cos_Jtr_13 * cos_Jtr_13),
101 sin_Jtr_23 = std::sqrt(1.0 - cos_Jtr_23 * cos_Jtr_23);
103 return (3.0 - cos_Jpr_12 * cos_Jtr_12 - sin_Jpr_12 * sin_Jtr_12
104 - cos_Jpr_13 * cos_Jtr_13 - sin_Jpr_13 * sin_Jtr_13
105 - cos_Jpr_23 * cos_Jtr_23 - sin_Jpr_23 * sin_Jtr_23) / 6.0;
110 MFEM_VERIFY(
Jtr != NULL,
111 "Requires a target Jacobian, use SetTargetJacobian().");
125 return 0.5 * (ratio_Jpr / ratio_Jtr + ratio_Jtr / ratio_Jpr) - 1.0;
130 MFEM_VERIFY(
Jtr != NULL,
131 "Requires a target Jacobian, use SetTargetJacobian().");
140 double norm_c1 = col1.
Norml2(),
143 double ratio_Jpr_1 = norm_c1 / std::sqrt(norm_c2 * norm_c3),
144 ratio_Jpr_2 = norm_c2 / std::sqrt(norm_c1 * norm_c3),
145 ratio_Jpr_3 = norm_c3 / std::sqrt(norm_c1 * norm_c2);
153 double ratio_Jtr_1 = norm_c1 / std::sqrt(norm_c2 * norm_c3),
154 ratio_Jtr_2 = norm_c2 / std::sqrt(norm_c1 * norm_c3),
155 ratio_Jtr_3 = norm_c3 / std::sqrt(norm_c1 * norm_c2);
157 return ( 0.5 * (ratio_Jpr_1 / ratio_Jtr_1 + ratio_Jtr_1 / ratio_Jpr_1) +
158 0.5 * (ratio_Jpr_2 / ratio_Jtr_2 + ratio_Jtr_2 / ratio_Jpr_2) +
159 0.5 * (ratio_Jpr_3 / ratio_Jtr_3 + ratio_Jtr_3 / ratio_Jpr_3) - 3.0
166 MFEM_VERIFY(
Jtr != NULL,
167 "Requires a target Jacobian, use SetTargetJacobian().");
171 Id(0,0) = 1; Id(0,1) = 0;
172 Id(1,0) = 0; Id(1,1) = 1;
234 const double c2 = weight*c1*c1;
312 const double c2 = weight*c1/2;
313 const double c3 = c1*c2;
329 return 0.5*I1b*I1b - 2.0;
387 return 0.5*(I2b + 1.0/I2b) - 1.0;
417 return I1b*(I1b - 1.0);
445 return 0.5*(I2*I2 + 1./(I2*I2) - 2.);
464 const double I2 =
ie.
Get_I2(), I2inv_sq = 1.0 / (I2 * I2);
472 MFEM_VERIFY(
Jtr != NULL,
473 "Requires a target Jacobian, use SetTargetJacobian().");
479 Id(0,0) = 1; Id(0,1) = 0;
480 Id(1,0) = 0; Id(1,1) = 1;
481 Id *= Mat.FNorm()/pow(2,0.5);
493 return (I2b - 1.0)*(I2b - 1.0) - I2b + std::sqrt(I2b*I2b +
eps);
498 MFEM_ABORT(
"Metric not implemented yet. Use metric mu_55 instead.");
506 MFEM_ABORT(
"Metric not implemented yet. Use metric mu_55 instead.");
514 return 0.5*(I2b - 1.0)*(I2b - 1.0)/(I2b -
tau0);
525 const double c = (I2b - 1.0)/(I2b -
tau0);
541 const double c0 = 1.0/(I2b -
tau0);
542 const double c = c0*(I2b - 1.0);
587 double d_I1b_I2b_data[9];
591 const double a = weight/(6*std::sqrt(I1b_I2b));
625 const double c1 = weight/9;
687 return 0.5*(I3b + 1.0/I3b) - 1.0;
750 const double c1 = weight*c0*c0;
751 const double c2 = -2*c0*c1;
765 return 0.5*(I3b - 1.0)*(I3b - 1.0)/(I3b -
tau0);
776 const double c = (I3b - 1.0)/(I3b -
tau0);
797 const double c0 = 1.0/(I3b -
tau0);
798 const double c = c0*(I3b - 1.0);
806 MFEM_VERIFY(
nodes,
"Nodes are not given!");
807 MFEM_ASSERT(
avg_volume == 0.0,
"The average volume is already computed!");
810 const int NE = mesh->
GetNE();
814 for (
int i = 0; i < NE; i++)
838 area_NE[0] = volume; area_NE[1] = NE;
839 MPI_Allreduce(area_NE, area_NE + 2, 2, MPI_DOUBLE, MPI_SUM,
comm);
855 default: MFEM_ABORT(
"TargetType not added to ContainsVolumeInfo.");
872 MFEM_ASSERT(Wideal.
Width() == Jtr.
SizeJ(),
"");
878 for (
int i = 0; i < ir.
GetNPoints(); i++) { Jtr(i) = Wideal; }
890 el_volume =
avg_volume / ncmesh->GetElementSizeReduction(e_id);
894 1./W.Height()), Wideal);
895 for (
int i = 0; i < ir.
GetNPoints(); i++) { Jtr(i) = W; }
918 const double det = Jtr(i).Det();
919 MFEM_VERIFY(det > 0.0,
"The given mesh is inverted!");
920 Jtr(i).Set(std::pow(det / detW, 1./dim), Wideal);
926 MFEM_ABORT(
"invalid target type!");
963 "Target type GIVEN_FULL requires a MatrixCoefficient.");
980 MFEM_ABORT(
"Incompatible target type for analytic adaptation!");
998 "Target type GIVEN_FULL requires a TMOPMatrixCoefficient.");
1000 for (
int d = 0; d < fe->
GetDim(); d++)
1013 MFEM_ABORT(
"Incompatible target type for analytic adaptation!");
1021 MFEM_VERIFY(
adapt_eval,
"SetAdaptivityEvaluator() has not been called!")
1022 MFEM_VERIFY(
ncomp > 0,
"No target specifications have been set!");
1040 dof_cnt = tspec_.
Size()/vdim;
1041 for (
int i = 0; i < dof_cnt*vdim; i++)
1043 tspec(i+idx*dof_cnt) = tspec_(i);
1093 dof_cnt = tspec_.
Size()/vdim;
1107 for (
int i = 0; i < tspec_temp.Size(); i++)
1109 tspec(i) = tspec_temp(i);
1112 for (
int i = 0; i < dof_cnt*vdim; i++)
1121 dof_cnt = tspec_.
Size()/vdim;
1122 for (
int i = 0; i < dof_cnt*vdim; i++)
1124 tspec(i+idx*dof_cnt) = tspec_(i);
1167 MFEM_VERIFY(
adapt_eval,
"SetAdaptivityEvaluator() has not been called!")
1168 MFEM_VERIFY(
ncomp > 0,
"No target specifications have been set!");
1193 MFEM_VERIFY(
tspec.
Size() > 0,
"Target specification is not set!");
1208 int dofidx,
int dir,
1211 MFEM_VERIFY(
tspec.
Size() > 0,
"Target specification is not set!");
1217 for (
int i = 0; i <
ncomp; i++)
1219 tspec(dofs[dofidx]+i*cnt) = IntData(dofs[dofidx] + i*cnt + dir*cnt*ncomp);
1226 MFEM_VERIFY(
tspec.
Size() > 0,
"Target specification is not set!");
1231 for (
int i = 0; i <
ncomp; i++)
1242 MFEM_VERIFY(
tspec_fesv,
"No target specifications have been set.");
1254 const int dim = Wideal.
Height(),
1256 ntspec_dofs = ndofs*
ncomp;
1258 Vector shape(ndofs), tspec_vals(ntspec_dofs), par_vals,
1259 par_vals_c1, par_vals_c2, par_vals_c3;
1266 for (
int q = 0; q < nqp; q++)
1271 for (
int d = 0; d < 4; d++)
1280 const double min_size = par_vals.
Min();
1281 MFEM_VERIFY(min_size > 0.0,
1282 "Non-positive size propagated in the target definition.");
1283 const double size = std::max(shape * par_vals, min_size);
1284 Jtr(q).Set(std::pow(size, 1.0/dim), Jtr(q));
1298 const double aspectratio = shape * par_vals;
1300 D_rho(0,0) = 1./pow(aspectratio,0.5);
1301 D_rho(1,1) = pow(aspectratio,0.5);
1311 const double rho1 = shape * par_vals_c1;
1312 const double rho2 = shape * par_vals_c2;
1313 const double rho3 = shape * par_vals_c3;
1315 D_rho(0,0) = pow(rho1,2./3.);
1316 D_rho(1,1) = pow(rho2,2./3.);
1317 D_rho(2,2) = pow(rho3,2./3.);
1322 Mult(D_rho, Temp, Jtr(q));
1332 const double skew = shape * par_vals;
1336 Q_phi(0,1) = cos(skew);
1337 Q_phi(1,1) = sin(skew);
1347 const double phi12 = shape * par_vals_c1;
1348 const double phi13 = shape * par_vals_c2;
1349 const double chi = shape * par_vals_c3;
1353 Q_phi(0,1) = cos(phi12);
1354 Q_phi(0,2) = cos(phi13);
1356 Q_phi(1,1) = sin(phi12);
1357 Q_phi(1,2) = sin(phi13)*cos(chi);
1359 Q_phi(2,2) = sin(phi13)*sin(chi);
1364 Mult(Q_phi, Temp, Jtr(q));
1374 const double theta = shape * par_vals;
1375 R_theta(0,0) = cos(theta);
1376 R_theta(0,1) = -sin(theta);
1377 R_theta(1,0) = sin(theta);
1378 R_theta(1,1) = cos(theta);
1388 const double theta = shape * par_vals_c1;
1389 const double psi = shape * par_vals_c2;
1390 const double beta = shape * par_vals_c3;
1392 double ct = cos(theta), st = sin(theta),
1393 cp = cos(psi), sp = sin(psi),
1394 cb = cos(beta), sb = sin(beta);
1397 R_theta(0,0) = ct*sp;
1398 R_theta(1,0) = st*sp;
1401 R_theta(0,1) = -st*cb + ct*cp*sb;
1402 R_theta(1,1) = ct*cb + st*cp*sb;
1403 R_theta(2,1) = -sp*sb;
1405 R_theta(0,0) = -st*sb - ct*cp*cb;
1406 R_theta(1,0) = ct*sb - st*cp*cb;
1407 R_theta(2,0) = sp*cb;
1410 Jtrcomp_q = R_theta;
1412 Mult(R_theta, Temp, Jtr(q));
1418 MFEM_ABORT(
"Incompatible target type for discrete adaptation!");
1429 MFEM_VERIFY(
tspec_fesv,
"No target specifications have been set.");
1444 ntspec_dofs = ndofs*
ncomp;
1446 Vector shape(ndofs), tspec_vals(ntspec_dofs), par_vals,
1447 par_vals_c1(ndofs), par_vals_c2(ndofs), par_vals_c3(ndofs);
1450 DenseMatrix dD_rho(dim), dQ_phi(dim), dR_theta(dim);
1457 grad_e_c2(ndofs, dim),
1458 grad_e_c3(ndofs, dim);
1459 Vector grad_ptr_c1(grad_e_c1.GetData(), ndofs*
dim),
1460 grad_ptr_c2(grad_e_c2.GetData(), ndofs*
dim),
1479 grad_phys.Mult(par_vals, grad_ptr_c1);
1482 grad_e_c1.MultTranspose(shape, grad_q);
1484 const double min_size = par_vals.
Min();
1485 MFEM_VERIFY(min_size > 0.0,
1486 "Non-positive size propagated in the target definition.");
1487 const double size = std::max(shape * par_vals, min_size);
1488 double dz_dsize = (1./
dim)*pow(size, 1./dim - 1.);
1490 Mult(Jtrcomp_q, Jtrcomp_d, work1);
1491 Mult(Jtrcomp_r, work1, work2);
1493 for (
int d = 0; d <
dim; d++)
1497 work1.
Set(dz_dsize, work1);
1499 AddMult(work1, work2, dJtr_i);
1512 grad_phys.Mult(par_vals, grad_ptr_c1);
1515 grad_e_c1.MultTranspose(shape, grad_q);
1517 const double aspectratio = shape * par_vals;
1519 dD_rho(0,0) = -0.5*pow(aspectratio,-1.5);
1520 dD_rho(1,1) = 0.5*pow(aspectratio,-0.5);
1522 Mult(Jtrcomp_s, Jtrcomp_r, work1);
1523 Mult(work1, Jtrcomp_q, work2);
1525 for (
int d = 0; d <
dim; d++)
1530 AddMult(work2, work1, dJtr_i);
1537 par_vals_c1.SetData(par_vals.
GetData());
1538 par_vals_c2.SetData(par_vals.
GetData()+ndofs);
1541 grad_phys.Mult(par_vals_c1, grad_ptr_c1);
1542 grad_phys.Mult(par_vals_c2, grad_ptr_c2);
1543 grad_phys.Mult(par_vals_c3, grad_ptr_c3);
1544 Vector grad_q1(dim), grad_q2(dim), grad_q3(dim);
1546 grad_e_c1.MultTranspose(shape, grad_q1);
1547 grad_e_c2.MultTranspose(shape, grad_q2);
1550 const double rho1 = shape * par_vals_c1;
1551 const double rho2 = shape * par_vals_c2;
1552 const double rho3 = shape * par_vals_c3;
1554 dD_rho(0,0) = (2./3.)*pow(rho1,-1./3.);
1555 dD_rho(1,1) = (2./3.)*pow(rho2,-1./3.);
1556 dD_rho(2,2) = (2./3.)*pow(rho3,-1./3.);
1558 Mult(Jtrcomp_s, Jtrcomp_r, work1);
1559 Mult(work1, Jtrcomp_q, work2);
1562 for (
int d = 0; d <
dim; d++)
1566 work1(0,0) *= grad_q1(d);
1567 work1(1,2) *= grad_q2(d);
1568 work1(2,2) *= grad_q3(d);
1570 AddMult(work2, work1, dJtr_i);
1582 grad_phys.Mult(par_vals, grad_ptr_c1);
1585 grad_e_c1.MultTranspose(shape, grad_q);
1587 const double skew = shape * par_vals;
1591 dQ_phi(0,1) = -sin(skew);
1592 dQ_phi(1,1) = cos(skew);
1594 Mult(Jtrcomp_s, Jtrcomp_r, work2);
1596 for (
int d = 0; d <
dim; d++)
1601 Mult(work1, Jtrcomp_d, work3);
1602 AddMult(work2, work3, dJtr_i);
1609 par_vals_c1.SetData(par_vals.
GetData());
1610 par_vals_c2.SetData(par_vals.
GetData()+ndofs);
1613 grad_phys.Mult(par_vals_c1, grad_ptr_c1);
1614 grad_phys.Mult(par_vals_c2, grad_ptr_c2);
1615 grad_phys.Mult(par_vals_c3, grad_ptr_c3);
1616 Vector grad_q1(dim), grad_q2(dim), grad_q3(dim);
1618 grad_e_c1.MultTranspose(shape, grad_q1);
1619 grad_e_c2.MultTranspose(shape, grad_q2);
1622 const double phi12 = shape * par_vals_c1;
1623 const double phi13 = shape * par_vals_c2;
1624 const double chi = shape * par_vals_c3;
1628 dQ_phi(0,1) = -sin(phi12);
1629 dQ_phi(1,1) = cos(phi12);
1632 dQ_phi13(0,2) = -sin(phi13);
1633 dQ_phi13(1,2) = cos(phi13)*cos(chi);
1634 dQ_phi13(2,2) = cos(phi13)*sin(chi);
1637 dQ_phichi(1,2) = -sin(phi13)*sin(chi);
1638 dQ_phichi(2,2) = sin(phi13)*cos(chi);
1640 Mult(Jtrcomp_s, Jtrcomp_r, work2);
1642 for (
int d = 0; d <
dim; d++)
1646 work1 *= grad_q1(d);
1647 work1.Add(grad_q2(d), dQ_phi13);
1648 work1.Add(grad_q3(d), dQ_phichi);
1649 Mult(work1, Jtrcomp_d, work3);
1650 AddMult(work2, work3, dJtr_i);
1662 grad_phys.Mult(par_vals, grad_ptr_c1);
1665 grad_e_c1.MultTranspose(shape, grad_q);
1667 const double theta = shape * par_vals;
1668 dR_theta(0,0) = -sin(theta);
1669 dR_theta(0,1) = -cos(theta);
1670 dR_theta(1,0) = cos(theta);
1671 dR_theta(1,1) = -sin(theta);
1673 Mult(Jtrcomp_q, Jtrcomp_d, work1);
1674 Mult(Jtrcomp_s, work1, work2);
1675 for (
int d = 0; d <
dim; d++)
1680 AddMult(work1, work2, dJtr_i);
1687 par_vals_c1.SetData(par_vals.
GetData());
1688 par_vals_c2.SetData(par_vals.
GetData()+ndofs);
1691 grad_phys.Mult(par_vals_c1, grad_ptr_c1);
1692 grad_phys.Mult(par_vals_c2, grad_ptr_c2);
1693 grad_phys.Mult(par_vals_c3, grad_ptr_c3);
1694 Vector grad_q1(dim), grad_q2(dim), grad_q3(dim);
1696 grad_e_c1.MultTranspose(shape, grad_q1);
1697 grad_e_c2.MultTranspose(shape, grad_q2);
1700 const double theta = shape * par_vals_c1;
1701 const double psi = shape * par_vals_c2;
1702 const double beta = shape * par_vals_c3;
1704 const double ct = cos(theta), st = sin(theta),
1705 cp = cos(psi), sp = sin(psi),
1706 cb = cos(beta), sb = sin(beta);
1709 dR_theta(0,0) = -st*sp;
1710 dR_theta(1,0) = ct*sp;
1713 dR_theta(0,1) = -ct*cb - st*cp*sb;
1714 dR_theta(1,1) = -st*cb + ct*cp*sb;
1717 dR_theta(0,0) = -ct*sb + st*cp*cb;
1718 dR_theta(1,0) = -st*sb - ct*cp*cb;
1726 dR_beta(0,1) = st*sb + ct*cp*cb;
1727 dR_beta(1,1) = -ct*sb + st*cp*cb;
1728 dR_beta(2,1) = -sp*cb;
1730 dR_beta(0,0) = -st*cb + ct*cp*sb;
1731 dR_beta(1,0) = ct*cb + st*cp*sb;
1735 dR_psi(0,0) = ct*cp;
1736 dR_psi(1,0) = st*cp;
1739 dR_psi(0,1) = 0. - ct*sp*sb;
1740 dR_psi(1,1) = 0. + st*sp*sb;
1741 dR_psi(2,1) = -cp*sb;
1743 dR_psi(0,0) = 0. + ct*sp*cb;
1744 dR_psi(1,0) = 0. + st*sp*cb;
1745 dR_psi(2,0) = cp*cb;
1747 Mult(Jtrcomp_q, Jtrcomp_d, work1);
1748 Mult(Jtrcomp_s, work1, work2);
1749 for (
int d = 0; d <
dim; d++)
1753 work1 *= grad_q1(d);
1754 work1.Add(grad_q2(d), dR_psi);
1755 work1.Add(grad_q3(d), dR_beta);
1756 AddMult(work1, work2, dJtr_i);
1764 MFEM_ABORT(
"Incompatible target type for discrete adaptation!");
1782 for (
int j = 0; j <
dim; j++)
1784 for (
int i = 0; i < cnt; i++) { xtemp(j*cnt+i) += dx; }
1789 for (
int i = 0; i < cnt; i++) { xtemp(j*cnt+i) -= dx; }
1796 double dx,
bool use_flag)
1803 totmix = 1+2*(dim-2);
1812 for (
int j = 0; j <
dim; j++)
1814 for (
int i = 0; i < cnt; i++) { xtemp(j*cnt+i) += 2*dx; }
1819 for (
int i = 0; i < cnt; i++) { xtemp(j*cnt+i) -= 2*dx; }
1824 for (
int k1 = 0; k1 <
dim; k1++)
1826 for (
int k2 = 0; (k1 != k2) && (k2 < dim); k2++)
1828 for (
int i = 0; i < cnt; i++)
1830 xtemp(k1*cnt+i) += dx;
1831 xtemp(k2*cnt+i) += dx;
1837 for (
int i = 0; i < cnt; i++)
1839 xtemp(k1*cnt+i) -= dx;
1840 xtemp(k2*cnt+i) -= dx;
1889 for (
int i = 0; i <
ElemDer.Size(); i++)
2020 if (adaptive_limiting)
2032 const double weight = ip.
weight * Jtr_i.
Det();
2050 if (adaptive_limiting)
2052 const double diff = zeta_q(i) - zeta0_q(i);
2056 energy += weight * val;
2119 Vector shape,
p, p0, d_vals, grad;
2136 d_vals.
SetSize(nqp); d_vals = 1.0;
2160 for (
int q = 0; q < nqp; q++)
2187 for (
int d = 0; d <
dim; d++)
2191 d_detW_dx(d) = dwdx.
Trace();
2198 for (
int d = 0; d <
dim; d++)
2203 Mult(Amat, work2, work1);
2205 d_Winv_dx(d) = work2.
Trace();
2207 d_Winv_dx *= -weight_m;
2209 d_detW_dx += d_Winv_dx;
2270 d_vals.
SetSize(nqp); d_vals = 1.0;
2286 for (
int q = 0; q < nqp; q++)
2312 for (
int i = 0; i < dof; i++)
2314 const double w_shape_i = weight_m * shape(i);
2315 for (
int j = 0; j < dof; j++)
2317 const double w = w_shape_i * shape(j);
2318 for (
int d1 = 0; d1 <
dim; d1++)
2320 for (
int d2 = 0; d2 <
dim; d2++)
2322 elmat(d1*dof + i, d2*dof + j) += w * grad_grad(d1, d2);
2341 if (
zeta == NULL) {
return; }
2344 Vector shape(dof), zeta_e, zeta_q, zeta0_q;
2358 grad_phys.
Mult(zeta_e, grad_ptr);
2362 const int nqp = weights.
Size();
2363 for (
int q = 0; q < nqp; q++)
2368 zeta_grad_q *= 2.0 * (zeta_q(q) - zeta0_q(q));
2380 if (
zeta == NULL) {
return; }
2383 Vector shape(dof), zeta_e, zeta_q, zeta0_q;
2397 grad_phys.
Mult(zeta_e, grad_ptr);
2402 Mult(grad_phys, zeta_grad_e, zeta_grad_grad_e);
2404 zeta_grad_grad_e.
SetSize(dof, dim*dim);
2409 const int nqp = weights.
Size();
2410 for (
int q = 0; q < nqp; q++)
2420 for (
int i = 0; i < dof *
dim; i++)
2422 const int idof = i % dof, idim = i / dof;
2423 for (
int j = 0; j <= i; j++)
2425 const int jdof = j % dof, jdim = j / dof;
2426 const double entry =
2427 w * ( 2.0 * zeta_grad_q(idim) * shape(idof) *
2428 zeta_grad_q(jdim) * shape(jdof) +
2429 2.0 * (zeta_q(q) - zeta0_q(q)) *
2430 zeta_grad_grad_q(idim, jdim) * shape(idof) * shape(jdof));
2432 if (i != j) { mat(j, i) += entry; }
2440 Vector &elfun,
const int dofidx,
2441 const int dir,
const double e_fx,
2445 int idx = dir*dof+dofidx;
2449 double dfdx = (e_fxph-e_fx)/
dx;
2483 for (
int j = 0; j <
dim; j++)
2485 for (
int i = 0; i < dof; i++)
2514 for (
int q = 0; q < nqp; q++)
2539 for (
int i = 0; i < dof; i++)
2541 for (
int j = 0; j < i+1; j++)
2543 for (
int k1 = 0; k1 <
dim; k1++)
2545 for (
int k2 = 0; k2 <
dim; k2++)
2547 elfunmod(k2*dof+j) +=
dx;
2574 double e_fx = ElemPertLoc(k2*dof+j);
2577 elfunmod(k2*dof+j) -=
dx;
2578 double e_fpx = ElemDerLoc(k1*dof+i);
2580 elmat(k1*dof+i, k2*dof+j) = (e_fpxph - e_fpx) /
dx;
2581 elmat(k2*dof+j, k1*dof+i) = (e_fpxph - e_fpx) /
dx;
2610 for (
int q = 0; q < nqp; q++)
2639 double &metric_energy,
2651 metric_energy = 0.0;
2653 for (
int i = 0; i < fes->
GetNE(); i++)
2659 const int dof = fe->
GetDof();
2668 for (
int q = 0; q < nqp; q++)
2673 const double weight = ip.
weight * Jtr(q).Det();
2680 lim_energy += weight;
2686 lim_energy = fes->
GetNE();
2702 dx = std::numeric_limits<float>::max();
2705 double detv_avg_min = std::numeric_limits<float>::max();
2706 for (
int i = 0; i < NE; i++)
2711 for (
int j = 0; j < nsp; j++)
2715 detv_sum += std::fabs(
Jpr.
Det());
2717 double detv_avg = pow(detv_sum/nsp, 1./dim);
2718 detv_avg_min = std::min(detv_avg, detv_avg_min);
2742 MPI_Allreduce(&
dx, &min_jac_all, 1, MPI_DOUBLE, MPI_MIN, pfes.
GetComm());
2780 MFEM_VERIFY(
tmopi.Size() > 0,
"No TMOP_Integrators were added.");
2782 tmopi[0]->EnableLimiting(n0, dist, w0, lfunc);
2783 for (
int i = 1; i <
tmopi.Size(); i++) {
tmopi[i]->DisableLimiting(); }
2790 MFEM_VERIFY(
tmopi.Size() > 0,
"No TMOP_Integrators were added.");
2792 tmopi[0]->EnableLimiting(n0, w0, lfunc);
2793 for (
int i = 1; i <
tmopi.Size(); i++) {
tmopi[i]->DisableLimiting(); }
2798 MFEM_VERIFY(
tmopi.Size() > 0,
"No TMOP_Integrators were added.");
2800 tmopi[0]->SetLimitingNodes(n0);
2801 for (
int i = 1; i <
tmopi.Size(); i++) {
tmopi[i]->DisableLimiting(); }
2809 for (
int i = 0; i <
tmopi.Size(); i++)
2811 energy +=
tmopi[i]->GetElementEnergy(el, T, elfun);
2821 MFEM_VERIFY(
tmopi.Size() > 0,
"No TMOP_Integrators were added.");
2823 tmopi[0]->AssembleElementVector(el, T, elfun, elvect);
2824 for (
int i = 1; i <
tmopi.Size(); i++)
2827 tmopi[i]->AssembleElementVector(el, T, elfun, elvect_i);
2837 MFEM_VERIFY(
tmopi.Size() > 0,
"No TMOP_Integrators were added.");
2839 tmopi[0]->AssembleElementGrad(el, T, elfun, elmat);
2840 for (
int i = 1; i <
tmopi.Size(); i++)
2843 tmopi[i]->AssembleElementGrad(el, T, elfun, elmat_i);
2850 const int cnt =
tmopi.Size();
2851 double total_integral = 0.0;
2852 for (
int i = 0; i < cnt; i++)
2854 tmopi[i]->EnableNormalization(x);
2855 total_integral += 1.0 /
tmopi[i]->metric_normal;
2857 for (
int i = 0; i < cnt; i++)
2859 tmopi[i]->metric_normal = 1.0 / total_integral;
2866 const int cnt =
tmopi.Size();
2867 double total_integral = 0.0;
2868 for (
int i = 0; i < cnt; i++)
2870 tmopi[i]->ParEnableNormalization(x);
2871 total_integral += 1.0 /
tmopi[i]->metric_normal;
2873 for (
int i = 0; i < cnt; i++)
2875 tmopi[i]->metric_normal = 1.0 / total_integral;
2885 const int NE = mesh.
GetNE();
2888 DenseMatrix Winv(dim), T(dim), A(dim), dshape, pos;
2893 for (
int i = 0; i < NE; i++)
2910 for (
int j = 0; j < nsp; j++)
2921 metric_gf(gf_dofs[j]) = metric.
EvalW(T);
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for all finite elements.
InvariantsEvaluator2D< double > ie
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void SetParDiscreteTargetSize(const ParGridFunction &tspec_)
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void SetInitialField(const Vector &init_nodes, const Vector &init_field)=0
int GetDim() const
Returns the reference space dimension for the finite element.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const =0
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void AddMultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += v w^t.
void SetSerialMetaInfo(const Mesh &m, const FiniteElementCollection &fec, int num_comp)
Class for an integration rule - an Array of IntegrationPoint.
VectorCoefficient * vector_tspec
void EnableFiniteDifferences(const GridFunction &x)
Enables FD-based approximation and computes dx.
void NewDataAndSize(double *d, int s)
Set the Vector data and size, deleting the old data, if owned.
const TargetType target_type
Class for grid function - Vector with associated FE space.
void UpdateAfterMeshChange(const Vector &new_x)
InvariantsEvaluator3D< double > ie
void Assemble_ddI2b(scalar_t w, scalar_t *A)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
ParMesh * GetParMesh() const
Base class for vector Coefficients that optionally depend on time and space.
void Assemble_ddI2b(scalar_t w, scalar_t *A)
void SetDerivativeMatrix(int height, const scalar_t *Deriv)
The Deriv matrix is dof x 2, using column-major storage.
const GridFunction * lim_dist
virtual void SetSerialDiscreteTargetOrientation(const GridFunction &tspec_)
virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
Compute the local energy.
virtual void EvalGrad(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip, int comp)=0
Evaluate the derivative of the matrix coefficient with respect to comp in the element described by T ...
InvariantsEvaluator2D< double > ie
void EnableNormalization(const GridFunction &x)
Computes the normalization factors of the metric and limiting integrals using the mesh position given...
const scalar_t * Get_dI3b()
void SetSize(int s)
Resize the vector to size s.
void InterpolateTMOP_QualityMetric(TMOP_QualityMetric &metric, const TargetConstructor &tc, const Mesh &mesh, GridFunction &metric_gf)
Interpolates the metric's values at the nodes of metric_gf.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
TMOP_QualityMetric * metric
InvariantsEvaluator2D< double > ie
Base class for limiting functions to be used in class TMOP_Integrator.
virtual double EvalW(const DenseMatrix &Jpt) const =0
Evaluate the strain energy density function, W = W(Jpt).
virtual void Eval_d2(const Vector &x, const Vector &x0, double dist, DenseMatrix &d2) const =0
Returns the Hessian of the limiting function f(x, x0, d) with respect to x.
virtual void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
double Norml2() const
Returns the l2 norm of the vector.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
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 ...
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< double > ie
virtual void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
ParFiniteElementSpace * pfes
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
void AssembleElemGradAdaptLim(const FiniteElement &el, const Vector &weights, IsoparametricTransformation &Tpr, const IntegrationRule &ir, DenseMatrix &m)
void FinalizeSerialDiscreteTargetSpec()
void EnableAdaptiveLimiting(const GridFunction &z0, Coefficient &coeff, AdaptivityEvaluator &ae)
Restriction of the node positions to certain regions.
void SetSize(int i, int j, int k)
int GetNE() const
Returns number of elements.
void EnableNormalization(const GridFunction &x)
Normalization factor that considers all integrators in the combination.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Abstract parallel finite element space.
InvariantsEvaluator2D< double > ie
InvariantsEvaluator2D< double > ie
void AssembleElementVectorFD(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
const GridFunction * nodes
virtual void SetSerialDiscreteTargetSkew(const GridFunction &tspec_)
void UpdateGradientTargetSpecification(const Vector &x, double dx, bool use_flag=false)
void Assemble_TProd(scalar_t w, const scalar_t *X, const scalar_t *Y, scalar_t *A)
void Assemble_ddI1(scalar_t w, scalar_t *A)
double * GetData() const
Returns the matrix data array.
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.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Default limiter function in TMOP_Integrator.
Geometry::Type GetElementBaseGeometry(int i) const
void Set(double alpha, const double *A)
Set the matrix to alpha * A, assuming that A has the same dimensions as the matrix and uses column-ma...
virtual void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const
Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadratur...
void AssembleElementGradExact(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Array< Vector * > ElemDer
const Vector & GetTspecPertMixH()
void EnableLimiting(const GridFunction &n0, const GridFunction &dist, Coefficient &w0, TMOP_LimiterFunction *lfunc=NULL)
Adds the limiting term to the first integrator. Disables it for the rest.
void Assemble_ddI2(scalar_t w, scalar_t *A)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const
Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadratur...
AdaptivityEvaluator * adapt_eval
Coefficient * scalar_tspec
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void SetSerialDiscreteTargetAspectRatio(const GridFunction &tspec_)
const DenseMatrix & GetGeomToPerfGeomJac(int GeomType) const
void UpdateTargetSpecification(const Vector &new_x, bool use_flag=false)
void SetTargetJacobian(const DenseMatrix &_Jtr)
Specify the reference-element -> target-element Jacobian matrix for the point of interest.
const FiniteElementSpace * tspec_fesv
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
void Add(const DenseMatrix &A, const DenseMatrix &B, double alpha, DenseMatrix &C)
C = A + alpha*B.
int GetNE() const
Returns number of elements in the mesh.
Abstract class for local mesh quality metrics in the target-matrix optimization paradigm (TMOP) by P...
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
virtual ~AdaptivityEvaluator()
void SetJacobian(const scalar_t *Jac)
The Jacobian should use column-major storage.
void Assemble_ddI3b(scalar_t w, scalar_t *A)
InvariantsEvaluator3D< double > ie
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
void SetDiscreteTargetBase(const GridFunction &tspec_)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AddMult(const DenseMatrix &b, const DenseMatrix &c, DenseMatrix &a)
Matrix matrix multiplication. A += B * C.
DiscreteAdaptTC * discr_tc
void EnableLimiting(const GridFunction &n0, const GridFunction &dist, Coefficient &w0, TMOP_LimiterFunction *lfunc=NULL)
Limiting of the mesh displacements (general version).
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void UpdateTargetSpecificationAtNode(const FiniteElement &el, ElementTransformation &T, int nodenum, int idir, const Vector &IntData)
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
Mesh * GetMesh() const
Returns the mesh.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void Add(const double c, const DenseMatrix &A)
Adds the matrix A multiplied by the number c to the matrix.
InvariantsEvaluator2D< double > ie
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void AssembleElementVectorExact(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
const TargetConstructor * targetC
Array< Vector * > ElemPertEnergy
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
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...
const scalar_t * Get_dI2b()
virtual void GetElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator2D< double > ie
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
void SetDerivativeMatrix(int height, const scalar_t *Deriv)
The Deriv matrix is dof x 3, using column-major storage.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void SetParDiscreteTargetAspectRatio(const ParGridFunction &tspec_)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void ParEnableNormalization(const ParGridFunction &x)
InvariantsEvaluator2D< double > ie
int GetNumRootElements()
Return the number of root elements.
void GetValues(int i, const IntegrationRule &ir, Vector &vals, int vdim=1) const
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
int GetVDim() const
Returns vector dimension.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
A class for non-conforming AMR on higher-order hexahedral, prismatic, quadrilateral or triangular mes...
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
FiniteElementSpace * FESpace()
virtual bool ContainsVolumeInfo() const
Checks if the target matrices contain non-trivial size specification.
void GetColumn(int c, Vector &col) const
void Assemble_ddI1b(scalar_t w, scalar_t *A)
void RestoreTargetSpecificationAtNode(ElementTransformation &T, int nodenum)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void SetTspecAtIndex(int idx, const GridFunction &tspec_)
void ComputeAvgVolume() const
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
double Min() const
Returns the minimal element of the vector.
double * Data() const
Returns the matrix data array.
double p(const Vector &x, double t)
void UpdateHessianTargetSpecification(const Vector &x, double dx, bool use_flag=false)
void Transpose()
(*this) = (*this)^t
double Trace() const
Trace of a square matrix.
void AddMultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += A * B^t.
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void Assemble_ddI2(scalar_t w, scalar_t *A)
const scalar_t * Get_dI1()
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
InvariantsEvaluator3D< double > ie
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
TMOPMatrixCoefficient * matrix_tspec
const scalar_t * Get_dI1()
virtual void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const
Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadratur...
const IntegrationRule & ActionIntegrationRule(const FiniteElement &el) const
InvariantsEvaluator2D< double > ie
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void AssembleElemVecAdaptLim(const FiniteElement &el, const Vector &weights, IsoparametricTransformation &Tpr, const IntegrationRule &ir, DenseMatrix &m)
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
const scalar_t * Get_dI1b()
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
const scalar_t * Get_dI1b()
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator3D< double > ie
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void ComputeFDh(const Vector &x, const FiniteElementSpace &fes)
Determines the perturbation, h, for FD-based approximation.
const scalar_t * Get_dI2b()
virtual double Eval(const Vector &x, const Vector &x0, double d) const =0
Returns the limiting function, f(x, x0, d).
Class for integration point with weight.
AdaptivityEvaluator * adapt_eval
InvariantsEvaluator3D< double > ie
void Assemble_TProd(scalar_t w, const scalar_t *X, const scalar_t *Y, scalar_t *A)
Array< TMOP_Integrator * > tmopi
const scalar_t * Get_dI2()
void ComputeMinJac(const Vector &x, const FiniteElementSpace &fes)
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
void ComputeNormalizationEnergies(const GridFunction &x, double &metric_energy, double &lim_energy)
const IntegrationRule & EnergyIntegrationRule(const FiniteElement &el) const
const IntegrationRule & GradientIntegrationRule(const FiniteElement &el) const
double GetFDDerivative(const FiniteElement &el, ElementTransformation &T, Vector &elfun, const int nodenum, const int idir, const double baseenergy, bool update_stored)
void SetParMetaInfo(const ParMesh &m, const FiniteElementCollection &fec, int num_comp)
Parallel version of SetSerialMetaInfo.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
Computes the integral of W(Jacobian(Trt)) over a target zone.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void Assemble_ddI1(scalar_t w, scalar_t *A)
virtual void Eval_d1(const Vector &x, const Vector &x0, double dist, Vector &d1) const =0
Returns the gradient of the limiting function f(x, x0, d) with respect to x.
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
const GridFunction * zeta_0
const Vector & GetTspecPert2H()
const Vector & GetTspecPert1H()
void AssembleElementGradFD(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
InvariantsEvaluator2D< double > ie
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void SetParDiscreteTargetSpec(const ParGridFunction &tspec_)
InvariantsEvaluator2D< double > ie
NCMesh * ncmesh
Optional non-conforming mesh extension.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
const scalar_t * Get_dI2()
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void FinalizeParDiscreteTargetSpec(const ParGridFunction &tspec_)
void MultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
Multiply the transpose of a matrix A with a matrix B: At*B.
const FiniteElementCollection * FEColl() const
void Mult(const double *x, double *y) const
Matrix vector multiplication.
void GetNodes(Vector &node_coord) const
InvariantsEvaluator3D< double > ie
const GridFunction * nodes0
const FiniteElementSpace * tspec_fes
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void SetSerialDiscreteTargetSpec(const GridFunction &tspec_)
virtual void SetParDiscreteTargetSkew(const ParGridFunction &tspec_)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void SetParDiscreteTargetOrientation(const ParGridFunction &tspec_)
void UseExternalData(double *d, int h, int w)
Change the data array and the size of the DenseMatrix.
Class for parallel grid function.
void Assemble_ddI1b(scalar_t w, scalar_t *A)
Base class representing target-matrix construction algorithms for mesh optimization via the target-ma...
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
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...
virtual void SetAnalyticTargetSpec(Coefficient *sspec, VectorCoefficient *vspec, TMOPMatrixCoefficient *mspec)
Rank 3 tensor (array of matrices)
Class for parallel meshes.
virtual void SetSerialDiscreteTargetSize(const GridFunction &tspec_)
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)
TMOP_LimiterFunction * lim_func
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator3D< double > ie
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
void ParEnableNormalization(const ParGridFunction &x)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual void ComputeAtNewPosition(const Vector &new_nodes, Vector &new_field)=0
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
ParFiniteElementSpace * ParFESpace() const
void SetJacobian(const scalar_t *Jac)
The Jacobian should use column-major storage.