← Back to team overview

yade-dev team mailing list archive

[svn] r1608 - in trunk/pkg/dem: Engine/DeusExMachina PreProcessor

 

Author: chareyre
Date: 2009-01-05 16:00:15 +0100 (Mon, 05 Jan 2009)
New Revision: 1608

Modified:
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
   trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
   trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
Log:
The "stopSimulation" command in the compression engine is now optional, as sometimes you don't want it to stop at all(1).
The default behaviour of the compressionEngine is not affected, with autoStopSimulation=true by default.
However, the TriaxialTest IS affected : it sets autoStopSimulation=false by default.

(1) : First example, you want to run additional iterations to get an even more stable sample. Second example : you just want to see what 
happens if you let it run... which is almost impossible before this change.
 


Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-01-05 13:57:17 UTC (rev 1607)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-01-05 15:00:15 UTC (rev 1608)
@@ -44,6 +44,7 @@
 
 	autoUnload=true;
 	autoCompressionActivation=true;
+	autoStopSimulation=true;
 
 	UnbalancedForce = 1;
 	saveSimulation = false;
@@ -82,6 +83,7 @@
 	REGISTER_ATTRIBUTE(translationAxis);
 	//REGISTER_ATTRIBUTE(compressionActivated);
 	REGISTER_ATTRIBUTE(autoCompressionActivation);
+	REGISTER_ATTRIBUTE(autoStopSimulation);
 	REGISTER_ATTRIBUTE(testEquilibriumInterval);
 	REGISTER_ATTRIBUTE(currentState);
 	REGISTER_ATTRIBUTE(previousState);
@@ -259,7 +261,7 @@
 		LOG_INFO("UnbalancedForce="<< UnbalancedForce);
 	}
 	
-	if ( currentState==STATE_LIMBO )
+	if ( currentState==STATE_LIMBO && autoStopSimulation )
 	{		
 		Omega::instance().stopSimulationLoop();
 		return;

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2009-01-05 13:57:17 UTC (rev 1607)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2009-01-05 15:00:15 UTC (rev 1608)
@@ -113,6 +113,8 @@
 		//! Auto-switch from isotropic compaction or unloading state (if sigmaLateralConfinement<sigmaIsoCompaction)
 		// to uniaxial compression
 		bool autoCompressionActivation;
+		//! Stop the simulation when the sample reach STATE_LIMBO, or keep running
+		bool autoStopSimulation;
 		//! Auto-switch from isotropic compaction to unloading
 		bool autoUnload;
 		bool isotropicCompaction;

Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2009-01-05 13:57:17 UTC (rev 1607)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2009-01-05 15:00:15 UTC (rev 1608)
@@ -80,7 +80,9 @@
 #include <boost/random/variate_generator.hpp>
 #include <boost/random/normal_distribution.hpp>
 
+#include<yade/pkg-dem/MicroMacroAnalyser.hpp>
 
+
 CREATE_LOGGER(TriaxialTest);
 
 using namespace boost;
@@ -136,6 +138,7 @@
 	StabilityCriterion = 0.01;
 	autoCompressionActivation = true;
 	autoUnload = true;
+	autoStopSimulation = false;
 	maxMultiplier = 1.01;
 	finalMaxMultiplier = 1.001;
 	
@@ -221,6 +224,7 @@
 	REGISTER_ATTRIBUTE(StabilityCriterion);
 	REGISTER_ATTRIBUTE(autoCompressionActivation);
 	REGISTER_ATTRIBUTE(autoUnload);
+	REGISTER_ATTRIBUTE(autoStopSimulation);
 	REGISTER_ATTRIBUTE(recordIntervalIter);
 	REGISTER_ATTRIBUTE(saveAnimationSnapshots);
 	REGISTER_ATTRIBUTE(AnimationSnapshotsBaseName);
@@ -596,6 +600,7 @@
 	triaxialcompressionEngine->StabilityCriterion = StabilityCriterion;
 	triaxialcompressionEngine->autoCompressionActivation = autoCompressionActivation;
 	triaxialcompressionEngine->autoUnload = autoUnload;
+	triaxialcompressionEngine->autoStopSimulation = autoStopSimulation;
 	triaxialcompressionEngine->internalCompaction = internalCompaction;
 	triaxialcompressionEngine->maxMultiplier = maxMultiplier;
 	triaxialcompressionEngine->finalMaxMultiplier = finalMaxMultiplier;
@@ -604,6 +609,8 @@
 	triaxialcompressionEngine->translationSpeed = translationSpeed;
 	triaxialcompressionEngine->fixedPorosity = fixedPorosity;
 	triaxialcompressionEngine->isotropicCompaction = isotropicCompaction;
+	
+	
 
 	
 	// recording global stress
@@ -652,7 +659,9 @@
 	//rootBody->engines.push_back(gravityCondition);
 	
 	rootBody->engines.push_back(shared_ptr<Engine> (new NewtonsDampedLaw));
-
+	
+	//if (0) rootBody->engines.push_back(shared_ptr<Engine>(new MicroMacroAnalyser));
+	
 	if(biaxial2dTest) rootBody->engines.push_back(makeItFlat);
 	
 	//if(!rotationBlocked)

Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.hpp	2009-01-05 13:57:17 UTC (rev 1607)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.hpp	2009-01-05 15:00:15 UTC (rev 1608)
@@ -94,6 +94,8 @@
 				,autoCompressionActivation
 				//! see docs for TriaxialCompressionEngine and TriaxialCompressionEngine::autoUnload
 				,autoUnload
+				//! stop the simulation or run it forever (i.e. until the user stops it)
+				,autoStopSimulation
 			
 				,rotationBlocked
 				,spheresRandomColor