MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
eltrans.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_ELEMENTTRANSFORM
13 #define MFEM_ELEMENTTRANSFORM
14 
15 #include "../config/config.hpp"
16 #include "../linalg/linalg.hpp"
17 #include "intrules.hpp"
18 #include "fe.hpp"
19 
20 namespace mfem
21 {
22 
24 {
25 protected:
29  double Wght;
30  int EvalState;
32  {
38  };
40 
41  /** @brief Evaluate the Jacobian of the transformation at the IntPoint and
42  store it in dFdx. */
43  virtual const DenseMatrix &EvalJacobian() = 0;
44 
45  /** @brief Evaluate the Hessian of the transformation at the IntPoint and
46  store it in d2Fdx2. */
47  virtual const DenseMatrix &EvalHessian() = 0;
48 
49  double EvalWeight();
50  const DenseMatrix &EvalAdjugateJ();
51  const DenseMatrix &EvalInverseJ();
52 
53 public:
54 
55  /** This enumeration declares the values stored in
56  ElementTransformation::ElementType and indicates which group of objects
57  the index stored in ElementTransformation::ElementNo refers:
58 
59  | ElementType | Range of ElementNo
60  +-------------+-------------------------
61  | ELEMENT | [0, Mesh::GetNE() )
62  | BDR_ELEMENT | [0, Mesh::GetNBE() )
63  | EDGE | [0, Mesh::GetNEdges() )
64  | FACE | [0, Mesh::GetNFaces() )
65  | BDR_FACE | [0, Mesh::GetNBE() )
66  */
67  enum
68  {
69  ELEMENT = 1,
71  EDGE = 3,
72  FACE = 4,
74  };
75 
77 
79 
80  /** @brief Force the reevaluation of the Jacobian in the next call. */
81  void Reset() { EvalState = 0; }
82 
83  /** @brief Set the integration point @a ip that weights and Jacobians will
84  be evaluated at. */
85  void SetIntPoint(const IntegrationPoint *ip)
86  { IntPoint = ip; EvalState = 0; }
87 
88  /** @brief Get a const reference to the currently set integration point. This
89  will return NULL if no integration point is set. */
90  const IntegrationPoint &GetIntPoint() { return *IntPoint; }
91 
92  /** @brief Transform integration point from reference coordinates to
93  physical coordinates and store them in the vector. */
94  virtual void Transform(const IntegrationPoint &, Vector &) = 0;
95 
96  /** @brief Transform all the integration points from the integration rule
97  from reference coordinates to physical
98  coordinates and store them as column vectors in the matrix. */
99  virtual void Transform(const IntegrationRule &, DenseMatrix &) = 0;
100 
101  /** @brief Transform all the integration points from the column vectors
102  of @a matrix from reference coordinates to physical
103  coordinates and store them as column vectors in @a result. */
104  virtual void Transform(const DenseMatrix &matrix, DenseMatrix &result) = 0;
105 
106  /** @brief Return the Jacobian matrix of the transformation at the currently
107  set IntegrationPoint, using the method SetIntPoint(). */
108  /** The dimensions of the Jacobian matrix are physical-space-dim by
109  reference-space-dim. The first column contains the x derivatives of the
110  transformation, the second -- the y derivatives, etc. */
112  { return (EvalState & JACOBIAN_MASK) ? dFdx : EvalJacobian(); }
113 
114 
115  /** @brief Return the Hessian matrix of the transformation at the currently
116  set IntegrationPoint, using the method SetIntPoint(). */
118  { return (EvalState & HESSIAN_MASK) ? d2Fdx2 : EvalHessian(); }
119 
120  /** @brief Return the weight of the Jacobian matrix of the transformation
121  at the currently set IntegrationPoint.
122  The Weight evaluates to \f$ \sqrt{\lvert J^T J \rvert} \f$. */
123  double Weight() { return (EvalState & WEIGHT_MASK) ? Wght : EvalWeight(); }
124 
125  /** @brief Return the adjugate of the Jacobian matrix of the transformation
126  at the currently set IntegrationPoint. */
128  { return (EvalState & ADJUGATE_MASK) ? adjJ : EvalAdjugateJ(); }
129 
130  /** @brief Return the inverse of the Jacobian matrix of the transformation
131  at the currently set IntegrationPoint. */
133  { return (EvalState & INVERSE_MASK) ? invJ : EvalInverseJ(); }
134 
135  /// Return the order of the current element we are using for the transformation.
136  virtual int Order() const = 0;
137 
138  /// Return the order of the elements of the Jacobian of the transformation.
139  virtual int OrderJ() const = 0;
140 
141  /** @brief Return the order of the determinant of the Jacobian (weight)
142  of the transformation. */
143  virtual int OrderW() const = 0;
144 
145  /// Return the order of \f$ adj(J)^T \nabla fi \f$
146  virtual int OrderGrad(const FiniteElement *fe) const = 0;
147 
148  /// Return the Geometry::Type of the reference element.
149  Geometry::Type GetGeometryType() const { return geom; }
150 
151  /// Return the topological dimension of the reference element.
152  int GetDimension() const { return Geometry::Dimension[geom]; }
153 
154  /// Get the dimension of the target (physical) space.
155  /** We support 2D meshes embedded in 3D; in this case the function will
156  return "3". */
157  virtual int GetSpaceDim() const = 0;
158 
159  /** @brief Transform a point @a pt from physical space to a point @a ip in
160  reference space. */
161  /** Attempt to find the IntegrationPoint that is transformed into the given
162  point in physical space. If the inversion fails a non-zero value is
163  returned. This method is not 100 percent reliable for non-linear
164  transformations. */
165  virtual int TransformBack(const Vector &pt, IntegrationPoint &ip) = 0;
166 
168 };
169 
170 
171 /// The inverse transformation of a given ElementTransformation.
173 {
174 public:
175  /// Algorithms for selecting an initial guess.
177  {
178  Center = 0, ///< Use the center of the reference element.
179  ClosestPhysNode = 1, /**<
180  Use the point returned by FindClosestPhysPoint() from a reference-space
181  grid of type and size controlled by SetInitGuessPointsType() and
182  SetInitGuessRelOrder(), respectively. */
183  ClosestRefNode = 2, /**<
184  Use the point returned by FindClosestRefPoint() from a reference-space
185  grid of type and size controlled by SetInitGuessPointsType() and
186  SetInitGuessRelOrder(), respectively. */
187  GivenPoint = 3 ///< Use a specific point, set with SetInitialGuess().
188  };
189 
190  /// Solution strategy.
192  {
193  Newton = 0, /**<
194  Use Newton's algorithm, without restricting the reference-space points
195  (iterates) to the reference element. */
197  Use Newton's algorithm, restricting the reference-space points to the
198  reference element by scaling back the Newton increments, i.e.
199  projecting new iterates, x_new, lying outside the element, to the
200  intersection of the line segment [x_old, x_new] with the boundary. */
202  Use Newton's algorithm, restricting the reference-space points to the
203  reference element by projecting new iterates, x_new, lying outside the
204  element, to the point on the boundary closest (in reference-space) to
205  x_new. */
206  };
207 
208  /// Values returned by Transform().
210  {
211  Inside = 0, ///< The point is inside the element
212  Outside = 1, ///< The point is _probably_ outside the element
213  Unknown = 2 ///< The algorithm failed to determine where the point is
214  };
215 
216 protected:
217  // Pointer to the forward transformation. Not owned.
219 
220  // Parameters of the inversion algorithms:
222  int init_guess_type; // algorithm to use
223  int qpts_type; // Quadrature1D type for the initial guess type
224  int rel_qpts_order; // num_1D_qpts = max(trans_order+rel_qpts_order,0)+1
225  int solver_type; // solution strategy to use
226  int max_iter; // max. number of Newton iterations
227  double ref_tol; // reference space tolerance
228  double phys_rtol; // physical space tolerance (relative)
229  double ip_tol; // tolerance for checking if a point is inside the ref. elem.
231 
232  void NewtonPrint(int mode, double val);
233  void NewtonPrintPoint(const char *prefix, const Vector &pt,
234  const char *suffix);
235  int NewtonSolve(const Vector &pt, IntegrationPoint &ip);
236 
237 public:
238  /// Construct the InverseElementTransformation with default parameters.
239  /** Some practical considerations regarding the choice of initial guess type
240  and solver type:
241  1. The combination of #Center and #NewtonSegmentProject provides the
242  fastest way to estimate if a point lies inside an element, assuming
243  that most queried elements are not very deformed, e.g. if most
244  elements are convex.
245  2. [Default] The combination of #Center and #NewtonElementProject
246  provides a somewhat slower alternative to 1 with the benefit of being
247  more reliable in the case when the query point is inside the element
248  but potentially slower in the case when the query point is outside the
249  element.
250  3. The combination of #ClosestPhysNode and #NewtonElementProject is
251  slower than 1 and 2 but much more reliable, especially in the case of
252  highly distorted elements which do not have very high aspect ratios.
253  4. The combination of #ClosestRefNode and #NewtonElementProject should
254  generally be the most reliable, coming at a bit higher computational
255  cost than 3 while performing better on distorted meshes with elements
256  having high aspect ratios.
257  @note None of these choices provide a guarantee that if a query point is
258  inside the element then it will be found. The only guarantee is that if
259  the Transform() method returns #Inside then the point lies inside the
260  element up to one of the specified physical- or reference-space
261  tolerances. */
263  : T(Trans),
264  ip0(NULL),
266  qpts_type(Quadrature1D::OpenHalfUniform),
267  rel_qpts_order(-1),
269  max_iter(16),
270  ref_tol(1e-15),
271  phys_rtol(1e-15),
272  ip_tol(1e-8),
273  print_level(-1)
274  { }
275 
277 
278  /// Set a new forward ElementTransformation, @a Trans.
280 
281  /** @brief Choose how the initial guesses for subsequent calls to Transform()
282  will be selected. */
284 
285  /** @brief Set the initial guess for subsequent calls to Transform(),
286  switching to the #GivenPoint #InitGuessType at the same time. */
287  void SetInitialGuess(const IntegrationPoint &init_ip)
288  { ip0 = &init_ip; SetInitialGuessType(GivenPoint); }
289 
290  /// Set the Quadrature1D type used for the `Closest*` initial guess types.
291  void SetInitGuessPointsType(int q_type) { qpts_type = q_type; }
292 
293  /// Set the relative order used for the `Closest*` initial guess types.
294  /** The number of points in each spatial direction is given by the formula
295  max(trans_order+order,0)+1, where trans_order is the order of the current
296  ElementTransformation. */
297  void SetInitGuessRelOrder(int order) { rel_qpts_order = order; }
298 
299  /** @brief Specify which algorithm to use for solving the transformation
300  equation, i.e. when calling the Transform() method. */
301  void SetSolverType(SolverType stype) { solver_type = stype; }
302 
303  /// Set the maximum number of iterations when solving for a reference point.
304  void SetMaxIter(int max_it) { max_iter = max_it; }
305 
306  /// Set the reference-space convergence tolerance.
307  void SetReferenceTol(double ref_sp_tol) { ref_tol = ref_sp_tol; }
308 
309  /// Set the relative physical-space convergence tolerance.
310  void SetPhysicalRelTol(double phys_rel_tol) { phys_rtol = phys_rel_tol; }
311 
312  /** @brief Set the tolerance used to determine if a point lies inside or
313  outside of the reference element. */
314  /** This tolerance is used only with the pure #Newton solver. */
315  void SetElementTol(double el_tol) { ip_tol = el_tol; }
316 
317  /// Set the desired print level, useful for debugging.
318  /** The valid options are: -1 - never print (default); 0 - print only errors;
319  1 - print the first and last last iterations; 2 - print every iteration;
320  and 3 - print every iteration including point coordinates. */
321  void SetPrintLevel(int pr_level) { print_level = pr_level; }
322 
323  /** @brief Find the IntegrationPoint mapped closest to @a pt. */
324  /** This function uses the given IntegrationRule, @a ir, maps its points to
325  physical space and finds the one that is closest to the point @a pt.
326 
327  @param pt The query point.
328  @param ir The IntegrationRule, i.e. the set of reference points to map
329  to physical space and check.
330  @return The index of the IntegrationPoint in @a ir whose mapped point is
331  closest to @a pt.
332  @see FindClosestRefPoint(). */
333  int FindClosestPhysPoint(const Vector& pt, const IntegrationRule &ir);
334 
335  /** @brief Find the IntegrationPoint mapped closest to @a pt, using a norm
336  that approximates the (unknown) distance in reference coordinates. */
337  /** @see FindClosestPhysPoint(). */
338  int FindClosestRefPoint(const Vector& pt, const IntegrationRule &ir);
339 
340  /** @brief Given a point, @a pt, in physical space, find its reference
341  coordinates, @a ip.
342 
343  @returns A value of type #TransformResult. */
344  virtual int Transform(const Vector &pt, IntegrationPoint &ip);
345 };
346 
347 /// A standard isoparametric element transformation
349 {
350 private:
351  DenseMatrix dshape,d2shape;
352  Vector shape;
353 
354  const FiniteElement *FElem;
355  DenseMatrix PointMat; // dim x dof
356 
357  /** @brief Evaluate the Jacobian of the transformation at the IntPoint and
358  store it in dFdx. */
359  virtual const DenseMatrix &EvalJacobian();
360  // Evaluate the Hessian of the transformation at the IntPoint and store it
361  // in d2Fdx2.
362  virtual const DenseMatrix &EvalHessian();
363 
364 public:
365  IsoparametricTransformation() : FElem(NULL) {}
366 
367  /// Set the element that will be used to compute the transformations
368  void SetFE(const FiniteElement *FE)
369  {
370  MFEM_ASSERT(FE != NULL, "Must provide a valid FiniteElement object!");
371  EvalState = (FE != FElem) ? 0 : EvalState;
372  FElem = FE; geom = FE->GetGeomType();
373  }
374 
375  /// Get the current element used to compute the transformations
376  const FiniteElement* GetFE() const { return FElem; }
377 
378  /// @brief Set the underlying point matrix describing the transformation.
379  /** The dimensions of the matrix are space-dim x dof. The transformation is
380  defined as
381  \f$ x = F( \hat x ) = P \phi( \hat x ) \f$
382 
383  where \f$ \hat x \f$ is the reference point, @a x is the corresponding
384  physical point, @a P is the point matrix, and \f$ \phi( \hat x ) \f$ is
385  the column-vector of all basis functions evaluated at \f$ \hat x \f$ .
386  The columns of @a P represent the control points in physical space
387  defining the transformation. */
388  void SetPointMat(const DenseMatrix &pm) { PointMat = pm; EvalState = 0; }
389 
390  /// Return the stored point matrix.
391  const DenseMatrix &GetPointMat() const { return PointMat; }
392 
393  /// @brief Write access to the stored point matrix. Use with caution.
394  /** If the point matrix is altered using this member function the Reset
395  function should also be called to force the reevaluation of the
396  Jacobian, etc.. */
397  DenseMatrix &GetPointMat() { return PointMat; }
398 
399  /// Set the FiniteElement Geometry for the reference elements being used.
401 
402  /** @brief Transform integration point from reference coordinates to
403  physical coordinates and store them in the vector. */
404  virtual void Transform(const IntegrationPoint &, Vector &);
405 
406  /** @brief Transform all the integration points from the integration rule
407  from reference coordinates to physical
408  coordinates and store them as column vectors in the matrix. */
409  virtual void Transform(const IntegrationRule &, DenseMatrix &);
410 
411  /** @brief Transform all the integration points from the column vectors
412  of @a matrix from reference coordinates to physical
413  coordinates and store them as column vectors in @a result. */
414  virtual void Transform(const DenseMatrix &matrix, DenseMatrix &result);
415 
416  /// Return the order of the current element we are using for the transformation.
417  virtual int Order() const { return FElem->GetOrder(); }
418 
419  /// Return the order of the elements of the Jacobian of the transformation.
420  virtual int OrderJ() const;
421 
422  /** @brief Return the order of the determinant of the Jacobian (weight)
423  of the transformation. */
424  virtual int OrderW() const;
425 
426  /// Return the order of \f$ adj(J)^T \nabla fi \f$
427  virtual int OrderGrad(const FiniteElement *fe) const;
428 
429  virtual int GetSpaceDim() const { return PointMat.Height(); }
430 
431  /** @brief Transform a point @a pt from physical space to a point @a ip in
432  reference space. */
433  /** Attempt to find the IntegrationPoint that is transformed into the given
434  point in physical space. If the inversion fails a non-zero value is
435  returned. This method is not 100 percent reliable for non-linear
436  transformations. */
437  virtual int TransformBack(const Vector & v, IntegrationPoint & ip)
438  {
439  InverseElementTransformation inv_tr(this);
440  return inv_tr.Transform(v, ip);
441  }
442 
444 
445  MFEM_DEPRECATED void FinalizeTransformation() {}
446 };
447 
449 {
450 public:
452  void Transform (const IntegrationPoint &, IntegrationPoint &);
453  void Transform (const IntegrationRule &, IntegrationRule &);
454 };
455 
456 /** @brief A specialized ElementTransformation class representing a face and
457  its two neighboring elements.
458 
459  This class can be used as a container for the element transformation data
460  needed for integrating discontinuous fields on element interfaces in a
461  Discontinuous Galerkin (DG) context.
462 
463  The secondary purpose of this class is to enable the
464  GridFunction::GetValue function, and various related functions, to properly
465  evaluate fields with limited continuity on boundary elements.
466 */
468 {
469 private:
470 
471  // Bitwise OR of ConfigMasks
472  int mask;
473 
474  IntegrationPoint eip1, eip2;
475 
476 protected: // interface for Mesh to be able to configure this object.
477 
478  friend class Mesh;
479 #ifdef MFEM_USE_MPI
480  friend class ParMesh;
481 #endif
482 
483  /// Set the mask indicating which portions of the object have been setup
484  /** The argument @a m is a bitmask used in
485  Mesh::GetFaceElementTransformations to indicate which portions of the
486  FaceElementTransformations object have been configured.
487 
488  mask & 1: Elem1 is configured
489  mask & 2: Elem2 is configured
490  mask & 4: Loc1 is configured
491  mask & 8: Loc2 is configured
492  mask & 16: The Face transformation itself is configured
493  */
494  void SetConfigurationMask(int m) { mask = m; }
495 
496 public:
497 
499  {
500  HAVE_ELEM1 = 1, ///< Element on side 1 is configured
501  HAVE_ELEM2 = 2, ///< Element on side 2 is configured
502  HAVE_LOC1 = 4, ///< Point transformation for side 1 is configured
503  HAVE_LOC2 = 8, ///< Point transformation for side 2 is configured
504  HAVE_FACE = 16 ///< Face transformation is configured
505  };
506 
508  Geometry::Type &FaceGeom; ///< @deprecated Use GetGeometryType instead
510  ElementTransformation *Face; ///< @deprecated No longer necessary
512 
514 
515  /** @brief Method to set the geometry type of the face.
516 
517  @note This method is designed to be used when
518  [Par]Mesh::GetFaceTransformation will not be called i.e. when the face
519  transformation will not be needed but the neighboring element
520  transformations will be. Using this method to override the GeometryType
521  should only be done with great care.
522  */
524 
525  /** @brief Return the mask defining the configuration state.
526 
527  The mask value indicates which portions of FaceElementTransformations
528  object have been configured.
529 
530  mask & 1: Elem1 is configured
531  mask & 2: Elem2 is configured
532  mask & 4: Loc1 is configured
533  mask & 8: Loc2 is configured
534  mask & 16: The Face transformation itself is configured
535  */
536  int GetConfigurationMask() const { return mask; }
537 
538  /** @brief Set the integration point in the Face and the two neighboring
539  elements, if present.
540 
541  The point @a face_ip must be in the reference coordinate system of the
542  face.
543  */
544  void SetIntPoint(const IntegrationPoint *face_ip);
545 
546  /** @brief Set the integration point in the Face and the two neighboring
547  elements, if present.
548 
549  This is a more expressive member function name than SetIntPoint, which
550  in this special case, does the same thing. This function can be used for
551  greater code clarity.
552  */
553  inline void SetAllIntPoints(const IntegrationPoint *face_ip)
555 
556  /** @brief Get a const reference to the integration point in neighboring
557  element 1 corresponding to the currently set integration point on the
558  face.
559 
560  This IntegrationPoint object will only contain up-to-date data if
561  SetIntPoint or SetAllIntPoints has been called with the latest
562  integration point for the face and the appropriate point transformation
563  has been configured. */
564  const IntegrationPoint &GetElement1IntPoint() { return eip1; }
565 
566  /** @brief Get a const reference to the integration point in neighboring
567  element 2 corresponding to the currently set integration point on the
568  face.
569 
570  This IntegrationPoint object will only contain up-to-date data if
571  SetIntPoint or SetAllIntPoints has been called with the latest
572  integration point for the face and the appropriate point transformation
573  has been configured. */
574  const IntegrationPoint &GetElement2IntPoint() { return eip2; }
575 
576  virtual void Transform(const IntegrationPoint &, Vector &);
577  virtual void Transform(const IntegrationRule &, DenseMatrix &);
578  virtual void Transform(const DenseMatrix &matrix, DenseMatrix &result);
579 
584 
585  /** @brief Check for self-consistency: compares the result of mapping the
586  reference face vertices to physical coordinates using the three
587  transformations: face, element 1, and element 2.
588 
589  @param[in] print_level If set to a positive number, print the physical
590  coordinates of the face vertices computed through
591  all available transformations: face, element 1,
592  and/or element 2.
593  @param[in,out] out The output stream to use for printing.
594 
595  @returns A maximal distance between physical coordinates of face vertices
596  that should coincide. A successful check should return a small
597  number relative to the mesh extents. If less than 2 of the three
598  transformations are set, returns 0.
599 
600  @warning This check will generally fail on periodic boundary faces.
601  */
602  double CheckConsistency(int print_level = 0,
603  std::ostream &out = mfem::out);
604 };
605 
606 /** Elem1(Loc1(x)) = Face(x) = Elem2(Loc2(x))
607 
608 
609  Physical Space
610 
611  *--------* ^ *--------*
612  Elem1No / / \ / \ / \ \ Elem2No
613  / / \ / \ / \ \
614  / / n \ / \ / \ \
615  *--------* ==> * ( ) * *--------*
616  \ \ / \ / \ / /
617  \ \ / \ / \ / /
618  \ \ / \ / \ / /
619  *--------* v *--------*
620 
621  ^ ^
622  | ^ |
623  Elem1 | | | Elem2
624  | | Face |
625  |
626  *--------* *--------*
627  / /| / /|
628  1 *--------* | 1 *--------* 1 *--------* |
629  | | | Loc1 | | Loc2 | | |
630  | | * <----- | x | -----> | | *
631  | |/ | | | |/
632  *--------* *--------* *--------*
633  0 1 0 1 0 1
634 
635  Reference Space
636 */
637 
638 }
639 
640 #endif
Abstract class for all finite elements.
Definition: fe.hpp:235
virtual ~ElementTransformation()
Definition: eltrans.hpp:167
IntegrationPointTransformation & GetIntPoint1Transformation()
Definition: eltrans.cpp:594
void SetPrintLevel(int pr_level)
Set the desired print level, useful for debugging.
Definition: eltrans.hpp:321
int NewtonSolve(const Vector &pt, IntegrationPoint &ip)
Definition: eltrans.cpp:160
const DenseMatrix & AdjugateJacobian()
Return the adjugate of the Jacobian matrix of the transformation at the currently set IntegrationPoin...
Definition: eltrans.hpp:127
ElementTransformation & GetElement2Transformation()
Definition: eltrans.cpp:586
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
virtual int OrderGrad(const FiniteElement *fe) const =0
Return the order of .
DenseMatrix & GetPointMat()
Write access to the stored point matrix. Use with caution.
Definition: eltrans.hpp:397
void SetIntPoint(const IntegrationPoint *face_ip)
Set the integration point in the Face and the two neighboring elements, if present.
Definition: eltrans.cpp:555
Element on side 1 is configured.
Definition: eltrans.hpp:500
Use a specific point, set with SetInitialGuess().
Definition: eltrans.hpp:187
virtual int OrderW() const =0
Return the order of the determinant of the Jacobian (weight) of the transformation.
void SetPhysicalRelTol(double phys_rel_tol)
Set the relative physical-space convergence tolerance.
Definition: eltrans.hpp:310
void SetInitialGuess(const IntegrationPoint &init_ip)
Set the initial guess for subsequent calls to Transform(), switching to the GivenPoint InitGuessType ...
Definition: eltrans.hpp:287
Geometry::Type GetGeometryType() const
Return the Geometry::Type of the reference element.
Definition: eltrans.hpp:149
const IntegrationPoint * IntPoint
Definition: eltrans.hpp:26
ElementTransformation * T
Definition: eltrans.hpp:218
virtual void Transform(const IntegrationPoint &, Vector &)
Transform integration point from reference coordinates to physical coordinates and store them in the ...
Definition: eltrans.cpp:609
Use the center of the reference element.
Definition: eltrans.hpp:178
virtual int Transform(const Vector &pt, IntegrationPoint &ip)
Given a point, pt, in physical space, find its reference coordinates, ip.
Definition: eltrans.cpp:324
virtual int TransformBack(const Vector &v, IntegrationPoint &ip)
Transform a point pt from physical space to a point ip in reference space.
Definition: eltrans.hpp:437
int GetDimension() const
Return the topological dimension of the reference element.
Definition: eltrans.hpp:152
IntegrationPointTransformation & GetIntPoint2Transformation()
Definition: eltrans.cpp:602
void SetIntPoint(const IntegrationPoint *ip)
Set the integration point ip that weights and Jacobians will be evaluated at.
Definition: eltrans.hpp:85
A specialized ElementTransformation class representing a face and its two neighboring elements...
Definition: eltrans.hpp:467
void NewtonPrint(int mode, double val)
Definition: eltrans.cpp:117
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition: fe.hpp:319
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
virtual int GetSpaceDim() const
Get the dimension of the target (physical) space.
Definition: eltrans.hpp:429
void SetInitialGuessType(InitGuessType itype)
Choose how the initial guesses for subsequent calls to Transform() will be selected.
Definition: eltrans.hpp:283
Point transformation for side 2 is configured.
Definition: eltrans.hpp:503
IntegrationPointTransformation Loc2
Definition: eltrans.hpp:511
const DenseMatrix & EvalAdjugateJ()
Definition: eltrans.cpp:35
const DenseMatrix & InverseJacobian()
Return the inverse of the Jacobian matrix of the transformation at the currently set IntegrationPoint...
Definition: eltrans.hpp:132
const IntegrationPoint & GetElement2IntPoint()
Get a const reference to the integration point in neighboring element 2 corresponding to the currentl...
Definition: eltrans.hpp:574
const FiniteElement * GetFE() const
Get the current element used to compute the transformations.
Definition: eltrans.hpp:376
A class container for 1D quadrature type constants.
Definition: intrules.hpp:287
virtual void Transform(const IntegrationPoint &, Vector &)
Transform integration point from reference coordinates to physical coordinates and store them in the ...
Definition: eltrans.cpp:479
const IntegrationPoint & GetIntPoint()
Get a const reference to the currently set integration point. This will return NULL if no integration...
Definition: eltrans.hpp:90
Element on side 2 is configured.
Definition: eltrans.hpp:501
The inverse transformation of a given ElementTransformation.
Definition: eltrans.hpp:172
virtual int OrderJ() const
Return the order of the elements of the Jacobian of the transformation.
Definition: eltrans.cpp:430
ElementTransformation * Elem2
Definition: eltrans.hpp:509
void SetSolverType(SolverType stype)
Specify which algorithm to use for solving the transformation equation, i.e. when calling the Transfo...
Definition: eltrans.hpp:301
virtual int OrderJ() const =0
Return the order of the elements of the Jacobian of the transformation.
void NewtonPrintPoint(const char *prefix, const Vector &pt, const char *suffix)
Definition: eltrans.cpp:146
int GetConfigurationMask() const
Return the mask defining the configuration state.
Definition: eltrans.hpp:536
void SetTransformation(ElementTransformation &Trans)
Set a new forward ElementTransformation, Trans.
Definition: eltrans.hpp:279
virtual int OrderW() const
Return the order of the determinant of the Jacobian (weight) of the transformation.
Definition: eltrans.cpp:444
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition: fe.hpp:312
int FindClosestRefPoint(const Vector &pt, const IntegrationRule &ir)
Find the IntegrationPoint mapped closest to pt, using a norm that approximates the (unknown) distance...
Definition: eltrans.cpp:85
void SetPointMat(const DenseMatrix &pm)
Set the underlying point matrix describing the transformation.
Definition: eltrans.hpp:388
The point is inside the element.
Definition: eltrans.hpp:211
void SetGeometryType(Geometry::Type g)
Method to set the geometry type of the face.
Definition: eltrans.hpp:523
static const int Dimension[NumGeom]
Definition: geom.hpp:46
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Definition: operator.hpp:65
IntegrationPointTransformation Loc1
Definition: eltrans.hpp:511
The point is probably outside the element.
Definition: eltrans.hpp:212
void SetAllIntPoints(const IntegrationPoint *face_ip)
Set the integration point in the Face and the two neighboring elements, if present.
Definition: eltrans.hpp:553
const DenseMatrix & Jacobian()
Return the Jacobian matrix of the transformation at the currently set IntegrationPoint, using the method SetIntPoint().
Definition: eltrans.hpp:111
void Reset()
Force the reevaluation of the Jacobian in the next call.
Definition: eltrans.hpp:81
void SetReferenceTol(double ref_sp_tol)
Set the reference-space convergence tolerance.
Definition: eltrans.hpp:307
void SetInitGuessPointsType(int q_type)
Set the Quadrature1D type used for the Closest* initial guess types.
Definition: eltrans.hpp:291
InverseElementTransformation(ElementTransformation *Trans=NULL)
Construct the InverseElementTransformation with default parameters.
Definition: eltrans.hpp:262
double Weight()
Return the weight of the Jacobian matrix of the transformation at the currently set IntegrationPoint...
Definition: eltrans.hpp:123
virtual const DenseMatrix & EvalHessian()=0
Evaluate the Hessian of the transformation at the IntPoint and store it in d2Fdx2.
void SetElementTol(double el_tol)
Set the tolerance used to determine if a point lies inside or outside of the reference element...
Definition: eltrans.hpp:315
Point transformation for side 1 is configured.
Definition: eltrans.hpp:502
const DenseMatrix & EvalInverseJ()
Definition: eltrans.cpp:45
virtual int OrderGrad(const FiniteElement *fe) const
Return the order of .
Definition: eltrans.cpp:458
void SetConfigurationMask(int m)
Set the mask indicating which portions of the object have been setup.
Definition: eltrans.hpp:494
void SetIdentityTransformation(Geometry::Type GeomType)
Set the FiniteElement Geometry for the reference elements being used.
Definition: eltrans.cpp:371
double CheckConsistency(int print_level=0, std::ostream &out=mfem::out)
Check for self-consistency: compares the result of mapping the reference face vertices to physical co...
Definition: eltrans.cpp:633
virtual int Order() const =0
Return the order of the current element we are using for the transformation.
void Transform(const IntegrationPoint &, IntegrationPoint &)
Definition: eltrans.cpp:533
const IntegrationPoint & GetElement1IntPoint()
Get a const reference to the integration point in neighboring element 1 corresponding to the currentl...
Definition: eltrans.hpp:564
MFEM_DEPRECATED void FinalizeTransformation()
Definition: eltrans.hpp:445
virtual int GetSpaceDim() const =0
Get the dimension of the target (physical) space.
Face transformation is configured.
Definition: eltrans.hpp:504
Class for integration point with weight.
Definition: intrules.hpp:25
The algorithm failed to determine where the point is.
Definition: eltrans.hpp:213
SolverType
Solution strategy.
Definition: eltrans.hpp:191
A standard isoparametric element transformation.
Definition: eltrans.hpp:348
virtual int Order() const
Return the order of the current element we are using for the transformation.
Definition: eltrans.hpp:417
TransformResult
Values returned by Transform().
Definition: eltrans.hpp:209
int FindClosestPhysPoint(const Vector &pt, const IntegrationRule &ir)
Find the IntegrationPoint mapped closest to pt.
Definition: eltrans.cpp:58
void SetFE(const FiniteElement *FE)
Set the element that will be used to compute the transformations.
Definition: eltrans.hpp:368
ElementTransformation & GetElement1Transformation()
Definition: eltrans.cpp:578
IsoparametricTransformation Transf
Definition: eltrans.hpp:451
ElementTransformation * Elem1
Definition: eltrans.hpp:509
ElementTransformation * Face
Definition: eltrans.hpp:510
virtual const DenseMatrix & EvalJacobian()=0
Evaluate the Jacobian of the transformation at the IntPoint and store it in dFdx. ...
InitGuessType
Algorithms for selecting an initial guess.
Definition: eltrans.hpp:176
Vector data type.
Definition: vector.hpp:51
virtual void Transform(const IntegrationPoint &, Vector &)=0
Transform integration point from reference coordinates to physical coordinates and store them in the ...
const IntegrationPoint * ip0
Definition: eltrans.hpp:221
const DenseMatrix & Hessian()
Return the Hessian matrix of the transformation at the currently set IntegrationPoint, using the method SetIntPoint().
Definition: eltrans.hpp:117
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Definition: globals.hpp:66
const DenseMatrix & GetPointMat() const
Return the stored point matrix.
Definition: eltrans.hpp:391
void SetMaxIter(int max_it)
Set the maximum number of iterations when solving for a reference point.
Definition: eltrans.hpp:304
Class for parallel meshes.
Definition: pmesh.hpp:32
void SetInitGuessRelOrder(int order)
Set the relative order used for the Closest* initial guess types.
Definition: eltrans.hpp:297
virtual int TransformBack(const Vector &pt, IntegrationPoint &ip)=0
Transform a point pt from physical space to a point ip in reference space.