← Back to team overview

yade-dev team mailing list archive

[svn] r1768 - trunk/pkg/dem/Engine/DeusExMachina

 

Author: eudoxos
Date: 2009-05-05 22:44:59 +0200 (Tue, 05 May 2009)
New Revision: 1768

Modified:
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
Log:
1. Fixing bug in TriaxialCompressionEngine (introduced by luc apparently).

Is there no-one using Triaxial? How is it possible that I have to track and fix
new bugs almost every time I want to use it, once in a few monts??



Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-05-05 06:53:11 UTC (rev 1767)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-05-05 20:44:59 UTC (rev 1768)
@@ -254,7 +254,7 @@
 	if ( Omega::instance().getCurrentIteration() % testEquilibriumInterval == 0 )
 	{
 		updateParameters ( ncb );
-		LOG_INFO("UnbalancedForce="<< UnbalancedForce);
+		LOG_INFO("UnbalancedForce="<< UnbalancedForce<<", rel stress "<< abs ( ( meanStress-sigma_iso ) /sigma_iso ));
 	}
 	
 	if ( currentState==STATE_LIMBO && autoStopSimulation )

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp	2009-05-05 06:53:11 UTC (rev 1767)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp	2009-05-05 20:44:59 UTC (rev 1768)
@@ -248,20 +248,17 @@
 			}
 		}
 		
-		// if the TriaxialCompressionEngine is used, sigma_iso is attributed to sigma1, sigma2 and sigma3
-		if (isTriaxialCompression){
-			sigma1 = sigma_iso;
-			sigma2 = sigma_iso;
-			sigma3 = sigma_iso;
-
-			max_vel1 = max_vel;
-			max_vel2 = max_vel;
-			max_vel3 = max_vel;
-		}
-		
 		firstRun = false;
-	
 	}
+
+	// NOT JUST at the first run, since sigma_iso may be changed
+	// if the TriaxialCompressionEngine is used, sigma_iso is attributed to sigma1, sigma2 and sigma3
+	if (isTriaxialCompression){
+		sigma1=sigma2=sigma3=sigma_iso;
+		max_vel1=max_vel2=max_vel3=max_vel;
+	}
+
+
 	porosity = ( boxVolume - spheresVolume ) /boxVolume;
 
 	position_top = p_top->se3.position.Y();
@@ -284,24 +281,15 @@
 		computeStressStrain(ncb);
 
 	if (!internalCompaction) {
-		//Vector3r wallForce (0, sigma_iso*width*depth, 0);
 		Vector3r wallForce (0, sigma2*width*depth, 0);
-		//if (wall_bottom_activated) controlExternalStress(wall_bottom, ncb, -wallForce, p_bottom, max_vel);
-		//if (wall_top_activated) controlExternalStress(wall_top, ncb, wallForce, p_top, max_vel);
 		if (wall_bottom_activated) controlExternalStress(wall_bottom, ncb, -wallForce, p_bottom, max_vel2);
 		if (wall_top_activated) controlExternalStress(wall_top, ncb, wallForce, p_top, max_vel2);
 		
-		//wallForce = Vector3r(sigma_iso*height*depth, 0, 0);
 		wallForce = Vector3r(sigma1*height*depth, 0, 0);
-		//if (wall_left_activated) controlExternalStress(wall_left, ncb, -wallForce, p_left, max_vel*width/height);
-		//if (wall_right_activated) controlExternalStress(wall_right, ncb, wallForce, p_right, max_vel*width/height);
 		if (wall_left_activated) controlExternalStress(wall_left, ncb, -wallForce, p_left, max_vel1*width/height);
 		if (wall_right_activated) controlExternalStress(wall_right, ncb, wallForce, p_right, max_vel1*width/height);
 		
-		//wallForce = Vector3r(0, 0, sigma_iso*height*width);
 		wallForce = Vector3r(0, 0, sigma3*height*width);
-		//if (wall_back_activated) controlExternalStress(wall_back, ncb, -wallForce, p_back, max_vel*depth/height);
-		//if (wall_front_activated) controlExternalStress(wall_front, ncb, wallForce, p_front, max_vel*depth/height);
 		if (wall_back_activated) controlExternalStress(wall_back, ncb, -wallForce, p_back, max_vel3*depth/height);
 		if (wall_front_activated) controlExternalStress(wall_front, ncb, wallForce, p_front, max_vel3*depth/height);
 	}




Follow ups