MFEM  v3.4
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tmop.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_TMOP_HPP
13 #define MFEM_TMOP_HPP
14 
15 #include "../config/config.hpp"
16 #include "../linalg/invariants.hpp"
17 #include "nonlininteg.hpp"
18 
19 namespace mfem
20 {
21 
22 /** @brief Abstract class for local mesh quality metrics in the target-matrix
23  optimization paradigm (TMOP) by P. Knupp et al. */
25 {
26 protected:
27  const DenseMatrix *Jtr; /**< Jacobian of the reference-element to
28  target-element transformation. */
29 
30  /** @brief The method SetTransformation() is hidden for TMOP_QualityMetric%s,
31  because it is not used. */
33 
34 public:
35  TMOP_QualityMetric() : Jtr(NULL) { }
36  virtual ~TMOP_QualityMetric() { }
37 
38  /** @brief Specify the reference-element -> target-element Jacobian matrix
39  for the point of interest.
40 
41  The specified Jacobian matrix, #Jtr, can be used by metrics that cannot
42  be written just as a function of the target->physical Jacobian matrix,
43  Jpt. */
44  void SetTargetJacobian(const DenseMatrix &_Jtr) { Jtr = &_Jtr; }
45 
46  /** @brief Evaluate the strain energy density function, W = W(Jpt).
47  @param[in] Jpt Represents the target->physical transformation
48  Jacobian matrix. */
49  virtual double EvalW(const DenseMatrix &Jpt) const = 0;
50 
51  /** @brief Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
52  @param[in] Jpt Represents the target->physical transformation
53  Jacobian matrix.
54  @param[out] P The evaluated 1st Piola-Kirchhoff stress tensor. */
55  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const = 0;
56 
57  /** @brief Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor
58  and assemble its contribution to the local gradient matrix 'A'.
59  @param[in] Jpt Represents the target->physical transformation
60  Jacobian matrix.
61  @param[in] DS Gradient of the basis matrix (dof x dim).
62  @param[in] weight Quadrature weight coefficient for the point.
63  @param[in,out] A Local gradient matrix where the contribution from this
64  point will be added.
65 
66  Computes weight * d(dW_dxi)_d(xj) at the current point, for all i and j,
67  where x1 ... xn are the FE dofs. This function is usually defined using
68  the matrix invariants and their derivatives.
69  */
70  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
71  const double weight, DenseMatrix &A) const = 0;
72 };
73 
74 
75 /// Metric without a type, 2D
77 {
78 protected:
80 
81 public:
82  // W = |J|^2.
83  virtual double EvalW(const DenseMatrix &Jpt) const;
84 
85  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
86 
87  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
88  const double weight, DenseMatrix &A) const;
89 };
90 
91 /// Shape, ideal barrier metric, 2D
93 {
94 protected:
96 
97 public:
98  // W = 0.5|J|^2 / det(J) - 1.
99  virtual double EvalW(const DenseMatrix &Jpt) const;
100 
101  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
102 
103  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
104  const double weight, DenseMatrix &A) const;
105 };
106 
107 /// Shape & area, ideal barrier metric, 2D
109 {
110 protected:
112 
113 public:
114  // W = |J - J^-t|^2.
115  virtual double EvalW(const DenseMatrix &Jpt) const;
116 
117  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
118 
119  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
120  const double weight, DenseMatrix &A) const;
121 };
122 
123 /// Shape & area metric, 2D
125 {
126 protected:
128 
129 public:
130  // W = det(J) * |J - J^-t|^2.
131  virtual double EvalW(const DenseMatrix &Jpt) const;
132 
133  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
134 
135  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
136  const double weight, DenseMatrix &A) const;
137 };
138 
139 /// Shifted barrier form of metric 2 (shape, ideal barrier metric), 2D
141 {
142 protected:
143  double &tau0;
145 
146 public:
147  TMOP_Metric_022(double &t0): tau0(t0) {}
148 
149  // W = 0.5(|J|^2 - 2det(J)) / (det(J) - tau0).
150  virtual double EvalW(const DenseMatrix &Jpt) const;
151 
152  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
153 
154  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
155  const double weight, DenseMatrix &A) const;
156 };
157 
158 /// Shape, ideal barrier metric, 2D
160 {
161 protected:
163 
164 public:
165  // W = 0.5|J^t J|^2 / det(J)^2 - 1.
166  virtual double EvalW(const DenseMatrix &Jpt) const;
167 
168  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
169 
170  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
171  const double weight, DenseMatrix &A) const;
172 };
173 
174 /// Area metric, 2D
176 {
177 protected:
179 
180 public:
181  // W = (det(J) - 1)^2.
182  virtual double EvalW(const DenseMatrix &Jpt) const;
183 
184  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
185 
186  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
187  const double weight, DenseMatrix &A) const;
188 
189 };
190 
191 /// Area, ideal barrier metric, 2D
193 {
194 protected:
196 
197 public:
198  // W = 0.5( sqrt(det(J)) - 1 / sqrt(det(J)) )^2
199  // = 0.5( det(J) - 1 )^2 / det(J)
200  // = 0.5( det(J) + 1/det(J) ) - 1.
201  virtual double EvalW(const DenseMatrix &Jpt) const;
202 
203  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
204 
205  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
206  const double weight, DenseMatrix &A) const;
207 
208 };
209 
210 /// Shape, ideal barrier metric, 2D
212 {
213 protected:
215 
216 public:
217  // W = |J^t J|^2 / det(J)^2 - 2|J|^2 / det(J) + 2
218  // = I1b (I1b - 2).
219  virtual double EvalW(const DenseMatrix &Jpt) const;
220 
221  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
222 
223  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
224  const double weight, DenseMatrix &A) const;
225 
226 };
227 
228 /// Area, ideal barrier metric, 2D
230 {
231 protected:
233 
234 public:
235  // W = 0.5(det(J) - 1 / det(J))^2.
236  virtual double EvalW(const DenseMatrix &Jpt) const;
237 
238  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
239 
240  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
241  const double weight, DenseMatrix &A) const;
242 
243 };
244 
245 /// Untangling metric, 2D
247 {
248 protected:
249  const double eps;
251 
252 public:
253  TMOP_Metric_211(double epsilon = 1e-4) : eps(epsilon) { }
254 
255  // W = (det(J) - 1)^2 - det(J) + sqrt(det(J)^2 + eps).
256  virtual double EvalW(const DenseMatrix &Jpt) const;
257 
258  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
259 
260  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
261  const double weight, DenseMatrix &A) const;
262 };
263 
264 /// Shifted barrier form of metric 56 (area, ideal barrier metric), 2D
266 {
267 protected:
268  double &tau0;
270 
271 public:
272  /// Note that @a t0 is stored by reference
273  TMOP_Metric_252(double &t0): tau0(t0) {}
274 
275  // W = 0.5(det(J) - 1)^2 / (det(J) - tau0).
276  virtual double EvalW(const DenseMatrix &Jpt) const;
277 
278  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
279 
280  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
281  const double weight, DenseMatrix &A) const;
282 };
283 
284 /// Shape, ideal barrier metric, 3D
286 {
287 protected:
289 
290 public:
291  // W = |J| |J^-1| / 3 - 1.
292  virtual double EvalW(const DenseMatrix &Jpt) const;
293 
294  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
295 
296  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
297  const double weight, DenseMatrix &A) const;
298 };
299 
300 /// Shape, ideal barrier metric, 3D
302 {
303 protected:
305 
306 public:
307  // W = |J|^2 |J^-1|^2 / 9 - 1.
308  virtual double EvalW(const DenseMatrix &Jpt) const;
309 
310  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
311 
312  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
313  const double weight, DenseMatrix &A) const;
314 };
315 
316 /// Shape, ideal barrier metric, 3D
318 {
319 protected:
321 
322 public:
323  // W = |J|^2 / 3 * det(J)^(2/3) - 1.
324  virtual double EvalW(const DenseMatrix &Jpt) const;
325 
326  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
327 
328  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
329  const double weight, DenseMatrix &A) const;
330 };
331 
332 /// Volume metric, 3D
334 {
335 protected:
337 
338 public:
339  // W = (det(J) - 1)^2.
340  virtual double EvalW(const DenseMatrix &Jpt) const;
341 
342  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
343 
344  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
345  const double weight, DenseMatrix &A) const;
346 };
347 
348 /// Volume, ideal barrier metric, 3D
350 {
351 protected:
353 
354 public:
355  // W = 0.5( sqrt(det(J)) - 1 / sqrt(det(J)) )^2
356  // = 0.5( det(J) - 1 )^2 / det(J)
357  // = 0.5( det(J) + 1/det(J) ) - 1.
358  virtual double EvalW(const DenseMatrix &Jpt) const;
359 
360  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
361 
362  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
363  const double weight, DenseMatrix &A) const;
364 };
365 
366 /// Shape & volume, ideal barrier metric, 3D
368 {
369 protected:
371 
372 public:
373  // W = |J - J^-t|^2.
374  virtual double EvalW(const DenseMatrix &Jpt) const;
375 
376  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
377 
378  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
379  const double weight, DenseMatrix &A) const;
380 };
381 
382 /// Shifted barrier form of 3D metric 16 (volume, ideal barrier metric), 3D
384 {
385 protected:
386  double &tau0;
388 
389 public:
390  TMOP_Metric_352(double &t0): tau0(t0) {}
391 
392  // W = 0.5(det(J) - 1)^2 / (det(J) - tau0).
393  virtual double EvalW(const DenseMatrix &Jpt) const;
394 
395  virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const;
396 
397  virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
398  const double weight, DenseMatrix &A) const;
399 };
400 
401 
402 /** @brief Base class representing target-matrix construction algorithms for
403  mesh optimization via the target-matrix optimization paradigm (TMOP). */
404 /** This class is used by class TMOP_Integrator to construct the target Jacobian
405  matrices (reference-element to target-element) at quadrature points. It
406  supports a set of algorithms chosen by the #TargetType enumeration.
407 
408  New target-matrix construction algorithms can be defined by deriving new
409  classes and overriding the method ComputeElementTargets(). */
411 {
412 public:
413  /// Target-matrix construction algorithms supported by this class.
415  {
417  Ideal shape, unit size; the nodes are not used. */
419  Ideal shape, equal size/volume; the given nodes define the total target
420  volume; for each mesh element, the target volume is the average volume
421  multiplied by the volume scale, set with SetVolumeScale(). */
423  Ideal shape, given size/volume; the given nodes define the target
424  volume at all quadrature points. */
426  Given shape, given size/volume; the given nodes define the exact target
427  Jacobian matrix at all quadrature points. */
428  };
429 
430 protected:
431  // Nodes that are used in ComputeElementTargets(), depending on target_type.
432  const GridFunction *nodes; // not owned
433  mutable double avg_volume;
434  double volume_scale;
436 
437 #ifdef MFEM_USE_MPI
438  MPI_Comm comm;
439  bool Parallel() const { return (comm != MPI_COMM_NULL); }
440 #else
441  bool Parallel() const { return false; }
442 #endif
443 
444  // should be called only if avg_volume == 0.0, i.e. avg_volume is not
445  // computed yet
446  void ComputeAvgVolume() const;
447 
448 public:
449  /// Constructor for use in serial
451  : nodes(NULL), avg_volume(), volume_scale(1.0), target_type(ttype)
452  {
453 #ifdef MFEM_USE_MPI
454  comm = MPI_COMM_NULL;
455 #endif
456  }
457 #ifdef MFEM_USE_MPI
458  /// Constructor for use in parallel
459  TargetConstructor(TargetType ttype, MPI_Comm mpicomm)
460  : nodes(NULL), avg_volume(), volume_scale(1.0), target_type(ttype),
461  comm(mpicomm) { }
462 #endif
463  virtual ~TargetConstructor() { }
464 
465  /** @brief Set the nodes to be used in the target-matrix construction.
466 
467  This method should be called every time the target nodes are updated
468  externally and recomputation of the target average volume is needed. The
469  nodes are used by all target types except IDEAL_SHAPE_UNIT_SIZE. */
470  void SetNodes(const GridFunction &n) { nodes = &n; avg_volume = 0.0; }
471 
472  /// Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
473  void SetVolumeScale(double vol_scale) { volume_scale = vol_scale; }
474 
475  /** @brief Given an element and quadrature rule, computes ref->target
476  transformation Jacobians for each quadrature point in the element. */
477  virtual void ComputeElementTargets(int e_id, const FiniteElement &fe,
478  const IntegrationRule &ir,
479  DenseTensor &Jtr) const;
480 };
481 
482 
483 /** @brief A TMOP integrator class based on any given TMOP_QualityMetric and
484  TargetConstructor.
485 
486  Represents @f$ \int W(Jpt) dx @f$ over a target zone, where W is the
487  metric's strain energy density function, and Jpt is the Jacobian of the
488  target->physical coordinates transformation. The virtual target zone is
489  defined by the TargetConstructor. */
491 {
492 protected:
493  TMOP_QualityMetric *metric; // not owned
494  const TargetConstructor *targetC; // not owned
495 
496  // Weight Coefficient multiplying the quality metric term.
497  Coefficient *coeff1; // not owned, if NULL -> coeff1 is 1.
498 
499  // Nodes and weight Coefficient used for "limiting" the TMOP_Integrator.
500  const GridFunction *nodes0; // not owned
501  Coefficient *coeff0; // not owned, if NULL -> coeff0 is 0, i.e. no limiting
502 
503  // Jrt: the inverse of the ref->target Jacobian, Jrt = Jtr^{-1}.
504  // Jpr: the ref->physical transformation Jacobian, Jpr = PMatI^t DS.
505  // Jpt: the target->physical transformation Jacobian, Jpt = Jpr Jrt.
506  // P: represents dW_d(Jtp) (dim x dim).
507  // DSh: gradients of reference shape functions (dof x dim).
508  // DS: gradients of the shape functions in the target configuration,
509  // DS = DSh Jrt (dof x dim).
510  // PMatI: current coordinates of the nodes (dof x dim).
511  // PMat0: reshaped view into the local element contribution to the operator
512  // output - the result of AssembleElementVector() (dof x dim).
514 
515 public:
516  /** @param[in] m TMOP_QualityMetric that will be integrated (not owned).
517  @param[in] tc Target-matrix construction algorithm to use (not owned). */
519  : metric(m), targetC(tc),
520  coeff1(NULL), nodes0(NULL), coeff0(NULL) { }
521 
522  /// Sets a scaling Coefficient for the quality metric term of the integrator.
523  /** With this addition, the integrator becomes
524  @f$ \int w1 W(Jpt) dx @f$.
525 
526  Note that the Coefficient is evaluated in the physical configuration and
527  not in the target configuration which may be undefined. */
528  void SetCoefficient(Coefficient &w1) { coeff1 = &w1; }
529 
530  /// Adds a limiting term to the integrator.
531  /** With this addition, the integrator becomes
532  @f$ \int w1 W(Jpt) + w0/2 (x - x_0)^2 dx @f$,
533  where the second term measures the change with respect to the original
534  physical positions, @a n0.
535  @param[in] n0 Original mesh node coordinates.
536  @param[in] w0 Coefficient scaling the limiting term. */
538  {
539  nodes0 = &n0;
540  coeff0 =&w0;
541  }
542 
543  /// Update the original/reference nodes used for limiting.
544  void SetLimitingNodes(const GridFunction &n0) { nodes0 = &n0; }
545 
546  /** @brief Computes the integral of W(Jacobian(Trt)) over a target zone.
547  @param[in] el Type of FiniteElement.
548  @param[in] T Mesh element transformation.
549  @param[in] elfun Physical coordinates of the zone. */
550  virtual double GetElementEnergy(const FiniteElement &el,
552  const Vector &elfun);
553 
554  virtual void AssembleElementVector(const FiniteElement &el,
556  const Vector &elfun, Vector &elvect);
557 
558  virtual void AssembleElementGrad(const FiniteElement &el,
560  const Vector &elfun, DenseMatrix &elmat);
561 };
562 
563 
564 /// Interpolates the @a metric's values at the nodes of @a metric_gf.
565 /** Assumes that @a metric_gf's FiniteElementSpace is initialized. */
566 void InterpolateTMOP_QualityMetric(TMOP_QualityMetric &metric,
567  const TargetConstructor &tc,
568  const Mesh &mesh, GridFunction &metric_gf);
569 
570 }
571 
572 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:140
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:232
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...
Definition: tmop.cpp:156
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...
Definition: tmop.cpp:32
Shifted barrier form of metric 56 (area, ideal barrier metric), 2D.
Definition: tmop.hpp:265
Shifted barrier form of 3D metric 16 (volume, ideal barrier metric), 3D.
Definition: tmop.hpp:383
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:137
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...
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:83
const TargetType target_type
Definition: tmop.hpp:435
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:27
DenseMatrix PMatO
Definition: tmop.hpp:513
Shape &amp; volume, ideal barrier metric, 3D.
Definition: tmop.hpp:367
const DenseMatrix * Jtr
Definition: tmop.hpp:27
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:370
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:451
DenseMatrix Jrt
Definition: tmop.hpp:513
Coefficient * coeff0
Definition: tmop.hpp:501
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:178
void InterpolateTMOP_QualityMetric(TMOP_QualityMetric &metric, const TargetConstructor &tc, const Mesh &mesh, GridFunction &metric_gf)
Interpolates the metric&#39;s values at the nodes of metric_gf.
Definition: tmop.cpp:987
Shape, ideal barrier metric, 3D.
Definition: tmop.hpp:317
TMOP_QualityMetric * metric
Definition: tmop.hpp:493
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:195
virtual double EvalW(const DenseMatrix &Jpt) const =0
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...
Definition: tmop.cpp:578
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:505
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:42
DenseMatrix Jpr
Definition: tmop.hpp:513
virtual void ComputeElementTargets(int e_id, const FiniteElement &fe, const IntegrationRule &ir, DenseTensor &Jtr) const
Given an element and quadrature rule, computes ref-&gt;target transformation Jacobians for each quadratu...
Definition: tmop.cpp:686
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:361
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:79
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:441
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
Shape, ideal barrier metric, 3D.
Definition: tmop.hpp:301
void SetVolumeScale(double vol_scale)
Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
Definition: tmop.hpp:473
Shape, ideal barrier metric, 2D.
Definition: tmop.hpp:92
Volume metric, 3D.
Definition: tmop.hpp:333
Area, ideal barrier metric, 2D.
Definition: tmop.hpp:229
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...
Definition: tmop.cpp:373
Coefficient * coeff1
Definition: tmop.hpp:497
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:127
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:214
const GridFunction * nodes
Definition: tmop.hpp:432
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:567
Shape &amp; area, ideal barrier metric, 2D.
Definition: tmop.hpp:108
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:244
Shifted barrier form of metric 2 (shape, ideal barrier metric), 2D.
Definition: tmop.hpp:140
TMOP_Metric_352(double &t0)
Definition: tmop.hpp:390
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:397
void SetTargetJacobian(const DenseMatrix &_Jtr)
Specify the reference-element -&gt; target-element Jacobian matrix for the point of interest.
Definition: tmop.hpp:44
Shape, ideal barrier metric, 2D.
Definition: tmop.hpp:211
virtual ~TMOP_QualityMetric()
Definition: tmop.hpp:36
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...
Definition: tmop.cpp:487
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...
Definition: tmop.cpp:260
Abstract class for local mesh quality metrics in the target-matrix optimization paradigm (TMOP) by P...
Definition: tmop.hpp:24
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:336
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:534
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:331
void SetCoefficient(Coefficient &w1)
Sets a scaling Coefficient for the quality metric term of the integrator.
Definition: tmop.hpp:528
Area metric, 2D.
Definition: tmop.hpp:175
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...
Definition: tmop.cpp:202
TargetConstructor(TargetType ttype)
Constructor for use in serial.
Definition: tmop.hpp:450
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...
Definition: tmop.cpp:231
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:104
Volume, ideal barrier metric, 3D.
Definition: tmop.hpp:349
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:250
void SetNodes(const GridFunction &n)
Set the nodes to be used in the target-matrix construction.
Definition: tmop.hpp:470
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:475
const TargetConstructor * targetC
Definition: tmop.hpp:494
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:340
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...
Definition: tmop.cpp:290
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:144
virtual ~TargetConstructor()
Definition: tmop.hpp:463
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:303
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:269
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
Definition: tmop.cpp:825
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...
Definition: tmop.cpp:79
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:26
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:71
void ComputeAvgVolume() const
Definition: tmop.cpp:648
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:556
Shape, ideal barrier metric, 2D.
Definition: tmop.hpp:159
TMOP_Metric_211(double epsilon=1e-4)
Definition: tmop.hpp:253
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &T, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
Definition: tmop.cpp:910
Untangling metric, 2D.
Definition: tmop.hpp:246
const double eps
Definition: tmop.hpp:249
Area, ideal barrier metric, 2D.
Definition: tmop.hpp:192
void SetLimitingNodes(const GridFunction &n0)
Update the original/reference nodes used for limiting.
Definition: tmop.hpp:544
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:310
Base class Coefficient that may optionally depend on time.
Definition: coefficient.hpp:31
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:387
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:162
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...
Definition: tmop.cpp:54
void EnableLimiting(const GridFunction &n0, Coefficient &w0)
Adds a limiting term to the integrator.
Definition: tmop.hpp:537
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:183
TMOP_Metric_252(double &t0)
Note that t0 is stored by reference.
Definition: tmop.hpp:273
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:215
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:353
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:274
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:64
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...
Definition: tmop.cpp:121
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...
Definition: tmop.cpp:513
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:282
DenseMatrix PMatI
Definition: tmop.hpp:513
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:352
Shape &amp; area metric, 2D.
Definition: tmop.hpp:124
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:112
void SetTransformation(ElementTransformation &)
The method SetTransformation() is hidden for TMOP_QualityMetrics, because it is not used...
Definition: tmop.hpp:32
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:288
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...
Definition: tmop.cpp:459
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:252
virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &T, const Vector &elfun)
Computes the integral of W(Jacobian(Trt)) over a target zone.
Definition: tmop.cpp:748
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:20
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:526
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:95
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...
Definition: tmop.cpp:406
InvariantsEvaluator2D< double > ie
Definition: tmop.hpp:111
Abstract class for hyperelastic models.
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:146
TargetConstructor(TargetType ttype, MPI_Comm mpicomm)
Constructor for use in parallel.
Definition: tmop.hpp:459
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...
Definition: tmop.cpp:542
double epsilon(const Vector &x)
Definition: maxwell.cpp:90
TMOP_Integrator(TMOP_QualityMetric *m, TargetConstructor *tc)
Definition: tmop.hpp:518
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:391
Vector data type.
Definition: vector.hpp:48
DenseMatrix DSh
Definition: tmop.hpp:513
DenseMatrix DS
Definition: tmop.hpp:513
TMOP_Metric_022(double &t0)
Definition: tmop.hpp:147
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:320
const GridFunction * nodes0
Definition: tmop.hpp:500
TargetType
Target-matrix construction algorithms supported by this class.
Definition: tmop.hpp:414
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:223
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...
Definition: tmop.cpp:345
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:194
Base class representing target-matrix construction algorithms for mesh optimization via the target-ma...
Definition: tmop.hpp:410
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:48
Rank 3 tensor (array of matrices)
Definition: densemat.hpp:638
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:497
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:481
InvariantsEvaluator3D< double > ie
Definition: tmop.hpp:304
DenseMatrix Jpt
Definition: tmop.hpp:513
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
Definition: tmop.cpp:612
DenseMatrix P
Definition: tmop.hpp:513
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...
Definition: tmop.cpp:624
bool Parallel() const
Definition: tmop.hpp:439
Shape, ideal barrier metric, 3D.
Definition: tmop.hpp:285
Metric without a type, 2D.
Definition: tmop.hpp:76
virtual double EvalW(const DenseMatrix &Jpt) const
Evaluate the strain energy density function, W = W(Jpt).
Definition: tmop.cpp:604
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...
Definition: tmop.cpp:319
A TMOP integrator class based on any given TMOP_QualityMetric and TargetConstructor.
Definition: tmop.hpp:490