 
 	int numFlBcRigid = 2 + numRigidBodies;
 	int totalNumberOfFlexNodes = ANCF_ReferenceArrayNodesOnBeams[ANCF_ReferenceArrayNodesOnBeams.size() - 1].y;
-	int totalNumberOfFlexMarkers = referenceArray[numFlBcRigid + numFlexBodies - 1].y - referenceArray[numFlBcRigid].x;
+	int numFlex_SphMarkers = referenceArray[numFlBcRigid + numFlexBodies - 1].y - referenceArray[numFlBcRigid].x;
 
 
 	int startFlexParticle = (referenceArray[numFlBcRigid]).x;
 
-	thrust::device_vector<real3> flexNodesForces1();//(totalNumberOfFlexNodes * totalNumberOfFlexMarkers);
+	thrust::device_vector<real3> flexNodesForces1();//(totalNumberOfFlexNodes * totalNumberOfFlexMarkers); Size:sum(numNodesOfEachBeam*numSPH_MarkersOfEachBeam)
 	thrust::device_vector<real3> flexNodesForces2();//(totalNumberOfFlexNodes * totalNumberOfFlexMarkers);
 
 	uint nBlocks_numFlex_SphMarkers;
 	uint nThreads_SphMarkers;
-	computeGridSize(numRigid_SphMarkers, 256, nBlocks_numRigid_SphMarkers, nThreads_SphMarkers);
+	computeGridSize(numFlex_SphMarkers, 256, nBlocks_numFlex_SphMarkers, nThreads_SphMarkers);
+	MapForcesOnNodes<<<nBlocks_numFlex_SphMarkers, nThreads_SphMarkers>>>(R3CAST(flexNodesForces1), R3CAST(flexNodesForces2),
+			I1CAST(flexIdentifierD),
+			I1CAST(ANCF_NumNodes_Per_Beam), I1CAST(ANCF_NumMarkers_Per_Beam), I1CAST(ANCF_NumNodesMultMarkers_Per_Beam), I1CAST(ANCF_NumNodesMultMarkers_Per_Beam_Cumul),
+			R1CAST(parametricDist),
+			R4CAST(derivVelRhoD),
+			numFlex_SphMarkers);
 
 
 

	torqueParticlesD[index] = cross(dist3, R3(derivVelRhoD[rigidParticleIndex]));
}
//--------------------------------------------------------------------------------------------------------------------------------
__global__ void Populate_RigidSPH_MeshPos_LRF_kernel(
		real3* rigidSPH_MeshPos_LRF_D,
		real3* posRadD,

		thrust::device_vector<real3> & ANCF_VelNodes,
		thrust::device_vector<real3> & ANCF_VelSlopes,
		thrust::device_vector<int2> & ANCF_ReferenceArrayNodesOnBeams,
		thrust::device_vector<int> & ANCF_NumNodes_Per_Beam,
		thrust::device_vector<int> & ANCF_NumMarkers_Per_Beam,
		thrust::device_vector<int> & ANCF_NumNodesMultMarkers_Per_Beam,
		thrust::device_vector<int> & ANCF_NumNodesMultMarkers_Per_Beam_Cumul,

		const thrust::device_vector<int> & flexIdentifierD,
		const thrust::device_vector<real_> & parametricDist,
		const thrust::host_vector<int2> & referenceArray,

