Go to the documentation of this file.
51 #ifndef vtkm_worklet_cosmotools_compute_potential_mxn_h
52 #define vtkm_worklet_cosmotools_compute_potential_mxn_h
90 template <
typename InIdPortalType,
typename InFieldPortalType>
92 const InIdPortalType& partId,
93 const InFieldPortalType& xLoc,
94 const InFieldPortalType& yLoc,
95 const InFieldPortalType& zLoc)
const
101 T xDist = xLoc.Get(iPartId) - xLoc.Get(j);
102 T yDist = yLoc.Get(iPartId) - yLoc.Get(j);
103 T zDist = zLoc.Get(iPartId) - zLoc.Get(j);
104 T r = sqrt((xDist * xDist) + (yDist * yDist) + (zDist * zDist));
105 if (fabs(r) > 0.00000000001f)
107 potential -=
mass / r;
#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
A control signature tag for output fields.
Definition: WorkletMapField.h:60
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
A control signature tag for input fields.
Definition: WorkletMapField.h:49
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38