|
Nektar++
|
Inverse mapping for a triangle or quadrilateral, including the closed-form solve available when every edge is straight. More...
#include <GeometryLocator.h>
Public Member Functions | |
| GeometryLocator (Geometry *geom) | |
Public Member Functions inherited from Nektar::SpatialDomains::GeometryLocator | |
| GeometryLocator (Geometry *geom) | |
| virtual | ~GeometryLocator ()=default |
| void | Build () |
| Populate the cache. Called by Create() once the concrete type exists, since it dispatches virtually. | |
| Geometry * | GetGeometry () const |
| std::array< NekDouble, 6 > | GetBoundingBox () |
| Generates the bounding box for the element. | |
| void | ClearBoundingBox () |
| bool | ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0) |
| Determine whether the element contains a Cartesian coordinate. | |
| bool | ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol) |
| Determine whether the element contains a Cartesian coordinate. | |
| bool | ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &dist) |
| NekDouble | GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) |
| Determine the local collapsed coordinates corresponding to a given Cartesian coordinate. | |
| NekDouble | FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) |
| int | PreliminaryCheck (const Array< OneD, const NekDouble > &gloCoord, NekDouble &edgeDist) |
| A fast and robust check if a given global coord is outside of a deformed element. For regular elements, this check is unnecessary. | |
| bool | MinMaxCheck (const Array< OneD, const NekDouble > &gloCoord) |
| Check if given global coord is within the BoundingBox of the element. | |
Protected Member Functions | |
| NekDouble | v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) override |
| NekDouble | v_FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) override |
| int | v_AllLeftCheck (const Array< OneD, const NekDouble > &gloCoord, NekDouble &edgeDist) override |
| void | v_CalculateInverseIsoParam () override |
| void | v_PreSolveStraightEdge () override |
Private Member Functions | |
| void | SolveStraightEdgeQuad (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) |
| void | NewtonIterationForLocCoord (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, Array< OneD, NekDouble > &Lcoords, NekDouble &dist) |
Additional Inherited Members | |
Static Public Member Functions inherited from Nektar::SpatialDomains::GeometryLocator | |
| static std::unique_ptr< GeometryLocator > | Create (Geometry *geom) |
Build the locator appropriate to geom's dimension, with its cache already populated. | |
| static bool | ClampLocCoords (Array< OneD, NekDouble > &locCoord, int dim, NekDouble tol=std::numeric_limits< NekDouble >::epsilon()) |
| Clamp local coordinates into the reference element \([-1-tol,1+tol]^{dim}\), returning whether anything was clamped. Depends only on the reference element, so it needs no locator. | |
Protected Attributes inherited from Nektar::SpatialDomains::GeometryLocator | |
| Geometry * | m_geom |
| The geometry being searched. Not owned. | |
| IsoParam | m_iso |
| The shape's isoparametric coefficients. The straight-edged 2D solve rewrites them into a factored form, so the locator keeps its own copy rather than sharing the geometry's. | |
| int | m_straightEdge = 0 |
| Non-zero if every \(\chi\) basis is linear. Bits 1 and 2 are used by the 2D straight-edged solve to record which axes were swapped. | |
| std::array< std::array< NekDouble, kMaxGeomDim >, kMaxGeomDim > | m_invIsoParam {} |
Inverse of the linear part of m_iso, for regular elements. | |
| bool | m_newtonConverged = false |
| Whether the Newton iteration of the last GetLocCoords call converged, i.e. whether its local coordinates map to the point. Set only by elements located by Newton iteration; read by ContainsPoint. | |
| bool | m_hasBoundingBox = false |
| Element bounding box as (xmin, ymin, zmin, xmax, ymax, zmax). | |
| std::array< NekDouble, 6 > | m_boundingBox {} |
| bool | m_edgeNormalBuilt = false |
2D only: inward edge normals used to reject points outside straight-sided elements. A curved edge gets no normal, so m_hasEdgeNormal records which entries are usable. | |
| std::array< bool, kMaxGeomVerts > | m_hasEdgeNormal {} |
| std::array< std::array< NekDouble, 2 >, kMaxGeomVerts > | m_edgeNormal {} |
Inverse mapping for a triangle or quadrilateral, including the closed-form solve available when every edge is straight.
Definition at line 213 of file GeometryLocator.h.
|
explicit |
Definition at line 105 of file GeometryLocator.cpp.
|
private |
Definition at line 687 of file GeometryLocator.cpp.
References Nektar::SpatialDomains::GeometryLocator::ClampLocCoords(), Nektar::SpatialDomains::Geometry::GenGeomFactors(), Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::SpatialDomains::Geometry::GetShapeDim(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::NekConstants::kNewtonIterations, Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::SpatialDomains::GeometryLocator::m_geom, Nektar::SpatialDomains::GeometryLocator::m_newtonConverged, Nektar::StdRegions::StdExpansion::PhysDeriv(), Nektar::StdRegions::StdExpansion::PhysEvaluate(), tinysimd::sqrt(), Vmath::Vsum(), and WARNINGL1.
Referenced by v_GetLocCoords().
|
private |
Definition at line 661 of file GeometryLocator.cpp.
References Nektar::LibUtilities::beta, Nektar::SpatialDomains::IsoParam::m_coeff, Nektar::SpatialDomains::GeometryLocator::m_iso, Nektar::SpatialDomains::GeometryLocator::m_straightEdge, and tinysimd::sqrt().
Referenced by v_GetLocCoords().
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::GeometryLocator.
Definition at line 1170 of file GeometryLocator.cpp.
References Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::SpatialDomains::Geometry::GetCoordim(), Nektar::SpatialDomains::PointGeom::GetCoords(), Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetNumVerts(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::NekConstants::kGeomFactorsTol, Nektar::SpatialDomains::GeometryLocator::m_edgeNormal, Nektar::SpatialDomains::GeometryLocator::m_edgeNormalBuilt, Nektar::SpatialDomains::GeometryLocator::m_geom, Nektar::SpatialDomains::GeometryLocator::m_hasEdgeNormal, Nektar::SpatialDomains::GeometryLocator::m_iso, and Nektar::SpatialDomains::IsoParam::m_manifold.
|
overrideprotectedvirtual |
Nothing to do by default. Build() drives this for every shape, but only the 2D and 3D inverse maps are expressed through an inverted coefficient matrix; a segment inverts \(\chi\) in closed form straight from its quadrature points.
Nothing to do by default. Build() drives this for every shape, but only the 2D and 3D inverse maps are expressed through an inverted coefficient matrix; a segment inverts \(\chi\) in closed form straight from its quadrature points.
Reimplemented from Nektar::SpatialDomains::GeometryLocator.
Definition at line 1158 of file GeometryLocator.cpp.
References Nektar::SpatialDomains::IsoParam::m_coeff, Nektar::SpatialDomains::GeometryLocator::m_invIsoParam, and Nektar::SpatialDomains::GeometryLocator::m_iso.
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::GeometryLocator.
Definition at line 919 of file GeometryLocator.cpp.
References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::SpatialDomains::Geometry::CalcGeomType(), Nektar::SpatialDomains::GeometryLocator::ClampLocCoords(), Nektar::SpatialDomains::eDeformed, Nektar::ErrorUtil::efatal, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetCoeffs(), Nektar::SpatialDomains::Geometry::GetCoord(), Nektar::SpatialDomains::GeometryLocator::GetLocCoords(), Nektar::SpatialDomains::Geometry::GetShapeDim(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::NekConstants::kNewtonIterations, Nektar::StdRegions::StdExpansion::LocCollapsedToLocCoord(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::SpatialDomains::GeometryLocator::m_geom, NEKERROR, Nektar::StdRegions::StdExpansion::PhysDeriv(), Nektar::StdRegions::StdExpansion::PhysEvaluate(), and tinysimd::sqrt().
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::GeometryLocator.
Definition at line 840 of file GeometryLocator.cpp.
References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::SpatialDomains::Geometry::CalcGeomType(), Nektar::SpatialDomains::GeometryLocator::ClampLocCoords(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::FillGeom(), Nektar::SpatialDomains::Geometry::GetCoeffs(), Nektar::SpatialDomains::Geometry::GetCoordim(), Nektar::StdRegions::StdExpansion::GetPoints(), Nektar::SpatialDomains::Geometry::GetShapeDim(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::SpatialDomains::Geometry::GetXmap(), Vmath::Imin(), Nektar::StdRegions::StdExpansion::LocCollapsedToLocCoord(), Nektar::StdRegions::StdExpansion::LocCoordToLocCollapsed(), Nektar::SpatialDomains::IsoParam::m_coeff, Nektar::SpatialDomains::GeometryLocator::m_geom, Nektar::SpatialDomains::GeometryLocator::m_invIsoParam, Nektar::SpatialDomains::GeometryLocator::m_iso, Nektar::SpatialDomains::IsoParam::m_manifold, Nektar::SpatialDomains::GeometryLocator::m_straightEdge, NewtonIterationForLocCoord(), Nektar::StdRegions::StdExpansion::PhysEvaluate(), Vmath::Sadd(), SolveStraightEdgeQuad(), tinysimd::sqrt(), Vmath::Vmul(), and Vmath::Vvtvp().
|
overrideprotectedvirtual |
Only the quadrilateral has a straight-edged solve to prepare for.
Only the quadrilateral has a straight-edged solve to prepare for.
Reimplemented from Nektar::SpatialDomains::GeometryLocator.
Definition at line 1279 of file GeometryLocator.cpp.
References Nektar::LibUtilities::beta, Nektar::SpatialDomains::IsoParam::m_coeff, Nektar::SpatialDomains::GeometryLocator::m_iso, and Nektar::SpatialDomains::GeometryLocator::m_straightEdge.