MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::TMOP_WorstCaseUntangleOptimizer_Metric Class Reference

#include <tmop.hpp>

Inheritance diagram for mfem::TMOP_WorstCaseUntangleOptimizer_Metric:
[legend]
Collaboration diagram for mfem::TMOP_WorstCaseUntangleOptimizer_Metric:
[legend]

Public Types

enum class  BarrierType { None , Shifted , Pseudo }
 
enum class  WorstCaseType { None , Beta , PMean }
 

Public Member Functions

 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)
 
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, see linalg/invariants.hpp.
 
AD1Type EvalW_AD1 (const std::vector< AD1Type > &T, const std::vector< AD1Type > &W) const override
 First-derivative hook for AD-based computations.
 
AD2Type EvalW_AD2 (const std::vector< AD2Type > &T, const std::vector< AD2Type > &W) const override
 Second-derivative hook for AD-based computations.
 
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 local gradient matrix 'A'.
 
real_t EvalWBarrier (const DenseMatrix &Jpt) const
 
void SetMinDetT (real_t min_detT_)
 
void SetMaxMuT (real_t max_muT_)
 
BarrierType GetBarrierType ()
 
WorstCaseType GetWorstCaseType ()
 
- Public Member Functions inherited from mfem::TMOP_QualityMetric
 TMOP_QualityMetric ()
 
virtual ~TMOP_QualityMetric ()
 
virtual void SetTargetJacobian (const DenseMatrix &Jtr_)
 Specify the reference-element -> target-element Jacobian matrix for the point of interest.
 
virtual real_t EvalWMatrixForm (const DenseMatrix &Jpt) const
 Evaluates the metric in matrix form (opposed to invariant form). Used for validating the invariant evaluations.
 
virtual void EvalPW (const DenseMatrix &Jpt, DenseMatrix &PW) const
 
virtual int Id () const
 Return the metric ID.
 
- Public Member Functions inherited from mfem::HyperelasticModel
 HyperelasticModel ()
 
virtual ~HyperelasticModel ()
 
void SetTransformation (ElementTransformation &Ttr_)
 

Protected Attributes

TMOP_QualityMetrictmop_metric
 
real_t min_detT
 
real_t max_muT
 
int exponent
 
real_t alpha
 
real_t detT_ep
 
real_t muT_ep
 
BarrierType btype
 
WorstCaseType wctype
 
- Protected Attributes inherited from mfem::TMOP_QualityMetric
const DenseMatrixJtr
 
- Protected Attributes inherited from mfem::HyperelasticModel
ElementTransformationTtr
 

Additional Inherited Members

- Protected Member Functions inherited from mfem::TMOP_QualityMetric
void SetTransformation (ElementTransformation &)
 The method HyperelasticModel::SetTransformation() is hidden for TMOP_QualityMetrics, because it is not used.
 
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 are pre-computed and stored into H. This function is used in combination with AD-based computations.
 

Detailed Description

Simultaneous Untangler + Worst Case Improvement Metric Uses a base metric mu and is defined as: mu_tilde = mu_hat, when WorstCaseType = None, = mu_hat/(beta - mu_hat), when WorstCaseType = Beta, = mu_hat^p, when WorstCaseType = PMean, where beta = max(mu_hat) + muT_ep, and mu_hat = (mu/2phi(tau,ep)) where 2phi(tau,ep) = 1, when when BarrierType = None, = 2*(tau - min(alpha*min(tau)-detT_ep,0)), when BarrierType = Shifted = tau^2 + sqrt(tau^2 + ep^2), when BarrierType = Pseudo where tau = det(T), and max(mu_hat) and min(tau) are computed over the entire mesh. Ultimately, this metric can be used for mesh untangling with the BarrierType option and for worst case quality improvement with the WorstCaseType option.

Definition at line 200 of file tmop.hpp.

Member Enumeration Documentation

◆ BarrierType

Enumerator
None 
Shifted 
Pseudo 

Definition at line 203 of file tmop.hpp.

◆ WorstCaseType

Enumerator
None 
Beta 
PMean 

Definition at line 209 of file tmop.hpp.

Constructor & Destructor Documentation

◆ TMOP_WorstCaseUntangleOptimizer_Metric()

mfem::TMOP_WorstCaseUntangleOptimizer_Metric::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 )
inline

Definition at line 228 of file tmop.hpp.

Member Function Documentation

◆ AssembleH()

void mfem::TMOP_WorstCaseUntangleOptimizer_Metric::AssembleH ( const DenseMatrix & Jpt,
const DenseMatrix & DS,
const real_t weight,
DenseMatrix & A ) const
overridevirtual

Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the local gradient matrix 'A'.

Parameters
[in]JptRepresents the target->physical transformation Jacobian matrix.
[in]DSGradient of the basis matrix (dof x dim).
[in]weightQuadrature weight coefficient for the point.
[in,out]ALocal gradient matrix where the contribution from this point will be added.

Computes weight * d(dW_dxi)_d(xj) at the current point, for all i and j, where x1 ... xn are the FE dofs. This function is usually defined using the matrix invariants and their derivatives.

Implements mfem::TMOP_QualityMetric.

Definition at line 793 of file tmop.cpp.

◆ EvalP()

void mfem::TMOP_WorstCaseUntangleOptimizer_Metric::EvalP ( const DenseMatrix & Jpt,
DenseMatrix & P ) const
overridevirtual

Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).

Parameters
[in]JptRepresents the target->physical transformation Jacobian matrix.
[out]PThe evaluated 1st Piola-Kirchhoff stress tensor.

Implements mfem::TMOP_QualityMetric.

Definition at line 775 of file tmop.cpp.

◆ EvalW()

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::EvalW ( const DenseMatrix & Jpt) const
overridevirtual

Evaluate the strain energy density function, W = W(Jpt), by using the 2D or 3D matrix invariants, see linalg/invariants.hpp.

Parameters
[in]JptRepresents the target->physical transformation Jacobian matrix.

Implements mfem::TMOP_QualityMetric.

Definition at line 726 of file tmop.cpp.

◆ EvalW_AD1()

AD1Type mfem::TMOP_WorstCaseUntangleOptimizer_Metric::EvalW_AD1 ( const std::vector< AD1Type > & T,
const std::vector< AD1Type > & W ) const
overridevirtual

First-derivative hook for AD-based computations.

Warning
Not for public use. Internal use for AD-based computations.

Reimplemented from mfem::TMOP_QualityMetric.

Definition at line 759 of file tmop.cpp.

◆ EvalW_AD2()

AD2Type mfem::TMOP_WorstCaseUntangleOptimizer_Metric::EvalW_AD2 ( const std::vector< AD2Type > & T,
const std::vector< AD2Type > & W ) const
overridevirtual

Second-derivative hook for AD-based computations.

Warning
Not for public use. Internal use for AD-based computations.

Reimplemented from mfem::TMOP_QualityMetric.

Definition at line 767 of file tmop.cpp.

◆ EvalWBarrier()

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::EvalWBarrier ( const DenseMatrix & Jpt) const

Definition at line 743 of file tmop.cpp.

◆ GetBarrierType()

BarrierType mfem::TMOP_WorstCaseUntangleOptimizer_Metric::GetBarrierType ( )
inline

Definition at line 268 of file tmop.hpp.

◆ GetWorstCaseType()

WorstCaseType mfem::TMOP_WorstCaseUntangleOptimizer_Metric::GetWorstCaseType ( )
inline

Definition at line 270 of file tmop.hpp.

◆ SetMaxMuT()

void mfem::TMOP_WorstCaseUntangleOptimizer_Metric::SetMaxMuT ( real_t max_muT_)
inline

Definition at line 266 of file tmop.hpp.

◆ SetMinDetT()

void mfem::TMOP_WorstCaseUntangleOptimizer_Metric::SetMinDetT ( real_t min_detT_)
inline

Definition at line 264 of file tmop.hpp.

Member Data Documentation

◆ alpha

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::alpha
protected

Definition at line 221 of file tmop.hpp.

◆ btype

BarrierType mfem::TMOP_WorstCaseUntangleOptimizer_Metric::btype
protected

Definition at line 224 of file tmop.hpp.

◆ detT_ep

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::detT_ep
protected

Definition at line 222 of file tmop.hpp.

◆ exponent

int mfem::TMOP_WorstCaseUntangleOptimizer_Metric::exponent
protected

Definition at line 220 of file tmop.hpp.

◆ max_muT

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::max_muT
protected

Definition at line 219 of file tmop.hpp.

◆ min_detT

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::min_detT
protected

Definition at line 218 of file tmop.hpp.

◆ muT_ep

real_t mfem::TMOP_WorstCaseUntangleOptimizer_Metric::muT_ep
protected

Definition at line 223 of file tmop.hpp.

◆ tmop_metric

TMOP_QualityMetric& mfem::TMOP_WorstCaseUntangleOptimizer_Metric::tmop_metric
protected

Definition at line 217 of file tmop.hpp.

◆ wctype

WorstCaseType mfem::TMOP_WorstCaseUntangleOptimizer_Metric::wctype
protected

Definition at line 225 of file tmop.hpp.


The documentation for this class was generated from the following files: