 			R3CAST(flexNodesForcesAllMarkers1),
 			R3CAST(flexNodesForcesAllMarkers2),
 			I1CAST(flexIdentifierD),
-			I1CAST(ANCF_NumMarkers_Per_Beam),
-			I1CAST(ANCF_NumMarkers_Per_Beam_cumul),
-			I1CAST(ANCF_NumNodesMultMarkers_Per_Beam_Cumul),
-			R1CAST(flexParametricDist),
+			I1CAST(ANCF_NumMarkers_Per_BeamD),
+			I1CAST(ANCF_NumMarkers_Per_Beam_cumulD),
+			I1CAST(ANCF_NumNodesMultMarkers_Per_Beam_CumulD),
+			R1CAST(flexParametricDistD),
 			R4CAST(derivVelRhoD),
 			markerMass);
 

			R3CAST(posRadD), R4CAST(velMasD),
			I1CAST(flexIdentifierD),
			R3CAST(flexSPH_MeshPos_LRF_D),
			R1CAST(flexParametricDist),
			R1CAST(ANCF_Beam_Length),
			I1CAST(ANCF_NumNodes_Per_Beam),
			R3CAST(ANCF_Nodes),
			R3CAST(ANCF_Slopes),
			R3CAST(ANCF_VelNodes),
			R3CAST(ANCF_VelSlopes)
			);

	cudaThreadSynchronize();

		real3* flexSPH_MeshPos_LRF_D,
		real3 * posRadD,
		int* flexIdentifierD,
		real_* flexParametricDistD,
		real_* ANCF_Beam_LengthD,
		int* ANCF_NumNodes_Per_BeamD,
		real3 * ANCF_NodesD,
		real3 * ANCF_SlopesD) {
	uint index = blockIdx.x * blockDim.x + threadIdx.x;
	if (index >= numFlex_SphMarkersD) {
		return;
	}
	uint absMarkerIndex = index + startFlexMarkersD; // updatePortionD = [start, end] index of the update portion
	real_ s = flexParametricDistD[index];
	int flexBodyIndex = flexIdentifierD[index];
	real_ l = ANCF_Beam_LengthD[flexBodyIndex];
	int nNodes = ANCF_NumNodes_Per_BeamD[flexBodyIndex];

	int indexOfClosestNode = int(s / l) * nNodes;
	if (indexOfClosestNode == nNodes) indexOfClosestNode--;

	real3 beamPointPos = Calc_ANCF_Point_Pos(ANCF_NodesD, ANCF_SlopesD, indexOfClosestNode, s, l); //interpolation using ANCF beam, cubic hermit equation

	real3 dist3 = posRadD[absMarkerIndex] - beamPointPos;
	flexSPH_MeshPos_LRF_D[index] = dist3;
