← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4126: Revert "implement more accurate porosity calculation..." (temporary required in order to revert 9...

 

------------------------------------------------------------
revno: 4126
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
timestamp: Fri 2014-08-01 17:26:10 +0200
message:
  Revert "implement more accurate porosity calculation..." (temporary required in order to revert 915fd94606af6 without conflict)"
  
  This reverts commit 9e512fd50083292f5c04e05d10d59d66654f978d.
modified:
  examples/triax-tutorial/script-session1.py
  pkg/dem/TriaxialStressController.cpp
  pkg/dem/TriaxialStressController.hpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'examples/triax-tutorial/script-session1.py'
--- examples/triax-tutorial/script-session1.py	2014-07-24 14:00:28 +0000
+++ examples/triax-tutorial/script-session1.py	2014-08-01 15:26:10 +0000
@@ -68,7 +68,6 @@
  ## generate positions and input them in the simulation
  sp.makeClumpCloud(mn,mx,[c1],periodic=False)
  sp.toSimulation(material='spheres')
- O.bodies.updateClumpProperties()#get more accurate clump masses/volumes/inertia
 else:
  sp.makeCloud(mn,mx,-1,0.3333,num_spheres,False, 0.95,seed=1) #"seed" make the "random" generation always the same
  O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])

=== modified file 'pkg/dem/TriaxialStressController.cpp'
--- pkg/dem/TriaxialStressController.cpp	2014-07-24 14:00:28 +0000
+++ pkg/dem/TriaxialStressController.cpp	2014-08-01 15:26:10 +0000
@@ -15,7 +15,6 @@
 #include<assert.h>
 #include<yade/core/Scene.hpp>
 #include<yade/pkg/dem/Shop.hpp>
-#include<yade/core/Clump.hpp>
 
 CREATE_LOGGER(TriaxialStressController);
 YADE_PLUGIN((TriaxialStressController));
@@ -102,17 +101,13 @@
 	if (first) {
 		BodyContainer::iterator bi = scene->bodies->begin();
 		BodyContainer::iterator biEnd = scene->bodies->end();
-		particlesVolume = 0;
+		spheresVolume = 0;
 		for ( ; bi!=biEnd; ++bi ) {
+			if((*bi)->isClump()) continue;
 			const shared_ptr<Body>& b = *bi;
-			if (b->isClump()) {
-				const shared_ptr<Clump>& clump = YADE_PTR_CAST<Clump>(b->shape);
-				const shared_ptr<Body>& member = Body::byId(clump->members.begin()->first,scene);
-				particlesVolume += b->state->mass / member->material->density;
-			}
-			else if (b->isDynamic() && !b->isClumpMember()) {
+			if ( b->isDynamic() || b->isClumpMember() ) {
 				const shared_ptr<Sphere>& sphere = YADE_PTR_CAST<Sphere> ( b->shape );
-				particlesVolume += 1.3333333*Mathr::PI*pow ( sphere->radius, 3 );
+				spheresVolume += 1.3333333*Mathr::PI*pow ( sphere->radius, 3 );
 			}
 		}
 		first = false;
@@ -121,7 +116,7 @@
 	max_vel2=3 * height /(height+width+depth)*max_vel;
 	max_vel3 =3 * depth /(height+width+depth)*max_vel;
 
-	porosity = ( boxVolume - particlesVolume ) /boxVolume;
+	porosity = ( boxVolume - spheresVolume ) /boxVolume;
 	position_top = p_top->se3.position.y();
 	position_bottom = p_bottom->se3.position.y();
 	position_right = p_right->se3.position.x();
@@ -224,7 +219,7 @@
 }
 
 void TriaxialStressController::controlInternalStress ( Real multiplier ) {
-	particlesVolume *= pow ( multiplier,3 );
+	spheresVolume *= pow ( multiplier,3 );
 	BodyContainer::iterator bi    = scene->bodies->begin();
 	BodyContainer::iterator biEnd = scene->bodies->end();
 	for ( ; bi!=biEnd ; ++bi ) {

=== modified file 'pkg/dem/TriaxialStressController.hpp'
--- pkg/dem/TriaxialStressController.hpp	2014-07-24 14:00:28 +0000
+++ pkg/dem/TriaxialStressController.hpp	2014-08-01 15:26:10 +0000
@@ -41,8 +41,8 @@
 		//! The values of stresses
 		Vector3r	stress [6];
 		Vector3r	force [6];
-		//! Value of particles volume (solid volume of clumps and spheres)
-		Real particlesVolume;
+		//! Value of spheres volume (solid volume)
+		Real spheresVolume;
 		//! Value of box volume
 		Real boxVolume;
 		//! Sample porosity
@@ -151,8 +151,7 @@
 		.def_readonly("strainRate",&TriaxialStressController::getStrainRate,"Current strain rate in a vector d/dt(exx,eyy,ezz).")
 		.def_readonly("porosity",&TriaxialStressController::porosity,"Porosity of the packing.")
 		.def_readonly("boxVolume",&TriaxialStressController::boxVolume,"Total packing volume.")
-		.def_readonly("particlesVolume",&TriaxialStressController::particlesVolume,"Total volume of particles (clumps and spheres).")
-		.def_readonly("spheresVolume",&TriaxialStressController::particlesVolume,"Shorthand for :yref:`TriaxialStressController::particlesVolume`")
+		.def_readonly("spheresVolume",&TriaxialStressController::spheresVolume,"Total volume of spheres.")
 		.def_readonly("max_vel1",&TriaxialStressController::max_vel1,"see :yref:`TriaxialStressController::max_vel` |ycomp|")
 		.def_readonly("max_vel2",&TriaxialStressController::max_vel2,"see :yref:`TriaxialStressController::max_vel` |ycomp|")
 		.def_readonly("max_vel3",&TriaxialStressController::max_vel3,"see :yref:`TriaxialStressController::max_vel` |ycomp|")