← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1864: 1. REC_INTR in VTK changed to save interaction data not only for CPM model.

 

------------------------------------------------------------
revno: 1864
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2009-12-07 16:51:39 +0100
message:
  1. REC_INTR in VTK changed to save interaction data not only for CPM model.
modified:
  pkg/dem/Engine/StandAloneEngine/VTKRecorder.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'pkg/dem/Engine/StandAloneEngine/VTKRecorder.cpp'
--- pkg/dem/Engine/StandAloneEngine/VTKRecorder.cpp	2009-12-07 08:07:20 +0000
+++ pkg/dem/Engine/StandAloneEngine/VTKRecorder.cpp	2009-12-07 15:51:39 +0000
@@ -119,7 +119,6 @@
 		}
 		FOREACH(const shared_ptr<Interaction>& I, *rootBody->interactions){
 			if(!I->isReal()) continue;
-			//const NormalShearInteraction* phys = YADE_CAST<NormalShearInteraction*>(i->interactionPhysics.get());
 			if(skipFacetIntr){
 				if(!(dynamic_cast<InteractingSphere*>(Body::byId(I->getId1())->shape.get()))) continue;
 				if(!(dynamic_cast<InteractingSphere*>(Body::byId(I->getId2())->shape.get()))) continue;
@@ -128,11 +127,17 @@
 			line->GetPointIds()->SetId(0,I->getId1());
 			line->GetPointIds()->SetId(1,I->getId2());
 			intrCells->InsertNextCell(line);
-			if(recActive[REC_CPM]){
+			if(recActive[REC_CPM]){		//For CPM model 
 				const CpmPhys* phys = YADE_CAST<CpmPhys*>(I->interactionPhysics.get());
 				intrForceN->InsertNextValue(phys->Fn);
 				float fs[3]={abs(phys->shearForce[0]),abs(phys->shearForce[1]),abs(phys->shearForce[2])};
 				intrAbsForceT->InsertNextTupleValue(fs);
+			} else {									//For all other models
+				const NormalShearInteraction* phys = YADE_CAST<NormalShearInteraction*>(I->interactionPhysics.get());
+				float fn[3]={abs(phys->normalForce[0]),abs(phys->normalForce[1]),abs(phys->normalForce[2])};
+				float fs[3]={abs(phys->shearForce[0]),abs(phys->shearForce[1]),abs(phys->shearForce[2])};
+				intrForceN->InsertNextTupleValue(fn);
+				intrAbsForceT->InsertNextTupleValue(fs);
 			}
 		}
 	}