88 : mesh_(
mesh), cellFaces_(std::move(cellFaces)), facePoints_(std::move(facePoints)),
89 faceBasePt_(std::move(faceBasePt)), faceType_(std::move(faceType)),
90 cyclicPartnerCell_(std::move(cyclicPartnerCell)), cyclicShift_(std::move(cyclicShift)),
91 points_(std::move(points))
98 {cellFaces_.values().view(), cellFaces_.segments().view()},
99 {facePoints_.values().view(), facePoints_.segments().view()},
102 cyclicPartnerCell_.view(),
105 mesh_.cellCenters().view(),
106 mesh_.cellVolumes().view(),
107 mesh_.faceCenters().view(),
108 mesh_.faceNormals().view(),
109 mesh_.faceOwners().view(),
110 mesh_.faceNeighbors().view(),
111 static_cast<localIdx>(mesh_.nInternalFaces()),
112 static_cast<localIdx>(mesh_.nCells())
133KOKKOS_INLINE_FUNCTION
137 for (
localIdx k = start; k < end; k++)
143 normal =
scalar(-1) * normal;
165KOKKOS_INLINE_FUNCTION
175 scalar nearestDistSqr = d & d;
180 label nearestCell = -1;
183 for (
localIdx k = start; k < end; k++)
209 const scalar distSqr = dn & dn;
210 if (distSqr < nearestDistSqr)
212 nearestDistSqr = distSqr;
217 if (nearestCell == -1)
A class representing a segment of indices.
View< ValueType > values
A View with the values.
KOKKOS_INLINE_FUNCTION Kokkos::pair< IndexType, IndexType > bounds(localIdx segI) const
Get the bounds of a segment.
Data structure that stores a segmented fields or a vector of vectors.
TrackingMeshView view() const
Views for use inside kernels.
const UnstructuredMesh & mesh() const
TrackingMesh(const UnstructuredMesh &mesh, SegmentedVector< label, localIdx > cellFaces, SegmentedVector< label, localIdx > facePoints, Vector< label > faceBasePt, Vector< label > faceType, Vector< label > cyclicPartnerCell, Vector< Vec3 > cyclicShift, Vector< Vec3 > points)
Construct from a mesh and the connectivity it lacks.
Represents an unstructured mesh in NeoN.
A class for the representation of a 3D Vec3.
An executor-aware contiguous container for numerical data with vector-style arithmetic semantics.
Integer types used throughout NeoN.
KOKKOS_INLINE_FUNCTION bool pointInCell(const Vec3 &x, const label c, const TrackingMeshView &m)
Is x inside cell c? Face-plane test, as OpenFOAM primitiveMesh::pointInCell (FACE_PLANES): x is not i...
TrackingFaceType
What happens to a point that leaves a cell through a face.
@ cyclic
periodic: shift the position, continue in the partner cell
@ internal
go to the neighbour cell
@ escape
any other boundary: the point leaves the domain
KOKKOS_INLINE_FUNCTION label locateCell(Vec3 &x, label hint, const TrackingMeshView &m)
Locate the cell containing x, starting from cell hint.
Read-only views of a TrackingMesh, captured by value inside kernels.
SegmentedVectorView< const label, const localIdx > cellFaces
all faces of every cell
View< const label > cyclicPartnerCell
cyclic faces: cell behind the paired face
View< const label > faceNeighbors
internal faces only
View< const Vec3 > cellCenters
View< const Vec3 > cyclicShift
cyclic faces: translation to the paired face
View< const Vec3 > points
mesh points, on the executor
View< const label > faceOwners
View< const scalar > cellVolumes
View< const label > faceType
TrackingFaceType of every face.
View< const Vec3 > faceAreaVectors
UnstructuredMesh::faceNormals(), i.e. Sf.
SegmentedVectorView< const label, const localIdx > facePoints
points of every face
View< const Vec3 > faceCenters
View< const label > faceBasePt
tet base point of every face (local index)