← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1921: Make non-proportional scripts really work with VELGRAD :

 

------------------------------------------------------------
revno: 1921
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Wed 2009-12-23 13:21:15 +0100
message:
  Make non-proportional scripts really work with VELGRAD :
  -Update Hsize when refsize is modified once (this is ugly! needs a cleaner way)
  -Adapt size control by periodic engines. 
  Sorry for this new change in Cell.h. It will not change for a while now, next commits will be in engines.
modified:
  core/Cell.hpp
  pkg/dem/Engine/GlobalEngine/PeriIsoCompressor.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 'core/Cell.hpp'
--- core/Cell.hpp	2009-12-23 01:27:30 +0000
+++ core/Cell.hpp	2009-12-23 12:21:15 +0000
@@ -17,7 +17,7 @@
 // end yade compatibility
 
 	
-//#define VELGRAD
+#define VELGRAD
 	
 /*! Periodic cell parameters and routines. Usually instantiated as Scene::cell.
 
@@ -108,7 +108,7 @@
 #ifdef VELGRAD
 	void updateCache(double dt){	
 		//initialize Hsize for "lazy" default scripts, after that Hsize is free to change
-		if (Hsize[0][0]==0) {Hsize[0][0]=refSize[0]; Hsize[1][1]=refSize[1]; Hsize[2][2]=refSize[2];}
+		if (refSize[0]!=1 && Hsize[0][0]==0) {Hsize[0][0]=refSize[0]; Hsize[1][1]=refSize[1]; Hsize[2][2]=refSize[2];}
 		//incremental disp gradient
 		_shearIncrt=dt*velGrad;		
 		//update Hsize (redundant with total transformation perhaps)

=== modified file 'pkg/dem/Engine/GlobalEngine/PeriIsoCompressor.cpp'
--- pkg/dem/Engine/GlobalEngine/PeriIsoCompressor.cpp	2009-12-20 22:03:17 +0000
+++ pkg/dem/Engine/GlobalEngine/PeriIsoCompressor.cpp	2009-12-23 12:21:15 +0000
@@ -74,7 +74,13 @@
 		}
 	}
 	TRVAR4(cellGrow,sigma,sigmaGoal,avgStiffness);
+#ifdef VELGRAD
+	for(int axis=0; axis<3; axis++){
+		if (scene->dt!=0) scene->cell->velGrad[axis][axis]=cellGrow[axis]/(scene->dt*scene->cell->refSize[axis]);
+	}
+#endif
 	scene->cell->refSize+=cellGrow;
+
 	// handle state transitions
 	if(allStressesOK){
 		if((step%globalUpdateInt)==0) currUnbalanced=Shop::unbalancedForce(/*useMaxForce=*/false,scene);
@@ -178,6 +184,9 @@
 	}
 	// update stress and strain
 	for(int axis=0; axis<3; axis++){
+#ifdef VELGRAD
+		if (scene->dt!=0) scene->cell->velGrad[axis][axis]=cellGrow[axis]/(scene->dt*refSize[axis]);
+#endif
 		strain[axis]+=cellGrow[axis]/refSize[axis];
 		// take in account something like poisson's effect here…
 		//Real bogusPoisson=0.25; int ax1=(axis+1)%3,ax2=(axis+2)%3;