← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1919: -Restore default behaviour even with #define VELGRAD, restore default homotheticCellResize=0 and ...

 

------------------------------------------------------------
revno: 1919
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Wed 2009-12-23 02:27:30 +0100
message:
  -Restore default behaviour even with #define VELGRAD, restore default homotheticCellResize=0 and register it. All py scripts should work whatever VELGRAD, except 
  periodic-triax-velgrad.py (throw without VELGRAD for homotheticCellResize=1).
  -Clean code 
  -Fix mail adress E.C.
modified:
  core/Cell.hpp
  core/Scene.hpp
  pkg/dem/Engine/GlobalEngine/NewtonIntegrator.cpp
  pkg/dem/Engine/GlobalEngine/NewtonIntegrator.hpp
  pkg/dem/Engine/PartialEngine/FlowEngine.cpp
  pkg/dem/Engine/PartialEngine/FlowEngine.hpp
  py/yadeWrapper/yadeWrapper.cpp
  scripts/test/periodic-triax-velgrad.py


--
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-22 19:01:20 +0000
+++ core/Cell.hpp	2009-12-23 01:27:30 +0000
@@ -29,7 +29,7 @@
 		Cell(): refSize(Vector3r(1,1,1)), strain(Matrix3r::ZERO)
 #ifdef VELGRAD
 				, velGrad(Matrix3r::ZERO) 
-				, Hsize(Matrix3r::IDENTITY)
+				, Hsize(Matrix3r::ZERO)
 				,_shearTrsfMatrix(Matrix3r::IDENTITY)
 				{ updateCache(0); }
 #else
@@ -107,9 +107,10 @@
 	// should be called before every step
 #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];}
 		//incremental disp gradient
-		_shearIncrt=dt*velGrad;
-		
+		_shearIncrt=dt*velGrad;		
 		//update Hsize (redundant with total transformation perhaps)
 		Hsize=Hsize+_shearIncrt*Hsize;
 		//total transformation

=== modified file 'core/Scene.hpp'
--- core/Scene.hpp	2009-12-22 19:01:20 +0000
+++ core/Scene.hpp	2009-12-23 01:27:30 +0000
@@ -23,7 +23,7 @@
 #define HOST_NAME_MAX 255 
 #endif
 
-//#define VELGRAD
+
 
 class Bound;
 

=== modified file 'pkg/dem/Engine/GlobalEngine/NewtonIntegrator.cpp'
--- pkg/dem/Engine/GlobalEngine/NewtonIntegrator.cpp	2009-12-22 19:01:20 +0000
+++ pkg/dem/Engine/GlobalEngine/NewtonIntegrator.cpp	2009-12-23 01:27:30 +0000
@@ -12,7 +12,6 @@
 #include<yade/pkg-common/VelocityBins.hpp>
 #include<yade/lib-base/yadeWm3Extra.hpp>
 
-//#define VELGRAD
 
 
 YADE_PLUGIN((NewtonIntegrator));

=== modified file 'pkg/dem/Engine/GlobalEngine/NewtonIntegrator.hpp'
--- pkg/dem/Engine/GlobalEngine/NewtonIntegrator.hpp	2009-12-22 19:01:20 +0000
+++ pkg/dem/Engine/GlobalEngine/NewtonIntegrator.hpp	2009-12-23 01:27:30 +0000
@@ -73,13 +73,13 @@
 		/// velocity bins (not used if not created)
 		shared_ptr<VelocityBins> velocityBins;
 		virtual void action(Scene *);		
-		NewtonIntegrator(): prevCellSize(Vector3r::ZERO),damping(0.2), maxVelocitySq(-1), exactAsphericalRot(false), homotheticCellResize(1){
+		NewtonIntegrator(): prevCellSize(Vector3r::ZERO),damping(0.2), maxVelocitySq(-1), exactAsphericalRot(false), homotheticCellResize(0){
 			#ifdef YADE_OPENMP
 				threadMaxVelocitySq.resize(omp_get_max_threads());
 			#endif
 		}
 
-	REGISTER_ATTRIBUTES(GlobalEngine,(damping)(maxVelocitySq)(exactAsphericalRot));
+	REGISTER_ATTRIBUTES(GlobalEngine,(damping)(maxVelocitySq)(exactAsphericalRot)(homotheticCellResize));
 	REGISTER_CLASS_AND_BASE(NewtonIntegrator,GlobalEngine);
 	DECLARE_LOGGER;
 };

=== modified file 'pkg/dem/Engine/PartialEngine/FlowEngine.cpp'
--- pkg/dem/Engine/PartialEngine/FlowEngine.cpp	2009-12-22 23:52:51 +0000
+++ pkg/dem/Engine/PartialEngine/FlowEngine.cpp	2009-12-23 01:27:30 +0000
@@ -1,6 +1,6 @@
 /*************************************************************************
 *  Copyright (C) 2009 by Emanuele Catalano                               *
-*  emanuele.catalanog.inpg.fr                                            *
+*  emanuele.catalanog@xxxxxxxxxxx                                            *
 *                                                                        *
 *  This program is free software; it is licensed under the terms of the  *
 *  GNU General Public License v2 or later. See file LICENSE for details. *

=== modified file 'pkg/dem/Engine/PartialEngine/FlowEngine.hpp'
--- pkg/dem/Engine/PartialEngine/FlowEngine.hpp	2009-12-22 18:19:41 +0000
+++ pkg/dem/Engine/PartialEngine/FlowEngine.hpp	2009-12-23 01:27:30 +0000
@@ -1,6 +1,6 @@
 /*************************************************************************
-*  Copyright (C) 2009 by Bruno Chareyre                                  *
-*  bruno.chareyre@xxxxxxxxxxx                                            *
+*  Copyright (C) 2009 by Emanuele Catalano                               *
+*  emanuele.catalanog@xxxxxxxxxxx                                            *
 *                                                                        *
 *  This program is free software; it is licensed under the terms of the  *
 *  GNU General Public License v2 or later. See file LICENSE for details. *

=== modified file 'py/yadeWrapper/yadeWrapper.cpp'
--- py/yadeWrapper/yadeWrapper.cpp	2009-12-22 19:01:20 +0000
+++ py/yadeWrapper/yadeWrapper.cpp	2009-12-23 01:27:30 +0000
@@ -56,7 +56,6 @@
 using namespace boost;
 using namespace std;
 
-//#define VELGRAD
 
 #include<yade/extra/boost_python_len.hpp>
 

=== modified file 'scripts/test/periodic-triax-velgrad.py'
--- scripts/test/periodic-triax-velgrad.py	2009-12-22 19:01:20 +0000
+++ scripts/test/periodic-triax-velgrad.py	2009-12-23 01:27:30 +0000
@@ -23,7 +23,7 @@
 		[Law2_Dem3Dof_Elastic_Elastic()]
 	),
 	PeriTriaxController(goal=[-1e5,-1e5,0],stressMask=3,globUpdate=5,maxStrainRate=[1.,1.,1.],doneHook='triaxDone()',label='triax'),
-	NewtonIntegrator(damping=.6),
+	NewtonIntegrator(damping=.6, homotheticCellResize=1),
 ]
 O.dt=0.1*utils.PWaveTimeStep()
 O.run(1)