88 virtual int Id()
const {
return 0; }
91class TargetConstructor;
144 MFEM_VERIFY(
tmop_q_arr.Size() == weights.
Size(),
"Incorrect #weights");
202 "Worst-case optimization has not been fully developed!");
206 MFEM_VERIFY(m_id == 4 || m_id == 14 || m_id == 66,
207 "Incorrect input barrier metric -- must be 4 / 14 / 66");
214 { MFEM_ABORT(
"Not implemented"); }
218 { MFEM_ABORT(
"Not implemented"); }
244 int Id()
const override {
return 0; }
262 int Id()
const override {
return 1; }
276 {
return EvalWMatrixForm(Jpt); }
294 { MFEM_ABORT(
"Not implemented"); }
298 { MFEM_ABORT(
"Not implemented"); }
309 { MFEM_ABORT(
"Not implemented"); }
313 { MFEM_ABORT(
"Not implemented"); }
324 { MFEM_ABORT(
"Not implemented"); }
328 { MFEM_ABORT(
"Not implemented"); }
350 int Id()
const override {
return 2; }
369 int Id()
const override {
return 4; }
387 int Id()
const override {
return 7; }
537 int Id()
const override {
return 66; }
562 int Id()
const override {
return 77; }
582 int Id()
const override {
return 80; }
620 int Id()
const override {
return 90; }
641 int Id()
const override {
return 94; }
736 int Id()
const override {
return 302; }
757 int Id()
const override {
return 303; }
778 int Id()
const override {
return 304; }
818 int Id()
const override {
return 313; }
836 int Id()
const override {
return 315; }
876 int Id()
const override {
return 318; }
897 int Id()
const override {
return 321; }
918 int Id()
const override {
return 322; }
939 int Id()
const override {
return 323; }
959 int Id()
const override {
return 328; }
978 int Id()
const override {
return 332; }
1019 int Id()
const override {
return 334; }
1042 int Id()
const override {
return 338; }
1080 int Id()
const override {
return 347; }
1123 int Id()
const override {
return 360; }
1286 int Id()
const override {
return 49; }
1322 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1328 Vector &d1)
const override
1330 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1333 subtract(1.0 / (dist * dist), x, x0, d1);
1339 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1341 d2.
Diag(1.0 / (dist * dist), x.
Size());
1353 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1359 Vector &d1)
const override
1361 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1364 real_t dist_squared = dist*dist;
1366 dist_squared, x, x0, d1);
1372 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
1375 real_t dist_squared = dist*dist;
1376 real_t dist_squared_squared = dist_squared*dist_squared;
1381 d2(0,0) = ((400.0*tmp(0)*tmp(0)*
f)/dist_squared_squared)+(20.0*
f/dist_squared);
1382 d2(1,1) = ((400.0*tmp(1)*tmp(1)*
f)/dist_squared_squared)+(20.0*
f/dist_squared);
1383 d2(0,1) = (400.0*tmp(0)*tmp(1)*
f)/dist_squared_squared;
1388 d2(0,2) = (400.0*tmp(0)*tmp(2)*
f)/dist_squared_squared;
1389 d2(1,2) = (400.0*tmp(1)*tmp(2)*
f)/dist_squared_squared;
1392 d2(2,2) = ((400.0*tmp(2)*tmp(2)*
f)/dist_squared_squared)+(20.0*
f/dist_squared);
1400class FiniteElementCollection;
1401class FiniteElementSpace;
1402class ParFiniteElementSpace;
1441 const Vector &init_field) = 0;
1537 comm = MPI_COMM_NULL;
1658class ParGridFunction;
1789 int nodenum,
int idir,
1799 bool reuse_flag =
false,
1806 bool reuse_flag =
false,
1875class TMOPNewtonSolver;
2029 real_t &surf_fit_gf_energy);
2069 Vector &d_el,
const int nodenum,
const int idir,
2070 const real_t baseenergy,
bool update_stored);
2147 int new_x_ordering);
2167 {
PA.enabled =
false; }
2199 "This function must be called before EnableNormalization, as "
2200 "the normalization computations must know how to integrate.");
2346 const Vector &d_el)
override;
2440 for (
int i = 0; i <
tmopi.Size(); i++)
2441 {
tmopi[i]->SetInitialMeshPos(x0); }
2449 for (
int i = 0; i <
tmopi.Size(); i++) {
delete tmopi[i]; }
2471 const Vector &elfun)
override;
2507 const TargetConstructor &tc,
2508 const Mesh &mesh, GridFunction &metric_gf);
virtual ~AdaptivityEvaluator()
virtual void SetNewFieldFESpace(const FiniteElementSpace &fes)=0
virtual void SetInitialField(const Vector &init_nodes, const Vector &init_field)=0
virtual void ComputeAtGivenPositions(const Vector &positions, Vector &values, int p_ordering=Ordering::byNODES)=0
Using the source mesh and field given by SetInitialField(), compute corresponding values at specified...
void SetSerialMetaInfo(const Mesh &m, const FiniteElementSpace &f)
void SetParMetaInfo(const ParMesh &m, const ParFiniteElementSpace &f)
Parallel version of SetSerialMetaInfo.
void ClearGeometricFactors()
virtual void ComputeAtNewPosition(const Vector &new_mesh_nodes, Vector &new_field, int nodes_ordering=Ordering::byNODES)=0
Perform field transfer between the original and a new mesh. The source mesh and field are given by Se...
ParFiniteElementSpace * pfes
AnalyticAdaptTC(TargetType ttype)
Coefficient * scalar_tspec
virtual void SetAnalyticTargetSpec(Coefficient *sspec, VectorCoefficient *vspec, TMOPMatrixCoefficient *mspec)
TMOPMatrixCoefficient * matrix_tspec
void ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const override
Computes reference-to-target transformation Jacobians for all quadrature points in all elements.
VectorCoefficient * vector_tspec
void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const override
Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadratu...
void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const override
int Append(const T &el)
Append element 'el' to array, resize if necessary.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Data type dense matrix using column-major storage.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void Diag(real_t c, int n)
Creates n x n diagonal matrix with diagonal elements c.
void Clear()
Delete the matrix data array (if owned) and reset the matrix state.
Rank 3 tensor (array of matrices)
const Vector & GetTspecPert1H()
void UpdateTargetSpecification(const Vector &new_x, bool reuse_flag=false, int new_x_ordering=Ordering::byNODES)
virtual void SetSerialDiscreteTargetSkew(const GridFunction &tspec_)
virtual void SetParDiscreteTargetAspectRatio(const ParGridFunction &tspec_)
ParGridFunction * tspec_pgf
FiniteElementSpace * GetTSpecFESpace()
Get the FESpace associated with tspec.
virtual void SetSerialDiscreteTargetAspectRatio(const GridFunction &tspec_)
const AdaptivityEvaluator * GetAdaptivityEvaluator() const
void SetTspecDataForDerefinement(FiniteElementSpace *fes)
Computes target specification data with respect to the coarse FE space.
void ResetDerefinementTspecData()
const Vector & GetTspecPertMixH()
void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const override
void SetMinSizeForTargets(real_t min_size_)
virtual void SetParDiscreteTargetSpec(const ParGridFunction &tspec_)
AdaptivityEvaluator * adapt_eval
void FinalizeSerialDiscreteTargetSpec(const GridFunction &tspec_)
void FinalizeParDiscreteTargetSpec(const ParGridFunction &tspec_)
ParFiniteElementSpace * ptspec_fesv
FiniteElementSpace * coarse_tspec_fesv
virtual ~DiscreteAdaptTC()
GridFunction * GetTSpecData()
Get the entire tspec.
virtual void SetSerialDiscreteTargetSize(const GridFunction &tspec_)
virtual void SetParDiscreteTargetSize(const ParGridFunction &tspec_)
const Vector & GetTspecPert2H()
void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const override
Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadratu...
void UpdateAfterMeshTopologyChange()
Update all discrete fields based on tspec and update for AMR.
void SetAdaptivityEvaluator(AdaptivityEvaluator *ae)
virtual void SetSerialDiscreteTargetSpec(const GridFunction &tspec_)
virtual void SetParDiscreteTargetOrientation(const ParGridFunction &tspec_)
void ResetRefinementTspecData()
virtual void SetParDiscreteTargetSkew(const ParGridFunction &tspec_)
void ParUpdateAfterMeshTopologyChange()
void UpdateTargetSpecificationAtNode(const FiniteElement &el, ElementTransformation &T, int nodenum, int idir, const Vector &IntData)
void ResetUpdateFlags()
Used in combination with the Update methods to avoid extra computations.
void RestoreTargetSpecificationAtNode(ElementTransformation &T, int nodenum)
FiniteElementSpace * tspec_fesv
virtual void SetSerialDiscreteTargetOrientation(const GridFunction &tspec_)
void SetTspecAtIndex(int idx, const GridFunction &tspec_)
ParFiniteElementSpace * GetTSpecParFESpace()
void SetRefinementSubElement(int amr_el_)
void GetDiscreteTargetSpec(GridFunction &tspec_, int idx)
Get one of the discrete fields from tspec.
void UpdateHessianTargetSpecification(const Vector &x, real_t dx, bool reuse_flag=false, int x_ordering=Ordering::byNODES)
void ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const override
Computes reference-to-target transformation Jacobians for all quadrature points in all elements.
void SetDiscreteTargetBase(const GridFunction &tspec_)
DiscreteAdaptTC(TargetType ttype)
void UpdateGradientTargetSpecification(const Vector &x, real_t dx, bool reuse_flag=false, int x_ordering=Ordering::byNODES)
void SetTspecFromIntRule(int e_id, const IntegrationRule &intrule)
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Abstract class for all finite elements.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Class for grid function - Vector with associated FE space.
Abstract class for hyperelastic models.
Class for integration point with weight.
Class for an integration rule - an Array of IntegrationPoint.
Container class for integration rules.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const IntegrationRule * IntRule
Auxiliary class for evaluating the 2x2 matrix invariants and their first and second derivatives.
Auxiliary class for evaluating the 3x3 matrix invariants and their first and second derivatives.
Base class for Matrix Coefficients that optionally depend on time and space.
Abstract parallel finite element space.
Class for parallel grid function.
Class for parallel meshes.
virtual real_t GetDerefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
void AssembleGradPA(const Vector &, const FiniteElementSpace &) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
void AssembleGradDiagonalPA(Vector &) const override
Method for computing the diagonal of the gradient with partial assembly.
real_t GetLocalStateEnergyPA(const Vector &) const override
Compute the local (to the MPI rank) energy with partial assembly.
void AddMultPA(const Vector &, Vector &) const override
Method for partially assembled action.
void ParEnableNormalization(const ParGridFunction &x)
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 AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat) override
Assemble the local gradient matrix.
real_t GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun) override
Compute the local energy.
void AddMultGradPA(const Vector &, Vector &) const override
Method for partially assembled gradient action.
virtual real_t GetRefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, const IntegrationRule &irule)
void AssemblePA(const FiniteElementSpace &) override
Method defining partial assembly.
Array< TMOP_Integrator * > tmopi
void SetInitialMeshPos(const GridFunction *x0)
void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect) override
Perform the local action of the NonlinearFormIntegrator.
void EnableNormalization(const GridFunction &x)
Normalization factor that considers all integrators in the combination.
void AddTMOPIntegrator(TMOP_Integrator *ti)
Adds a new TMOP_Integrator to the combination.
const Array< TMOP_Integrator * > & GetTMOPIntegrators() const
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
virtual ~TMOPMatrixCoefficient()
TMOPMatrixCoefficient(int dim)
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 ...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
InvariantsEvaluator2D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
2D barrier Size (V) metric (polyconvex).
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
InvariantsEvaluator2D< real_t > ie
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sh_metric
int Id() const override
Return the metric ID.
TMOP_AMetric_049(real_t gamma)
TMOP_QualityMetric * sk_metric
virtual ~TMOP_AMetric_049()
2D barrier Skew (Q) metric.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
2D barrier Size+Skew (VQ) metric.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
2D barrier Shape+Orientation (OS) metric (polyconvex).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator2D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const override
2D barrier Shape+Size (VS) metric (polyconvex).
virtual ~TMOP_AMetric_126()
TMOP_QualityMetric * sh_metric
TMOP_AMetric_126(real_t gamma)
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sz_metric
void SetTargetJacobian(const DenseMatrix &Jtr_) override
Specify the reference-element -> target-element Jacobian matrix for the point of interest.
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void ComputeAvgMetrics(const GridFunction &nodes, const TargetConstructor &tc, Vector &averages) const
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void SetWeights(const Vector &weights)
Changes the weights of the metrics in the combination.
void GetWeights(Array< real_t > &weights) const
Array< TMOP_QualityMetric * > tmop_q_arr
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
virtual void AddQualityMetric(TMOP_QualityMetric *tq, real_t wt=1.0)
void EvalPW(const DenseMatrix &Jpt, DenseMatrix &P) const override
void ComputeBalancedWeights(const GridFunction &nodes, const TargetConstructor &tc, Vector &weights) const
Exponential limiter function in TMOP_Integrator.
virtual ~TMOP_ExponentialLimiter()
void Eval_d1(const Vector &x, const Vector &x0, real_t dist, Vector &d1) const override
Returns the gradient of the limiting function f(x, x0, d) with respect to x.
real_t Eval(const Vector &x, const Vector &x0, real_t dist) const override
Returns the limiting function, f(x, x0, d).
void Eval_d2(const Vector &x, const Vector &x0, real_t dist, DenseMatrix &d2) const override
Returns the Hessian of the limiting function f(x, x0, d) with respect to x.
A TMOP integrator class based on any given TMOP_QualityMetric and TargetConstructor.
void AddMultGradPA(const Vector &, Vector &) const override
Method for partially assembled gradient action.
void SetExactActionFlag(bool flag_)
Flag to control if exact action of Integration is effected.
real_t ComputeUntanglerMaxMuBarrier(const Vector &x, const FiniteElementSpace &fes)
void UpdateAfterMeshPositionChange(const Vector &d, const FiniteElementSpace &d_fes)
void AssembleElemVecAdaptLim(const FiniteElement &el, IsoparametricTransformation &Tpr, const IntegrationRule &ir, const Vector &weights, DenseMatrix &mat)
void AssembleElemGradAdaptLim(const FiniteElement &el, IsoparametricTransformation &Tpr, const IntegrationRule &ir, const Vector &weights, DenseMatrix &m)
const DofToQuad * maps_lim
real_t GetLocalStateEnergyPA_C0_2D(const Vector &) const
TMOP_LimiterFunction * lim_func
void ComputeAllElementTargets(const Vector &xe=Vector()) const
void ParUpdateAfterMeshTopologyChange()
TMOP_QualityMetric * metric
const ParGridFunction * adapt_lim_pgf0
void SetFDhScale(real_t scale)
void AddMultPA_C0_3D(const Vector &, Vector &) const
void GetSurfaceFittingErrors(const Vector &d_loc, real_t &err_avg, real_t &err_max)
real_t ComputeMinDetT(const Vector &x, const FiniteElementSpace &fes)
AdaptivityEvaluator * surf_fit_eval
void EnableNormalization(const GridFunction &x)
Computes the normalization factors of the metric and limiting integrals using the mesh position given...
void ComputeMinJac(const Vector &x, const FiniteElementSpace &fes)
real_t GetLocalStateEnergyPA_2D(const Vector &) const
void AssembleElementVectorExact(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, Vector &elvect)
TMOP_QualityMetric * h_metric
void AssembleElementGradFD(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, DenseMatrix &elmat)
DiscreteAdaptTC * discr_tc
void AssembleDiagonalPA_2D(Vector &) const
GridFunction * surf_fit_gf
const GridFunction * lim_dist
void AssembleDiagonalPA_C0_3D(Vector &) const
Array< Vector * > ElemPertEnergy
const GridFunction * adapt_lim_gf0
void SetCoefficient(Coefficient &w1)
Sets a scaling Coefficient for the quality metric term of the integrator.
void AddMultGradPA_2D(const Vector &, Vector &) const
void ComputeUntangleMetricQuantiles(const Vector &d, const FiniteElementSpace &fes)
void AssembleGradPA_C0_2D(const Vector &) const
void EnableSurfaceFittingFromSource(const ParGridFunction &s_bg, ParGridFunction &s0, const Array< bool > &smarker, Coefficient &coeff, AdaptivityEvaluator &ae, const ParGridFunction &s_bg_grad, ParGridFunction &s0_grad, AdaptivityEvaluator &age, const ParGridFunction &s_bg_hess, ParGridFunction &s0_hess, AdaptivityEvaluator &ahe)
Fitting of certain DOFs in the current mesh to the zero level set of a function defined on another (f...
const TargetConstructor * targetC
void ComputeNormalizationEnergies(const GridFunction &x, real_t &metric_energy, real_t &lim_energy, real_t &surf_fit_gf_energy)
AdaptivityEvaluator * surf_fit_eval_grad
const GridFunction * lim_nodes0
const IntegrationRule * ir
TMOP_QuadraticLimiter * surf_fit_limiter
void EnableFiniteDifferences(const GridFunction &x)
Enables FD-based approximation and computes dx.
virtual real_t GetRefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, const IntegrationRule &irule)
Computes the mean of the energies of the given element's children.
real_t GetSurfaceFittingWeight()
Get the surface fitting weight.
void SetInitialMeshPos(const GridFunction *x0)
void AssemblePA(const FiniteElementSpace &) override
Method defining partial assembly.
void AssembleGradDiagonalPA(Vector &) const override
Method for computing the diagonal of the gradient with partial assembly.
void AssembleDiagonalPA_C0_2D(Vector &) const
bool IsSurfaceFittingEnabled()
const GridFunction * surf_fit_pos
Array< int > surf_fit_marker_dof_index
const GeometricFactors * geom
real_t GetLocalStateEnergyPA_C0_3D(const Vector &) const
void ParEnableNormalization(const ParGridFunction &x)
void AddMultGradPA_3D(const Vector &, Vector &) const
real_t GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &d_el) override
Computes the integral of W(Jacobian(Trt)) over a target zone.
Coefficient * adapt_lim_coeff
const FiniteElementSpace * fes
void AssemblePA_Limiting()
const IntegrationRule & EnergyIntegrationRule(const FiniteElement &el) const
GridFunction * surf_fit_grad
GridFunction * surf_fit_hess
void ReleasePADeviceMemory(bool copy_to_host=true)
void AddMultPA_2D(const Vector &, Vector &) const
virtual real_t GetDerefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
TMOP_QualityMetric & GetAMRQualityMetric()
void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, DenseMatrix &elmat) override
Second derivative of GetElementEnergy() w.r.t. each local H1 DOF.
void AssembleElementVectorFD(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, Vector &elvect)
void AddMultPA_3D(const Vector &, Vector &) const
const IntegrationRule & GradientIntegrationRule(const FiniteElement &el) const
void EnableAdaptiveLimiting(const GridFunction &z0, Coefficient &coeff, AdaptivityEvaluator &ae)
Restriction of the node positions to certain regions.
void AssembleGradPA_C0_3D(const Vector &) const
void AssembleGradPA_2D(const Vector &) const
struct mfem::TMOP_Integrator::@26 PA
AdaptivityEvaluator * surf_fit_eval_hess
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
Coefficient * metric_coeff
void SetIntegrationRules(IntegrationRules &irules, int order)
Prescribe a set of integration rules; relevant for mixed meshes.
void AddMultPA(const Vector &, Vector &) const override
Method for partially assembled action.
GridFunction * adapt_lim_gf
real_t GetFDDerivative(const FiniteElement &el, ElementTransformation &T, Vector &d_el, const int nodenum, const int idir, const real_t baseenergy, bool update_stored)
DiscreteAdaptTC * GetDiscreteAdaptTC() const
void UpdateAfterMeshTopologyChange()
void AddMultGradPA_C0_2D(const Vector &, Vector &) const
IntegrationRules * IntegRules
void RemapSurfaceFittingLevelSetAtNodes(const Vector &new_x, int new_x_ordering)
void AssembleDiagonalPA_3D(Vector &) const
void UpdateCoefficientsPA(const Vector &d_loc)
void AssembleGradPA_3D(const Vector &) const
Coefficient * surf_fit_coeff
Array< int > surf_fit_dof_count
void AssembleElementGradExact(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, DenseMatrix &elmat)
void EnableSurfaceFitting(const GridFunction &s0, const Array< bool > &smarker, Coefficient &coeff, AdaptivityEvaluator &ae)
Fitting of certain DOFs to the zero level set of a function.
void AssembleGradPA(const Vector &, const FiniteElementSpace &) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
void AssembleElemGradSurfFit(const FiniteElement &el_x, IsoparametricTransformation &Tpr, DenseMatrix &mat)
void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &d_el, Vector &elvect) override
First defivative of GetElementEnergy() w.r.t. each local H1 DOF.
real_t GetLocalStateEnergyPA_3D(const Vector &) const
TMOP_Integrator(TMOP_QualityMetric *m, TargetConstructor *tc)
void AddMultPA_C0_2D(const Vector &, Vector &) const
void UpdateSurfaceFittingWeight(real_t factor)
Update the surface fitting weight as surf_fit_coeff *= factor;.
Array< Vector * > ElemDer
void IntegrateOverTarget(bool integ_over_target_)
TMOP_Integrator(TMOP_QualityMetric *m, TargetConstructor *tc, TMOP_QualityMetric *hm)
const Array< bool > * surf_fit_marker
real_t GetLocalStateEnergyPA(const Vector &) const override
Compute the local (to the MPI rank) energy with partial assembly.
const IntegrationRule & ActionIntegrationRule(const FiniteElement &el) const
void AddMultGradPA_C0_3D(const Vector &, Vector &) const
AdaptivityEvaluator * adapt_lim_eval
void ComputeFDh(const Vector &d, const FiniteElementSpace &fes)
Determines the perturbation, h, for FD-based approximation.
void AssembleElemVecSurfFit(const FiniteElement &el_x, IsoparametricTransformation &Tpr, DenseMatrix &mat)
void EnableLimiting(const GridFunction &n0, const GridFunction &dist, Coefficient &w0, TMOP_LimiterFunction *lfunc=NULL)
Limiting of the mesh displacements (general version).
Base class for limiting functions to be used in class TMOP_Integrator.
virtual real_t Eval(const Vector &x, const Vector &x0, real_t d) const =0
Returns the limiting function, f(x, x0, d).
virtual void Eval_d1(const Vector &x, const Vector &x0, real_t dist, Vector &d1) const =0
Returns the gradient of the limiting function f(x, x0, d) with respect to x.
virtual ~TMOP_LimiterFunction()
Virtual destructor.
virtual void Eval_d2(const Vector &x, const Vector &x0, real_t dist, DenseMatrix &d2) const =0
Returns the Hessian of the limiting function f(x, x0, d) with respect to x.
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
int Id() const override
Return the metric ID.
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
2D non-barrier metric without a type.
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator2D< real_t > ie
int Id() const override
Return the metric ID.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator2D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
int Id() const override
Return the metric ID.
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
int Id() const override
Return the metric ID.
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
2D barrier Shape+Size (VS) metric (not polyconvex).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< real_t > ie
2D barrier Shape+Size (VS) metric (not polyconvex).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
2D non-barrier Shape+Size+Orientation (VOS) metric (polyconvex).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
2D Shifted barrier form of shape metric (mu_2).
TMOP_Metric_022(real_t &t0)
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
InvariantsEvaluator2D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
2D barrier shape (S) metric (not polyconvex).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
TMOP_QualityMetric * sz_metric
TMOP_QualityMetric * sh_metric
virtual ~TMOP_Metric_066()
InvariantsEvaluator2D< real_t > ie
TMOP_Metric_066(real_t gamma)
int Id() const override
Return the metric ID.
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
TMOP_QualityMetric * sh_metric
InvariantsEvaluator2D< real_t > ie
virtual ~TMOP_Metric_080()
int Id() const override
Return the metric ID.
TMOP_Metric_080(real_t gamma)
TMOP_QualityMetric * sz_metric
2D barrier Shape+Orientation (OS) metric (polyconvex).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
2D compound barrier Shape+Size (VS) metric (balanced).
int Id() const override
Return the metric ID.
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sh_metric
virtual ~TMOP_Metric_090()
TMOP_QualityMetric * sz_metric
2D compound barrier Shape+Size (VS) metric (balanced).
TMOP_QualityMetric * sz_metric
TMOP_QualityMetric * sh_metric
InvariantsEvaluator2D< real_t > ie
int Id() const override
Return the metric ID.
virtual ~TMOP_Metric_094()
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
TMOP_Metric_211(real_t epsilon=1e-4)
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator2D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
Shifted barrier form of metric 56 (area, ideal barrier metric), 2D.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
TMOP_Metric_252(real_t &t0)
Note that t0 is stored by reference.
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
3D barrier Shape (S) metric, well-posed (polyconvex & invex).
InvariantsEvaluator3D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
3D barrier Shape (S) metric, well-posed (polyconvex & invex).
int Id() const override
Return the metric ID.
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator3D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
3D barrier Shape (S) metric, well-posed (polyconvex & invex).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
InvariantsEvaluator3D< real_t > ie
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
3D barrier Shape (S) metric, well-posed (polyconvex & invex).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator3D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
3D Size (V) untangling metric.
TMOP_Metric_311(real_t epsilon=1e-4)
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
InvariantsEvaluator3D< real_t > ie
3D Shape (S) metric, untangling version of 303.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
TMOP_Metric_313(real_t &mindet)
InvariantsEvaluator3D< real_t > ie
int Id() const override
Return the metric ID.
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
InvariantsEvaluator3D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
InvariantsEvaluator3D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
int Id() const override
Return the metric ID.
InvariantsEvaluator3D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
3D barrier Shape+Size (VS) metric, well-posed (invex).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
InvariantsEvaluator3D< real_t > ie
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
int Id() const override
Return the metric ID.
3D barrier Shape+Size (VS) metric, well-posed (invex).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator3D< real_t > ie
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
int Id() const override
Return the metric ID.
3D barrier Shape+Size (VS) metric, well-posed (invex).
int Id() const override
Return the metric ID.
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
InvariantsEvaluator3D< real_t > ie
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
3D compound barrier Shape+Size (VS) metric (polyconvex, balanced).
int Id() const override
Return the metric ID.
TMOP_QualityMetric * sz_metric
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sh_metric
virtual ~TMOP_Metric_328()
3D compound barrier Shape+Size (VS) metric (polyconvex).
TMOP_QualityMetric * sh_metric
int Id() const override
Return the metric ID.
TMOP_QualityMetric * sz_metric
TMOP_Metric_332(real_t gamma)
virtual ~TMOP_Metric_332()
3D barrier Shape+Size (VS) metric, well-posed (polyconvex).
virtual ~TMOP_Metric_333()
TMOP_QualityMetric * sh_metric
TMOP_Metric_333(real_t gamma)
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sz_metric
3D barrier Shape+Size (VS) metric, well-posed (polyconvex).
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sz_metric
virtual ~TMOP_Metric_334()
int Id() const override
Return the metric ID.
TMOP_Metric_334(real_t gamma)
TMOP_QualityMetric * sh_metric
3D compound barrier Shape+Size (VS) metric (polyconvex, balanced).
TMOP_QualityMetric * sh_metric
InvariantsEvaluator2D< real_t > ie
TMOP_QualityMetric * sz_metric
virtual ~TMOP_Metric_338()
int Id() const override
Return the metric ID.
3D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
InvariantsEvaluator3D< real_t > ie
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
3D barrier Shape+Size (VS) metric, well-posed (polyconvex).
int Id() const override
Return the metric ID.
TMOP_QualityMetric * sz_metric
TMOP_QualityMetric * sh_metric
virtual ~TMOP_Metric_347()
TMOP_Metric_347(real_t gamma)
InvariantsEvaluator2D< real_t > ie
3D shifted barrier form of metric 316 (not typed).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator3D< real_t > ie
TMOP_Metric_352(real_t &t0)
3D non-barrier Shape (S) metric.
real_t EvalWMatrixForm(const DenseMatrix &Jpt) const override
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator3D< real_t > ie
int Id() const override
Return the metric ID.
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
2D non-barrier Aspect ratio metric.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
3D non-barrier Aspect ratio metric.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
3D non-barrier Skew metric.
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
Default limiter function in TMOP_Integrator.
void Eval_d1(const Vector &x, const Vector &x0, real_t dist, Vector &d1) const override
Returns the gradient of the limiting function f(x, x0, d) with respect to x.
void Eval_d2(const Vector &x, const Vector &x0, real_t dist, DenseMatrix &d2) const override
Returns the Hessian of the limiting function f(x, x0, d) with respect to x.
real_t Eval(const Vector &x, const Vector &x0, real_t dist) const override
Returns the limiting function, f(x, x0, d).
virtual ~TMOP_QuadraticLimiter()
Abstract class for local mesh quality metrics in the target-matrix optimization paradigm (TMOP) by P....
void DefaultAssembleH(const DenseTensor &H, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const
See AssembleH(). This is a default implementation for the case when the 2nd derivatives of the metric...
virtual real_t EvalWMatrixForm(const DenseMatrix &Jpt) const
Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant ev...
virtual void SetTargetJacobian(const DenseMatrix &Jtr_)
Specify the reference-element -> target-element Jacobian matrix for the point of interest.
void SetTransformation(ElementTransformation &)
The method HyperelasticModel::SetTransformation() is hidden for TMOP_QualityMetrics,...
virtual ~TMOP_QualityMetric()
virtual int Id() const
Return the metric ID.
virtual void EvalPW(const DenseMatrix &Jpt, DenseMatrix &PW) const
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const =0
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual real_t EvalW(const DenseMatrix &Jpt) const =0
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
real_t EvalW(const DenseMatrix &Jpt) const override
Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants,...
void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
BarrierType GetBarrierType()
TMOP_QualityMetric & tmop_metric
void SetMinDetT(real_t min_detT_)
WorstCaseType GetWorstCaseType()
TMOP_WorstCaseUntangleOptimizer_Metric(TMOP_QualityMetric &tmop_metric_, int exponent_=1, real_t alpha_=1.5, real_t detT_ep_=0.0001, real_t muT_ep_=0.0001, BarrierType btype_=BarrierType::None, WorstCaseType wctype_=WorstCaseType::None)
void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void SetMaxMuT(real_t max_muT_)
real_t EvalWBarrier(const DenseMatrix &Jpt) const
Base class representing target-matrix construction algorithms for mesh optimization via the target-ma...
void SetVolumeScale(real_t vol_scale)
Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
const TargetType target_type
void SetNodes(const GridFunction &n)
Set the nodes to be used in the target-matrix construction.
void ComputeAvgVolume() const
virtual void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
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 quadratu...
virtual ~TargetConstructor()
bool UsesPhysicalCoordinates() const
Return true if the methods ComputeElementTargets(), ComputeAllElementTargets(), and ComputeElementTar...
TargetType GetTargetType() const
const GridFunction * GetNodes() const
Get the nodes to be used in the target-matrix construction.
const GridFunction * nodes
virtual bool ContainsVolumeInfo() const
Checks if the target matrices contain non-trivial size specification.
TargetType
Target-matrix construction algorithms supported by this class.
TargetConstructor(TargetType ttype)
Constructor for use in serial.
void ComputeAllElementTargets_Fallback(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
TargetConstructor(TargetType ttype, MPI_Comm mpicomm)
Constructor for use in parallel.
bool ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
Base class for vector Coefficients that optionally depend on time and space.
real_t DistanceSquaredTo(const real_t *p) const
Compute the square of the Euclidean distance to another vector.
void Destroy()
Destroy a vector.
int Size() const
Returns the size of the vector.
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 subtract(const Vector &x, const Vector &y, Vector &z)
std::function< real_t(const Vector &)> f(real_t mass_coeff)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
std::array< int, NCMesh::MaxFaceNodes > nodes