15 #include "../linalg/invariants.hpp"
74 virtual int Id()
const {
return 0; }
122 virtual int Id()
const {
return 1; }
133 { MFEM_ABORT(
"Not implemented"); }
137 { MFEM_ABORT(
"Not implemented"); }
148 { MFEM_ABORT(
"Not implemented"); }
152 { MFEM_ABORT(
"Not implemented"); }
163 { MFEM_ABORT(
"Not implemented"); }
167 { MFEM_ABORT(
"Not implemented"); }
178 { MFEM_ABORT(
"Not implemented"); }
182 { MFEM_ABORT(
"Not implemented"); }
200 virtual int Id()
const {
return 2; }
218 virtual int Id()
const {
return 7; }
245 { MFEM_ABORT(
"Not implemented"); }
249 { MFEM_ABORT(
"Not implemented"); }
354 virtual int Id()
const {
return 77; }
374 virtual int Id()
const {
return 80; }
388 { MFEM_ABORT(
"Not implemented"); }
392 { MFEM_ABORT(
"Not implemented"); }
403 { MFEM_ABORT(
"Not implemented"); }
407 { MFEM_ABORT(
"Not implemented"); }
480 virtual int Id()
const {
return 302; }
498 virtual int Id()
const {
return 303; }
538 virtual int Id()
const {
return 313; }
556 virtual int Id()
const {
return 315; }
592 virtual int Id()
const {
return 321; }
633 virtual int Id()
const {
return 332; }
712 { MFEM_ABORT(
"Not implemented"); }
716 { MFEM_ABORT(
"Not implemented"); }
730 { MFEM_ABORT(
"Not implemented"); }
734 { MFEM_ABORT(
"Not implemented"); }
748 { MFEM_ABORT(
"Not implemented"); }
752 { MFEM_ABORT(
"Not implemented"); }
766 { MFEM_ABORT(
"Not implemented"); }
770 { MFEM_ABORT(
"Not implemented"); }
824 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
832 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
835 subtract(1.0 / (dist * dist), x, x0, d1);
841 MFEM_ASSERT(x.
Size() == x0.
Size(),
"Bad input.");
843 d2.
Diag(1.0 / (dist * dist), x.
Size());
849 class FiniteElementCollection;
850 class FiniteElementSpace;
851 class ParFiniteElementSpace;
891 const Vector &init_field) = 0;
965 comm = MPI_COMM_NULL;
1086 class ParGridFunction;
1215 int nodenum,
int idir,
1225 bool use_flag =
false);
1231 bool use_flag =
false);
1294 class TMOPNewtonSolver;
1418 double &metric_energy,
double &lim_energy,
1419 double &surf_fit_gf_energy);
1459 Vector &elfun,
const int nodenum,
const int idir,
1460 const double baseenergy,
bool update_stored);
1543 {
PA.enabled =
false; }
1731 for (
int i = 0; i <
tmopi.Size(); i++) {
delete tmopi[i]; }
1789 const TargetConstructor &tc,
1790 const Mesh &mesh, GridFunction &metric_gf);
Abstract class for all finite elements.
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
virtual double GetDerefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
void AssembleGradPA_2D(const Vector &) const
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 int Id() const
Return the metric ID.
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...
Shifted barrier form of metric 56 (area, ideal barrier metric), 2D.
Shifted barrier form of 3D metric 16 (volume, ideal barrier metric), 3D.
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).
InvariantsEvaluator3D< double > ie
virtual void SetInitialField(const Vector &init_nodes, const Vector &init_field)=0
void AddMultGradPA_C0_3D(const Vector &, Vector &) const
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 AddMultPA_C0_2D(const Vector &, Vector &) const
void AssembleElemVecSurfFit(const FiniteElement &el_x, IsoparametricTransformation &Tpr, DenseMatrix &mat)
void SetSerialMetaInfo(const Mesh &m, const FiniteElementCollection &fec, int num_comp)
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...
Class for an integration rule - an Array of IntegrationPoint.
VectorCoefficient * vector_tspec
virtual void AddMultGradPA(const Vector &, Vector &) const
Method for partially assembled gradient action.
void EnableFiniteDifferences(const GridFunction &x)
Enables FD-based approximation and computes dx.
const TargetType target_type
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).
Class for grid function - Vector with associated FE space.
virtual void AddMultPA(const Vector &, Vector &) const
Method for partially assembled action.
3D barrier Shape+Size (VS) metric.
InvariantsEvaluator3D< double > ie
InvariantsEvaluator3D< double > ie
InvariantsEvaluator2D< double > ie
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).
double GetSurfaceFittingWeight()
Get the surface fitting weight.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
3D barrier Shape+Size (VS) metric (polyconvex).
Base class for vector Coefficients that optionally depend on time and space.
double GetLocalStateEnergyPA_3D(const Vector &) const
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual ~TMOP_Metric_334()
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...
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 ~TMOP_Metric_333()
virtual void Eval_d2(const Vector &x, const Vector &x0, double dist, DenseMatrix &d2) const
Returns the Hessian of the limiting function f(x, x0, d) with respect to x.
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 ...
virtual int Id() const
Return the metric ID.
virtual int Id() const
Return the metric ID.
TMOP_AMetric_126(double gamma_)
virtual void AssemblePA(const FiniteElementSpace &)
Method defining partial assembly.
InvariantsEvaluator2D< double > ie
void EnableNormalization(const GridFunction &x)
Computes the normalization factors of the metric and limiting integrals using the mesh position given...
TMOP_QualityMetric & GetAMRQualityMetric()
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.
3D barrier Shape (S) metric.
TMOP_QualityMetric * metric
void SetAdaptivityEvaluator(AdaptivityEvaluator *ae)
virtual ~TMOP_Metric_332()
InvariantsEvaluator2D< double > ie
virtual ~TMOP_LimiterFunction()
Virtual destructor.
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 double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
const GridFunction * GetNodes() const
Get the nodes to be used in the target-matrix construction.
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
3D non-barrier Skew metric.
2D barrier Shape+Size (VS) metric (polyconvex).
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).
void ParUpdateAfterMeshTopologyChange()
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
IntegrationRules * IntegRules
virtual void ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
Computes reference-to-target transformation Jacobians for all quadrature points in all elements...
TMOP_QualityMetric * sz_metric
TMOP_QualityMetric * sh_metric
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 SetFDhScale(double dxscale_)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< double > ie
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
void SetMinSizeForTargets(double min_size_)
virtual void ComputeElementTargetsGradient(const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
Container class for integration rules.
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.
3D barrier Shape (S) metric.
void GetSurfaceFittingErrors(double &err_avg, double &err_max)
int Size() const
Returns the size of the vector.
void SetVolumeScale(double vol_scale)
Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
2D barrier shape (S) metric (polyconvex).
void EnableAdaptiveLimiting(const GridFunction &z0, Coefficient &coeff, AdaptivityEvaluator &ae)
Restriction of the node positions to certain regions.
virtual void AddMultPA(const Vector &, Vector &) const
Method for partially assembled action.
3D non-barrier Size (V) metric.
2D barrier size (V) metric (polyconvex).
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 SetIntegrationRules(IntegrationRules &irules, int order)
Prescribe a set of integration rules; relevant for mixed meshes.
InvariantsEvaluator3D< double > ie
virtual int Id() const
Return the metric ID.
void EnableNormalization(const GridFunction &x)
Normalization factor that considers all integrators in the combination.
2D barrier Shape+Size (VS) metric (polyconvex).
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...
bool IsSurfaceFittingEnabled()
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).
Abstract parallel finite element space.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void AssemblePA(const FiniteElementSpace &)
Method defining partial assembly.
virtual int Id() const
Return the metric ID.
InvariantsEvaluator2D< double > ie
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
const IntegrationRule * ir
void SetExactActionFlag(bool flag_)
Flag to control if exact action of Integration is effected.
InvariantsEvaluator2D< double > ie
void AssembleElementVectorFD(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
virtual int Id() const
Return the metric ID.
const GridFunction * nodes
virtual void SetSerialDiscreteTargetSkew(const GridFunction &tspec_)
void UpdateSurfaceFittingWeight(double factor)
Update the surface fitting weight as surf_fit_coeff *= factor;.
virtual int Id() const
Return the metric ID.
struct mfem::TMOP_Integrator::@13 PA
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 UpdateGradientTargetSpecification(const Vector &x, double dx, bool use_flag=false)
void SetRefinementSubElement(int amr_el_)
2D non-barrier Aspect ratio metric.
InvariantsEvaluator2D< double > ie
TMOP_Metric_080(double gamma_)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
2D barrier Shape+Size (VS) metric (not polyconvex).
TMOP_QualityMetric * sh_metric
Default limiter function in TMOP_Integrator.
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
virtual ~TMOP_AMetric_126()
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.
InvariantsEvaluator2D< double > ie
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
2D Shifted barrier form of shape metric (mu_2).
TMOP_Metric_313(double &mindet)
TMOP_Metric_352(double &t0)
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...
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_)
void UpdateTargetSpecification(const Vector &new_x, bool use_flag=false)
TMOPMatrixCoefficient(int dim)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
2D barrier shape (S) metric (not polyconvex).
virtual ~TMOP_QualityMetric()
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).
const GeometricFactors * geom
virtual void AddMultGradPA(const Vector &, Vector &) const
Method for partially assembled gradient action.
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.
2D barrier Size (V) metric (polyconvex).
Abstract class for local mesh quality metrics in the target-matrix optimization paradigm (TMOP) by P...
void FinalizeSerialDiscreteTargetSpec(const GridFunction &tspec_)
Coefficient * adapt_lim_coeff
virtual ~TMOPMatrixCoefficient()
virtual ~AdaptivityEvaluator()
void UpdateAfterMeshPositionChange(const Vector &new_x)
InvariantsEvaluator3D< double > ie
virtual void AddQualityMetric(TMOP_QualityMetric *tq, double wt=1.0)
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
virtual ~TMOP_Metric_080()
void SetDiscreteTargetBase(const GridFunction &tspec_)
AdaptivityEvaluator * adapt_lim_eval
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
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 AddMultGradPA_C0_2D(const Vector &, Vector &) const
InvariantsEvaluator3D< double > ie
void SetCoefficient(Coefficient &w1)
Sets a scaling Coefficient for the quality metric term of the integrator.
2D non-barrier size (V) metric (not polyconvex).
void UpdateTargetSpecificationAtNode(const FiniteElement &el, ElementTransformation &T, int nodenum, int idir, const Vector &IntData)
TMOP_QualityMetric * sh_metric
void AssembleDiagonalPA_C0_2D(Vector &) const
void SetTspecFromIntRule(int e_id, const IntegrationRule &intrule)
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 Append(const T &el)
Append element 'el' to array, resize if necessary.
TargetConstructor(TargetType ttype)
Constructor for use in serial.
TargetType GetTargetType() const
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 double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
3D barrier Size (V) metric.
DiscreteAdaptTC(TargetType ttype)
void ResetRefinementTspecData()
void AssembleDiagonalPA_3D(Vector &) const
InvariantsEvaluator2D< double > ie
void ClearGeometricFactors()
void SetNodes(const GridFunction &n)
Set the nodes to be used in the target-matrix construction.
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)
void AssembleDiagonalPA_2D(Vector &) const
TMOP_QualityMetric * sz_metric
virtual void AssembleGradDiagonalPA(Vector &) const
Method for computing the diagonal of the gradient with partial assembly.
const TargetConstructor * targetC
Array< Vector * > ElemPertEnergy
const GridFunction * lim_nodes0
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
const ParGridFunction * adapt_lim_pgf0
TMOP_QualityMetric * sz_metric
TMOP_QualityMetric * sh_metric
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 int Id() const
Return the metric ID.
Abstract class used to define combination of metrics with constant coefficients.
InvariantsEvaluator2D< double > ie
virtual void AssembleGradPA(const Vector &, const FiniteElementSpace &)
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void SetParDiscreteTargetAspectRatio(const ParGridFunction &tspec_)
virtual void AssembleGradPA(const Vector &, const FiniteElementSpace &)
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
virtual ~TargetConstructor()
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void ParEnableNormalization(const ParGridFunction &x)
InvariantsEvaluator2D< double > ie
double GetLocalStateEnergyPA_2D(const Vector &) const
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
virtual double GetLocalStateEnergyPA(const Vector &) const
Compute the local (to the MPI rank) energy with partial assembly.
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
GridFunction * GetTSpecData()
Get the entire 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...
FiniteElementSpace * tspec_fesv
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...
Coefficient * metric_coeff
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleElemGradSurfFit(const FiniteElement &el_x, IsoparametricTransformation &Tpr, DenseMatrix &mat)
virtual bool ContainsVolumeInfo() const
Checks if the target matrices contain non-trivial size specification.
TMOP_QualityMetric * h_metric
Array< TMOP_QualityMetric * > tmop_q_arr
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void RestoreTargetSpecificationAtNode(ElementTransformation &T, int nodenum)
void AssemblePA_Limiting()
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
TMOP_QualityMetric * sh_metric
2D barrier Shape+Orientation (OS) metric (polyconvex).
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void SetTspecAtIndex(int idx, const GridFunction &tspec_)
virtual double GetRefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, const IntegrationRule &irule)
Computes the mean of the energies of the given element's children.
void ComputeAvgVolume() const
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
3D barrier Shape+Size (VS) metric (polyconvex).
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
InvariantsEvaluator2D< double > ie
TMOP_Metric_328(double gamma_)
virtual double Eval(const Vector &x, const Vector &x0, double dist) const
Returns the limiting function, f(x, x0, d).
AdaptivityEvaluator * surf_fit_eval
virtual ~TMOP_QuadraticLimiter()
FiniteElementSpace * GetTSpecFESpace()
Get the FESpace associated with tspec.
2D barrier (not a shape) metric (polyconvex).
TMOP_QualityMetric * sz_metric
virtual void SetTargetJacobian(const DenseMatrix &Jtr_)
Specify the reference-element -> target-element Jacobian matrix for the point of interest.
TMOP_Metric_211(double epsilon=1e-4)
void UpdateHessianTargetSpecification(const Vector &x, double dx, bool use_flag=false)
virtual void AssembleGradDiagonalPA(Vector &) const
Method for computing the diagonal of the gradient with partial assembly.
void AssembleElemGradAdaptLim(const FiniteElement &el, IsoparametricTransformation &Tpr, const IntegrationRule &ir, const Vector &weights, DenseMatrix &m)
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
const DofToQuad * maps_lim
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
3D Size (V) untangling metric.
virtual void SetTargetJacobian(const DenseMatrix &Jtr_)
Specify the reference-element -> target-element Jacobian matrix for the point of interest.
2D barrier size (V) metric (polyconvex).
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
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...
void subtract(const Vector &x, const Vector &y, Vector &z)
TMOPMatrixCoefficient * matrix_tspec
virtual double GetLocalStateEnergyPA(const Vector &) const
Compute the local (to the MPI rank) energy with partial assembly.
TMOP_Metric_333(double gamma_)
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
virtual void ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
Computes reference-to-target transformation Jacobians for all quadrature points in all elements...
Base class for Matrix Coefficients that optionally depend on time and space.
InvariantsEvaluator2D< double > ie
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void ReleasePADeviceMemory(bool copy_to_host=true)
bool UsesPhysicalCoordinates() const
Return true if the methods ComputeElementTargets(), ComputeAllElementTargets(), and ComputeElementTar...
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 Clear()
Delete the matrix data array (if owned) and reset the matrix state.
double GetLocalStateEnergyPA_C0_2D(const Vector &) const
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
double DistanceSquaredTo(const double *p) const
Compute the square of the Euclidean distance to another vector.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
DiscreteAdaptTC * GetDiscreteAdaptTC() const
void AddMultGradPA_2D(const Vector &, Vector &) const
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
TMOP_Metric_252(double &t0)
Note that t0 is stored by reference.
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).
virtual int Id() const
Return the metric ID.
void ResetUpdateFlags()
Used in combination with the Update methods to avoid extra computations.
virtual int Id() const
Return the metric ID.
AnalyticAdaptTC(TargetType ttype)
InvariantsEvaluator3D< double > ie
void AddTMOPIntegrator(TMOP_Integrator *ti)
Adds a new TMOP_Integrator to the combination.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
2D non-barrier Skew metric.
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).
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).
void UpdateAfterMeshTopologyChange()
void AddMultPA_3D(const Vector &, Vector &) const
InvariantsEvaluator3D< double > ie
2D barrier Shape+Size (VS) metric (not polyconvex).
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AddMultPA_2D(const Vector &, Vector &) const
void SetTransformation(ElementTransformation &)
The method SetTransformation() is hidden for TMOP_QualityMetrics, because it is not used...
void ComputeFDh(const Vector &x, const FiniteElementSpace &fes)
Determines the perturbation, h, for FD-based approximation.
void AssembleGradPA_C0_2D(const Vector &) const
void ComputeNormalizationEnergies(const GridFunction &x, double &metric_energy, double &lim_energy, double &surf_fit_gf_energy)
TMOP_Metric_334(double gamma_)
virtual double Eval(const Vector &x, const Vector &x0, double d) const =0
Returns the limiting function, f(x, x0, d).
Coefficient * surf_fit_coeff
Class for integration point with weight.
AdaptivityEvaluator * adapt_eval
ParFiniteElementSpace * ptspec_fesv
InvariantsEvaluator3D< 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...
void AssembleDiagonalPA_C0_3D(Vector &) const
const FiniteElementSpace * fes
Array< TMOP_Integrator * > tmopi
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...
TMOP_Integrator(TMOP_QualityMetric *m, TargetConstructor *tc, TMOP_QualityMetric *hm)
void Diag(double c, int n)
Creates n x n diagonal matrix with diagonal elements c.
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...
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)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
2D barrier Shape+Size+Orientation (VOS) metric (polyconvex).
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 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).
3D Shape (S) metric, untangling version of 303.
virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
Computes the integral of W(Jacobian(Trt)) over a target zone.
void AssembleElemVecAdaptLim(const FiniteElement &el, IsoparametricTransformation &Tpr, const IntegrationRule &ir, const Vector &weights, DenseMatrix &mat)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void ParUpdateAfterMeshTopologyChange()
virtual double GetDerefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
void AssembleGradPA_3D(const Vector &) const
void Destroy()
Destroy a vector.
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.
void AddMultGradPA_3D(const Vector &, Vector &) const
void ComputeAllElementTargets_Fallback(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
3D non-barrier Aspect ratio metric.
const Vector & GetTspecPert2H()
const Vector & GetTspecPert1H()
void AssembleElementGradFD(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
ParFiniteElementSpace * GetTSpecParFESpace()
TMOP_QualityMetric * sz_metric
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
TMOP_QualityMetric * sh_metric
Abstract class for hyperelastic models.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
bool ComputeAllElementTargets(const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
GridFunction * adapt_lim_gf
TargetConstructor(TargetType ttype, MPI_Comm mpicomm)
Constructor for use in parallel.
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...
GridFunction * surf_fit_gf
void ComputeAllElementTargets(const Vector &xe=Vector()) const
TMOP_Integrator(TMOP_QualityMetric *m, TargetConstructor *tc)
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void FinalizeParDiscreteTargetSpec(const ParGridFunction &tspec_)
virtual int Id() const
Return the metric ID.
ParGridFunction * tspec_pgf
void GetDiscreteTargetSpec(GridFunction &tspec_, int idx)
Get one of the discrete fields from tspec.
const Array< bool > * surf_fit_marker
TMOP_Metric_022(double &t0)
3D barrier Shape+Size (VS) metric (polyconvex).
InvariantsEvaluator3D< double > ie
void SetTspecDataForDerefinement(FiniteElementSpace *fes)
Computes target specification data with respect to the coarse FE space.
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
TargetType
Target-matrix construction algorithms supported by this class.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
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.
double GetLocalStateEnergyPA_C0_3D(const Vector &) const
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).
TMOP_Metric_311(double epsilon=1e-4)
virtual void SetSerialDiscreteTargetSpec(const GridFunction &tspec_)
InvariantsEvaluator3D< double > ie
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 Eval_d1(const Vector &x, const Vector &x0, double dist, Vector &d1) const
Returns the gradient of the limiting function f(x, x0, d) with respect to x.
virtual double GetRefinementElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, const IntegrationRule &irule)
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
virtual int Id() const
Return the metric ID.
virtual void SetParDiscreteTargetOrientation(const ParGridFunction &tspec_)
Class for parallel grid function.
Base class representing target-matrix construction algorithms for mesh optimization via the target-ma...
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
void AddMultPA_C0_3D(const Vector &, Vector &) const
virtual ~DiscreteAdaptTC()
TMOP_Metric_332(double gamma_)
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void SetAnalyticTargetSpec(Coefficient *sspec, VectorCoefficient *vspec, TMOPMatrixCoefficient *mspec)
3D barrier Shape+Size (VS) metric (polyconvex).
Rank 3 tensor (array of matrices)
Class for parallel meshes.
virtual void SetSerialDiscreteTargetSize(const GridFunction &tspec_)
TMOP_QualityMetric * sz_metric
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
TMOP_LimiterFunction * lim_func
const Array< TMOP_Integrator * > & GetTMOPIntegrators() const
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
const GridFunction * adapt_lim_gf0
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
2D barrier Shape+Orientation (OS) metric (polyconvex).
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 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
void UpdateAfterMeshTopologyChange()
Update all discrete fields based on tspec and update for AMR.
void ResetDerefinementTspecData()
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
3D barrier Shape (S) metric.
void AssembleGradPA_C0_3D(const Vector &) const
2D non-barrier metric without a type.
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 ~TMOP_Metric_328()
FiniteElementSpace * coarse_tspec_fesv
A TMOP integrator class based on any given TMOP_QualityMetric and TargetConstructor.
2D non-barrier Shape+Size+Orientation (VOS) metric (polyconvex).