Go to the documentation of this file.
51 #ifndef vtkm_worklet_cosmotools_graft_particle_h
52 #define vtkm_worklet_cosmotools_graft_particle_h
74 WholeArrayIn partIdArray,
75 WholeArrayIn location,
76 WholeArrayIn firstParticleId,
77 WholeArrayIn lastParticleId,
78 WholeArrayOut haloId);
101 template <
typename InIdPortalType,
102 typename InFieldPortalType,
103 typename InVectorPortalType,
104 typename OutPortalType>
109 const InIdPortalType& partIdArray,
110 const InFieldPortalType& location,
111 const InVectorPortalType& firstParticleId,
112 const InVectorPortalType& lastParticleId,
113 OutPortalType& haloId)
const
121 for (
vtkm::Id z = zVal - 1; z <= zVal + 1; z++)
123 for (
vtkm::Id y = yVal - 1; y <= yVal + 1; y++)
128 vtkm::Id startParticle = firstParticleId.Get(firstBinId);
129 vtkm::Id endParticle = lastParticleId.Get(firstBinId);
131 for (
vtkm::Id j = startParticle; j < endParticle; j++)
133 vtkm::Id jPartId = partIdArray.Get(j);
136 T xDist = iloc[0] - jloc[0];
137 T yDist = iloc[1] - jloc[1];
138 T zDist = iloc[2] - jloc[2];
139 if ((xDist * xDist + yDist * yDist + zDist * zDist) <=
linkLenSq)
141 if ((haloId.Get(iPartId) == haloId.Get(haloId.Get(iPartId))) &&
142 (haloId.Get(jPartId) < haloId.Get(iPartId)))
144 haloId.Set(haloId.Get(iPartId), haloId.Get(jPartId));
vtkm::Id zNum
Definition: GraftParticles.h:82
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Id yNum
Definition: GraftParticles.h:82
_1 InputDomain
Definition: GraftParticles.h:80
vtkm::Id NUM_NEIGHBORS
Definition: GraftParticles.h:83
vtkm::Id xNum
Definition: GraftParticles.h:82
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
T linkLenSq
Definition: GraftParticles.h:84
A control signature tag for input fields.
Definition: WorkletMapField.h:49
void(_1, _2, _3, _4, _5, _6, _7, _8, _9) ExecutionSignature
Definition: GraftParticles.h:79
VTKM_EXEC_CONT GraftParticles(const vtkm::Id XNum, const vtkm::Id YNum, const vtkm::Id ZNum, const vtkm::Id NumNeighbors, const T LinkLen)
Definition: GraftParticles.h:88
Definition: GraftParticles.h:66
uint32_t UInt32
Definition: Types.h:161
VTKM_EXEC void operator()(const vtkm::Id &i, const vtkm::Id &iPartId, const vtkm::Id &iBinId, const vtkm::UInt32 &activeFlag, const InIdPortalType &partIdArray, const InFieldPortalType &location, const InVectorPortalType &firstParticleId, const InVectorPortalType &lastParticleId, OutPortalType &haloId) const
Definition: GraftParticles.h:105
void(FieldIn index, FieldIn partId, FieldIn binId, FieldIn activeFlag, WholeArrayIn partIdArray, WholeArrayIn location, WholeArrayIn firstParticleId, WholeArrayIn lastParticleId, WholeArrayOut haloId) ControlSignature
Definition: GraftParticles.h:78
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38