 	cudaThreadSynchronize();
 	CUT_CHECK_ERROR("Kernel execution failed: CalcElasticForcesD");
 #else
-	CalcElasticForcesD __KERNEL__(nBlock_FlexBodies, nThreads_FlexBodies)(
+	CalcElasticForcesD(
 			R3CAST(flex_FSI_NodesForcesH1), R3CAST(flex_FSI_NodesForcesH2),
 			R3CAST(ANCF_NodesH), R3CAST(ANCF_SlopesH), R3CAST(ANCF_NodesVelH), R3CAST(ANCF_SlopesVelH),
 			I2CAST(ANCF_ReferenceArrayNodesOnBeamsH), R1CAST(ANCF_Beam_LengthH));
 #endif
 
+	printf("a1\n");
 	int totalNumberOfFlexNodes = flex_FSI_NodesForcesD1.size();
 	thrust::device_vector<real3> ANCF_NodesAccD(totalNumberOfFlexNodes);
 	thrust::device_vector<real3> ANCF_SlopesAccD(totalNumberOfFlexNodes);

	cudaThreadSynchronize();
	CUT_CHECK_ERROR("Kernel execution failed: IntegrateInTimeD");
#else
	IntegrateInTimeD __KERNEL__(nBlock_FlexBodies, nThreads_FlexBodies)(
			R3CAST(ANCF_NodesH2), R3CAST(ANCF_SlopesH2), R3CAST(ANCF_NodesVelH2), R3CAST(ANCF_SlopesVelH2),
			R3CAST(ANCF_NodesVelH), R3CAST(ANCF_SlopesVelH), R3CAST(ANCF_NodesAccH), R3CAST(ANCF_SlopesAccH),
			I2CAST(ANCF_ReferenceArrayNodesOnBeamsH), BCAST(ANCF_IsCantileverH));
	cudaThreadSynchronize();
	CUT_CHECK_ERROR("Kernel execution failed: IntegrateInTimeD");
#endif

	ANCF_NodesAccD.clear();
	ANCF_SlopesAccD.clear();
	ANCF_NodesAccH.clear();
	ANCF_SlopesAccH.clear();

	//---------------------------------------------


	thrust::copy(ANCF_SlopesH2.begin(), ANCF_SlopesH2.end(), ANCF_SlopesD2.begin());
	thrust::copy(ANCF_NodesVelH2.begin(), ANCF_NodesVelH2.end(), ANCF_NodesVelD2.begin());
	thrust::copy(ANCF_SlopesVelH2.begin(), ANCF_SlopesVelH2.end(), ANCF_SlopesVelD2.begin());
	printf("a5\n");

	ANCF_NodesH2.clear();
	ANCF_SlopesH2.clear();
	ANCF_NodesVelH2.clear();
	ANCF_SlopesVelH2.clear();
	printf("a6\n");

	ANCF_NodesH.clear();
	ANCF_SlopesH.clear();
	ANCF_NodesVelH.clear();
	ANCF_SlopesVelH.clear();
	printf("a7\n");

	flex_FSI_NodesForcesH1.clear();
	flex_FSI_NodesForcesH2.clear();
	ANCF_ReferenceArrayNodesOnBeamsH.clear();
	ANCF_Beam_LengthH.clear();
	ANCF_IsCantileverH.clear();
	printf("a8\n");

}
