A collection of tools for searchableSurfaces. More...
Public Member Functions | |
ClassName ("searchableSurfacesQueries") | |
Static Public Member Functions | |
static void | findAnyIntersection (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) |
Find any intersection. Return hit point information and. More... | |
static void | findAllIntersections (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const pointField &start, const pointField &end, labelListList &surfaces, List< List< pointIndexHit > > &surfaceHits) |
Find all intersections in order from start to end. Returns for. More... | |
static void | findNearestIntersection (const PtrList< searchableSurface > &allSurfaces, const labelList &surfacesToTest, const pointField &start, const pointField &end, labelList &surface1, List< pointIndexHit > &hit1, labelList &surface2, List< pointIndexHit > &hit2) |
static void | findNearest (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const pointField &, const scalarField &nearestDistSqr, labelList &surfaces, List< pointIndexHit > &) |
Find nearest. Return -1 (and a miss()) or surface and nearest. More... | |
static void | findNearest (const PtrList< searchableSurface > &allSurfaces, const labelList &surfacesToTest, const labelListList ®ionIndices, const pointField &samples, const scalarField &nearestDistSqr, labelList &nearestSurfaces, List< pointIndexHit > &nearestInfo) |
Find nearest points to a specific regions of the surface. More... | |
static void | signedDistance (const PtrList< searchableSurface > &allSurfaces, const labelList &surfacesToTest, const pointField &samples, const scalarField &nearestDistSqr, const volumeType illegalHandling, labelList &nearestSurfaces, scalarField &distance) |
Find signed distance to nearest surface. Outside is positive. More... | |
static boundBox | bounds (const PtrList< searchableSurface > &allSurfaces, const labelList &surfacesToTest) |
Find the boundBox of the selected surfaces. More... | |
static pointIndexHit | facesIntersection (const PtrList< searchableSurface > &allSurfaces, const labelList &surfacesToTest, const scalar initDistSqr, const scalar convergenceDistSqr, const point &start) |
Calculate point which is on a set of surfaces. WIP. More... | |
Static Private Member Functions | |
static pointIndexHit | tempFindNearest (const searchableSurface &, const point &pt, const scalar initDistSqr) |
Temporary wrapper around findNearest. Used in facesIntersection only. More... | |
static scalar | sumDistSqr (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const scalar initialDistSqr, const point &pt) |
Calculate sum of distances to nearest point on surfaces. Is used. More... | |
static scalar | tryMorphTet (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const scalar initialDistSqr, List< vector > &p, List< scalar > &y, vector &pSum, const label ihi, const scalar fac) |
Takes the tet (points p) and reflects the point with the. More... | |
static bool | morphTet (const PtrList< searchableSurface > &, const labelList &surfacesToTest, const scalar initialDistSqr, const scalar convergenceDistSqr, const label maxIter, List< vector > &p, List< scalar > &y) |
Downhill simplex method: find the point with min cumulative. More... | |
static void | mergeHits (const point &start, const label surfI, const List< pointIndexHit > &surfHits, labelList &allSurfaces, List< pointIndexHit > &allInfo, scalarList &allDistSqr) |
A collection of tools for searchableSurfaces.
Definition at line 51 of file searchableSurfacesQueries.H.
|
staticprivate |
Temporary wrapper around findNearest. Used in facesIntersection only.
Definition at line 43 of file searchableSurfacesQueries.C.
References searchableSurface::findNearest().
|
staticprivate |
Calculate sum of distances to nearest point on surfaces. Is used.
in minimisation to find intersection. Returns sum of (square of) distances to the surfaces.
Definition at line 59 of file searchableSurfacesQueries.C.
References forAll, PointIndexHit< Point >::hitPoint(), Foam::magSqr(), and Foam::sum().
|
staticprivate |
Takes the tet (points p) and reflects the point with the.
highest value around the centre (pSum). Checks if it gets closer and updates p, y if so.
Definition at line 88 of file searchableSurfacesQueries.C.
|
staticprivate |
Downhill simplex method: find the point with min cumulative.
distance to all surfaces. Does so by morphing a tet (points p). Returns the point on the 0th surface or hit if not reached within maxIters iterations.
Definition at line 117 of file searchableSurfacesQueries.C.
References Foam::endl(), Foam::findMin(), forAll, Foam::nl, p, Foam::Pout, autoPtr::reset(), List::size(), Foam::sortedOrder(), Foam::sum(), Foam::Swap(), writeOBJ(), and y.
|
staticprivate |
Definition at line 325 of file searchableSurfacesQueries.C.
References Foam::findLower(), forAll, Foam::magSqr(), List::setSize(), and List::size().
ClassName | ( | "searchableSurfacesQueries" | ) |
|
static |
Find any intersection. Return hit point information and.
index in surfacesToTest. If multiple surfaces hit the first surface is returned, not necessarily the nearest (to start).
Definition at line 396 of file searchableSurfacesQueries.C.
References forAll, Foam::identity(), and List::setSize().
Referenced by searchableSurfaces::findAnyIntersection(), and refinementSurfaces::findAnyIntersection().
|
static |
Find all intersections in order from start to end. Returns for.
every hit the index in surfacesToTest and the hit info.
Definition at line 457 of file searchableSurfacesQueries.C.
References forAll, Foam::magSqr(), List::setSize(), and List::size().
Referenced by searchableSurfaces::findAllIntersections().
|
static |
Definition at line 537 of file searchableSurfacesQueries.C.
References forAll, and List::setSize().
Referenced by searchableSurfaces::findNearestIntersection().
|
static |
Find nearest. Return -1 (and a miss()) or surface and nearest.
point.
Definition at line 625 of file searchableSurfacesQueries.C.
References forAll, Foam::magSqr(), samples(), and List::setSize().
Referenced by searchableSurfaces::findNearest(), refinementSurfaces::findNearest(), and refinementSurfaces::findNearestRegion().
|
static |
Find nearest points to a specific regions of the surface.
Definition at line 672 of file searchableSurfacesQueries.C.
References forAll, Foam::magSqr(), samples(), and List::setSize().
|
static |
Find signed distance to nearest surface. Outside is positive.
illegalHandling: how to handle non-inside or outside OUTSIDE : treat as outside INSIDE : treat as inside UNKNOWN : throw fatal error
Definition at line 735 of file searchableSurfacesQueries.C.
References DynamicList::append(), DynamicField::append(), DynamicList::clear(), DynamicField::clear(), Foam::distance(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), and samples().
|
static |
Find the boundBox of the selected surfaces.
Definition at line 834 of file searchableSurfacesQueries.C.
References forAll, and List::size().
Referenced by searchableSurfaces::bounds().
|
static |
Calculate point which is on a set of surfaces. WIP.
Calculate point which is on a set of surfaces.
Downhill Simplex method
Definition at line 856 of file searchableSurfacesQueries.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), and List::size().
Referenced by searchableSurfaces::facesIntersection().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.