[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2570: 1. Fix requestErase of erased interaction (thanks to Anton for reporting)

2010-11-25 Thread noreply

revno: 2570
fixes bug(s): https://launchpad.net/bugs/681018
committer: Václav Šmilauer 
branch nick: yade
timestamp: Thu 2010-11-25 09:56:11 +0100
message:
  1. Fix requestErase of erased interaction (thanks to Anton for reporting)
modified:
  core/InteractionContainer.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/InteractionContainer.cpp'
--- core/InteractionContainer.cpp	2010-11-24 19:54:29 +
+++ core/InteractionContainer.cpp	2010-11-25 08:56:11 +
@@ -84,7 +84,8 @@
 
 
 void InteractionContainer::requestErase(Body::id_t id1, Body::id_t id2, bool force){
-	find(id1,id2)->reset(); IdsForce v={id1,id2,force};
+	const shared_ptr& I=find(id1,id2); if(!I) return;
+	I->reset(); IdsForce v={id1,id2,force};
 	#ifdef YADE_OPENMP
 		threadsPendingErase[omp_get_thread_num()].push_back(v);
 	#else

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Bug 681018] Re: Crash in last revision

2010-11-25 Thread Václav Šmilauer
Now should be definitley fixed in r2570 (I tried yuor script). Let us
keep this bug open, so that I remember I should add a simple test to the
regression suite. Cheers, v.

-- 
Crash in last revision
https://bugs.launchpad.net/bugs/681018
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: In Progress

Bug description:
The simulation starts and after couple seconds of simulation it crashes.

The problem is in O.bodies.erase(i.id)

Test script and backtrace are attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Bug 681018] Re: Crash in last revision

2010-11-25 Thread Launchpad Bug Tracker
** Branch linked: lp:yade

-- 
Crash in last revision
https://bugs.launchpad.net/bugs/681018
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: In Progress

Bug description:
The simulation starts and after couple seconds of simulation it crashes.

The problem is in O.bodies.erase(i.id)

Test script and backtrace are attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2570: 1. Fix requestErase of erased interaction (thanks to Anton for reporting)

2010-11-25 Thread Anton Gladky
Thanks, Vaclav!

Should last commits be imported to 0.60?

Anton



On Thu, Nov 25, 2010 at 9:57 AM,  wrote:

> 
> revno: 2570
> fixes bug(s): https://launchpad.net/bugs/681018
> committer: Václav Šmilauer 
> branch nick: yade
> timestamp: Thu 2010-11-25 09:56:11 +0100
> message:
>  1. Fix requestErase of erased interaction (thanks to Anton for reporting)
> modified:
>  core/InteractionContainer.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/InteractionContainer.cpp'
> --- core/InteractionContainer.cpp   2010-11-24 19:54:29 +
> +++ core/InteractionContainer.cpp   2010-11-25 08:56:11 +
> @@ -84,7 +84,8 @@
>
>
>  void InteractionContainer::requestErase(Body::id_t id1, Body::id_t id2,
> bool force){
> -   find(id1,id2)->reset(); IdsForce v={id1,id2,force};
> +   const shared_ptr& I=find(id1,id2); if(!I) return;
> +   I->reset(); IdsForce v={id1,id2,force};
>#ifdef YADE_OPENMP
>threadsPendingErase[omp_get_thread_num()].push_back(v);
>#else
>
>
> ___
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2570: 1. Fix requestErase of erased interaction (thanks to Anton for reporting)

2010-11-25 Thread Václav Šmilauer

Should last commits be imported to 0.60?

No, 0.60 is not affected, that was bugs I introduced recently.

BTW go for the final 0.60 packages, if you have a while. It would be 
nice to try with gcc (to have openmp), but if it is too much hassle, 
just do it just with clang.


Cheers, Vaclav


___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2570: 1. Fix requestErase of erased interaction (thanks to Anton for reporting)

2010-11-25 Thread Anton Gladky
Ok, I will try. But I did not test packages yet. Can anyone try to start
your simulations from packaged version? We do really need it!

It is very simple, just:

sudo sudo add-apt-repository ppa:yade-pkg/stable; sudo apt-get install
yade-0.60

Anton



2010/11/25 Václav Šmilauer 

>  Should last commits be imported to 0.60?
>>
> No, 0.60 is not affected, that was bugs I introduced recently.
>
> BTW go for the final 0.60 packages, if you have a while. It would be nice
> to try with gcc (to have openmp), but if it is too much hassle, just do it
> just with clang.
>
> Cheers, Vaclav
>
>
>
> ___
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Bug 681018] Re: Crash in last revision

2010-11-25 Thread Anton Gladky
Thanks a lot, Vaclav! All is Ok now.

Anton

-- 
Crash in last revision
https://bugs.launchpad.net/bugs/681018
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: In Progress

Bug description:
The simulation starts and after couple seconds of simulation it crashes.

The problem is in O.bodies.erase(i.id)

Test script and backtrace are attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] 0.60 rc1 package error

2010-11-25 Thread Václav Šmilauer

sudo sudo add-apt-repository ppa:yade-pkg/stable; sudo apt-get install
yade-0.60
dpkg: error processing 
/var/cache/apt/archives/yade-0.60_rc1~maverick1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/pixmaps/yade16x16.xpm', which is also 
in package yade-bzr2490 bzr2490-maverick1


Oops. Can you fix that? You will have to append version (0.60) to the 
icons as well (and change it in the menu file), otherwise the packages 
will conflict. Or perhpas just don't put the menu stuff at all, it dos 
not work anyway.


Thanks, v.


___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [Bug 681018] Re: Crash in last revision

2010-11-25 Thread Klaus Thoeni
Hi Guys!

I just had a try with the new version, and finally, it works fine for me as
well.

Thanks

Klaus

On Thu, Nov 25, 2010 at 10:15 AM, Anton Gladky
<681...@bugs.launchpad.net>wrote:

> Thanks a lot, Vaclav! All is Ok now.
>
> Anton
>
> --
> Crash in last revision
> https://bugs.launchpad.net/bugs/681018
> You received this bug notification because you are a member of Yade
> developers, which is subscribed to Yade.
>
> Status in Yet Another Dynamic Engine: In Progress
>
> Bug description:
> The simulation starts and after couple seconds of simulation it crashes.
>
> The problem is in O.bodies.erase(i.id)
>
> Test script and backtrace are attached.
>
>
>
> ___
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>

-- 
Crash in last revision
https://bugs.launchpad.net/bugs/681018
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: In Progress

Bug description:
The simulation starts and after couple seconds of simulation it crashes.

The problem is in O.bodies.erase(i.id)

Test script and backtrace are attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] 0.60 rc1 package error

2010-11-25 Thread Anton Gladky
Ok, will fix it.

I think it is good to have a button in menu anyway. I will try to find out,
why it does not work for us.

Anton



2010/11/25 Václav Šmilauer 

>  sudo sudo add-apt-repository ppa:yade-pkg/stable; sudo apt-get install
>> yade-0.60
>>
> dpkg: error processing
> /var/cache/apt/archives/yade-0.60_rc1~maverick1_amd64.deb (--unpack):
>  trying to overwrite '/usr/share/pixmaps/yade16x16.xpm', which is also in
> package yade-bzr2490 bzr2490-maverick1
>
> Oops. Can you fix that? You will have to append version (0.60) to the icons
> as well (and change it in the menu file), otherwise the packages will
> conflict. Or perhpas just don't put the menu stuff at all, it dos not work
> anyway.
>
> Thanks, v.
>
>
> ___
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Bug 681307] [NEW] regular-sphere-pack examples crashes at debug-version

2010-11-25 Thread Anton Gladky
Public bug reported:

regular-sphere-pack works fine at optimized build and crashes at debug-
build.

Backtrace is attached.

** Affects: yade
 Importance: Undecided
 Status: New

-- 
regular-sphere-pack examples crashes at debug-version
https://bugs.launchpad.net/bugs/681307
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: New

Bug description:
regular-sphere-pack works fine at optimized build and crashes at debug-build.

Backtrace is attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Bug 681307] Re: regular-sphere-pack examples crashes at debug-version

2010-11-25 Thread Anton Gladky

** Attachment added: "backtrace.tgz"
   
https://bugs.launchpad.net/bugs/681307/+attachment/1744512/+files/backtrace.tgz

-- 
regular-sphere-pack examples crashes at debug-version
https://bugs.launchpad.net/bugs/681307
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: New

Bug description:
regular-sphere-pack works fine at optimized build and crashes at debug-build.

Backtrace is attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Bug 681307] Re: regular-sphere-pack examples crashes at debug-version

2010-11-25 Thread Václav Šmilauer
*** This bug is a duplicate of bug 669095 ***
https://bugs.launchpad.net/bugs/669095

** This bug has been marked a duplicate of bug 669095
   error: Body's boundary metting its opposite boundary
 * You can subscribe to bug 669095 by following this link: 
https://bugs.launchpad.net/yade/+bug/669095/+subscribe

-- 
regular-sphere-pack examples crashes at debug-version
https://bugs.launchpad.net/bugs/681307
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: New

Bug description:
regular-sphere-pack works fine at optimized build and crashes at debug-build.

Backtrace is attached.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2571: - FlowEngine : rewrite updateVolume so that cell volumes are not computed twice.

2010-11-25 Thread noreply

revno: 2571
committer: Bruno Chareyre 
branch nick: yade
timestamp: Thu 2010-11-25 13:16:32 +0100
message:
  - FlowEngine : rewrite updateVolume so that cell volumes are not computed 
twice.
  - Remove irrelevant remark in SCPE
  - Some missing "6D" here and ther in decorations (could affect only 
devirtualized build) 
modified:
  pkg/common/Cylinder.cpp
  pkg/common/Cylinder.hpp
  pkg/dem/FlowEngine.cpp
  pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp
  pkg/dem/SampleCapillaryPressureEngine.hpp


--
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 'pkg/common/Cylinder.cpp'
--- pkg/common/Cylinder.cpp	2010-11-12 18:44:15 +
+++ pkg/common/Cylinder.cpp	2010-11-25 12:16:32 +
@@ -9,10 +9,11 @@
 ChainedCylinder::~ChainedCylinder(){}
 ChainedState::~ChainedState(){}
 CylScGeom::~CylScGeom(){}
-
-
-YADE_PLUGIN(
-	(Cylinder)(ChainedCylinder)(ChainedState)(CylScGeom)(Ig2_Sphere_ChainedCylinder_CylScGeom)(Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D)
+// Ig2_Sphere_ChainedCylinder_CylScGeom::~Ig2_Sphere_ChainedCylinder_CylScGeom() {}
+// Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D::~Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D() {}
+
+
+YADE_PLUGIN((Cylinder)(ChainedCylinder)(ChainedState)(CylScGeom)(Ig2_Sphere_ChainedCylinder_CylScGeom)(Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D)
 	#ifdef YADE_OPENGL
 		(Gl1_Cylinder)(Gl1_ChainedCylinder)
 	#endif
@@ -64,7 +65,7 @@
 	Real dist = direction.dot(branch);
 // 	if ((dist<-interactionDetectionFactor*cylinder->radius) && !c->isReal()) return (false);//position _before_ start of cylinder
 	if ((dist<-interactionDetectionFactor*cylinder->radius) && isNew) return (false);//position _before_ start of cylinder
-		
+
 	//Check sphere-cylinder distance
 	Vector3r projectedP = cylinderSt->pos+shift2 + direction*dist;
 	branch = projectedP-sphereSt->pos;
@@ -74,7 +75,7 @@
 	shared_ptr scm;
 	if(!isNew) scm=YADE_PTR_CAST(c->geom);
 	else { scm=shared_ptr(new CylScGeom()); c->geom=scm; }
-	
+
 	scm->radius1=sphere->radius;
 	scm->radius2=cylinder->radius;
 	scm->id3=cylinderSt->chains[cylinderSt->chainNumber][cylinderSt->rank+1];
@@ -160,9 +161,9 @@
 	const ChainedState& bchain2 = revert? *pChain1 : *pChain2;
 	if (bchain2.rank-bchain1.rank != 1) {/*cerr<<"Mutual contacts in same chain between not adjacent elements, not handled*/ return false;}
 	if (pChain2->chainNumber!=pChain1->chainNumber) {cerr<<"PROBLEM0124"<(revert? cm2.get():cm1.get());
-	
+
 	shared_ptr scm;
 	bool isNew = !c->geom;
 	if(!isNew) scm=YADE_PTR_CAST(c->geom);
@@ -176,8 +177,8 @@
 	scm->contactPoint=bchain2.pos;
 	//bs1->segment used for fast BBs and projections + display
 	bs1->segment= bchain2.pos-bchain1.pos;
-#ifdef YADE_OPENGL 
-	//bs1->length and s1->chainedOrientation used for display only, 
+#ifdef YADE_OPENGL
+	//bs1->length and s1->chainedOrientation used for display only,
 	bs1->length=length;
 	bs1->chainedOrientation.setFromTwoVectors(Vector3r::UnitZ(),bchain1.ori.conjugate()*segt);
 #endif
@@ -301,10 +302,10 @@
 //gluDeleteQuadric(quadObj);
 //glPopMatrix();
 // //GLERROR;
-// 	
+//
 // // 	glEndList();}
 // // 	glCallList(glCylinderList);
-// 
+//
 // }
 
 //!##	BOUNDS FUNCTOR   #

=== modified file 'pkg/common/Cylinder.hpp'
--- pkg/common/Cylinder.hpp	2010-11-12 18:44:15 +
+++ pkg/common/Cylinder.hpp	2010-11-25 12:16:32 +
@@ -1,9 +1,9 @@
 #pragma once
+#include
 #include
 #include
 #include
 #include
-#include
 #include
 #include
 #ifdef YADE_OPENGL
@@ -13,28 +13,31 @@
 
 class Cylinder: public Sphere{
 	public:
-		Cylinder(Real _radius, Real _length): length(_length) { /*segment=Vector3r(0,0,1)*_length;*/ radius=_radius; createIndex(); }
+// 		Cylinder(Real _radius, Real _length): length(_length) { /*segment=Vector3r(0,0,1)*_length;*/ radius=_radius; createIndex(); }
 		virtual ~Cylinder ();
 	YADE_CLASS_BASE_DOC_ATTRS_CTOR(Cylinder,Sphere,"Geometry of a cylinder, as Minkowski sum of line and sphere.",
 // 		((Real,radius,NaN,,"Radius [m]"))
 		((Real,length,NaN,,"Length [m]"))
 		((Vector3r,segment,Vector3r::Zero(),,"Length vector")),
 		createIndex();
+
 		/*ctor*/
+		segment=Vector3r(0,0,1)*length;
 	);
 	REGISTER_CLASS_INDEX(Cylinder,Sphere);
 };
+REGISTER_SERIALIZABLE(Cylinder);
 
 class ChainedCylinder: public Cylinder{
 	public:
-		ChainedCylinder(Real _radius, Real _length): Cylinder(_radius,_length){}
+// 		ChainedCylinder(Real _radius, Real _length);/*: Cylinder(_radius,_length){}*/
 		virtual ~ChainedCylinder ();
-		 
+
 		//Keep pointers or copies of connected states?
 // 		ChainedState st1, st2;
-		
-
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(ChainedCylinder,Cylinder,"Geometry of a deformable chained cylinder, using geometry :yref:`MinkCylinder`.",
+
+
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ch

[Yade-dev] [Bug 669095] Re: error: Body's boundary metting its opposite boundary

2010-11-25 Thread Anton Gladky
Vaclav, is it possible to apply this fix to the current trunk?

-- 
error: Body's boundary metting its opposite boundary
https://bugs.launchpad.net/bugs/669095
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: Fix Committed

Bug description:
When I try to add polydisp spheres into periodic domain I get a error:

FATAL /home/sega/work/yade/trunk/pkg/common/InsertionSortCollider.cpp:343 
insertionSortPeri: Inversion of body's #29 boundary with its other boundary, 
0.5 meets 0.375
FATAL /home/sega/work/yade/trunk/core/ThreadRunner.cpp:31 run: Exception 
occured: 
/home/sega/work/yade/trunk/pkg/common/InsertionSortCollider.cpp: Body's 
boundary metting its opposite boundary.

With monodisp spheres no error occurs.

I attach a test script.



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2572: - new function for adding bounding planes

2010-11-25 Thread noreply

revno: 2572
committer: Emanuele Catalano 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 'lib/triangulation/FlowBoundingSphere.cpp'
--- lib/triangulation/FlowBoundingSphere.cpp	2010-11-19 17:18:56 +
+++ lib/triangulation/FlowBoundingSphere.cpp	2010-11-25 14:22:43 +
@@ -180,13 +180,11 @@
 //GenerateVoxelFile(); ///*GENERATION OF A VOXEL FILE *///
 
 /** INITIALIZATION OF VOLUMES AND PRESSURES **/
-	Real totV=0;
 Finite_cells_iterator cell_end = Tri.finite_cells_end();
 for (Finite_cells_iterator cell = Tri.finite_cells_begin(); cell != cell_end; cell++) {
-		cell->info().volume() = Volume_Pore(cell); totV+=cell->info().volume();
+		cell->info().volume() = ( std::abs ( ( CGT::Tetraedre ( cell->vertex(0)->point(),cell->vertex(1)->point(),cell->vertex(2)->point(),cell->vertex(3)->point()).volume() ) ) );
 cell->info().dv() = 0;
 }
-if(DEBUG_OUT) cerr << "TOTAL VOID VOLUME: "(alpha*(x_max-x_min)) && p1.x()<((alpha+step)*(x_max-x_min))){cell->info().p() = (Pressure/2)*(1+cos(alpha*M_PI));}
+	  if (p1.x()<0) cell->info().p() = Pressure;
+	  else if (p1.x()>x_max) cell->info().p() = 0.f;
+	  else if (p1.x()>(alpha*(x_max-x_min)) && p1.x()<((alpha+step)*(x_max-x_min))) cell->info().p() = (Pressure/2)*(1+cos(alpha*M_PI));
 	  }
 	  }
 	}
@@ -688,12 +690,11 @@
 	int NEG=0, POS=0, pass=0;
 
 	bool ref = Tri.finite_cells_begin()->info().isvisited;
-
 	Vecteur n;
 // std::ofstream oFile( "Radii",std::ios::out);
 // 	std::ofstream fFile( "Radii_Fictious",std::ios::out);
 // std::ofstream kFile ( "LocalPermeabilities" ,std::ios::app );
-	Real meanK=0, STDEV=0;
+	Real meanK=0, STDEV=0, meanRadius=0, meanDistance=0;
 	Real infiniteK=1e10;
 
 	for (Finite_cells_iterator cell = Tri.finite_cells_begin(); cell != cell_end; cell++) {
@@ -741,7 +742,8 @@
 (cell->info().k_norm())[j]= k*k_factor;
 // (cell->info().facetSurf())[j]= k*n;
 (neighbour_cell->info().k_norm())[Tri.mirror_index(cell, j)]= k*k_factor;
-
+meanDistance += distance;
+meanRadius += radius;
 meanK += (cell->info().k_norm())[j];
 
 // if (!meanK_LIMIT) kFile << ( cell->info().k_norm() )[j] << endl;
@@ -752,11 +754,15 @@
 		cell->info().isvisited = !ref;
 	}
 	meanK /= pass;
+	meanRadius /= pass;
+	meanDistance /= pass;
 	double maxKdivKmean=MAXK_DIV_KMEAN;
 	if (DEBUG_OUT) {
 		cout << "PassCompK = " << pass << endl;
 		cout << "meanK = " << meanK << endl;
 		cout << "maxKdivKmean = " << maxKdivKmean << endl;
+		cout << "meanTubesRadius = " << meanRadius << endl;
+		cout << "meanDistance = " << meanDistance << endl;
 	}
 	ref = Tri.finite_cells_begin()->info().isvisited;
 	pass=0;

=== modified file 'lib/triangulation/FlowBoundingSphere.hpp'
--- lib/triangulation/FlowBoundingSphere.hpp	2010-11-19 17:18:56 +
+++ lib/triangulation/FlowBoundingSphere.hpp	2010-11-25 14:22:43 +
@@ -158,6 +158,7 @@
 // 		double volume_double_fictious_pore (Vertex_handle SV1, Vertex_handle SV2, Vertex_handle SV3, Point& PV1, Point& PV2, Vecteur& facetSurface);
 
 // 		double PoreVolume (RTriangulation& Tri, Cell_handle cell);
+// 		void Slice_Average_Cell_Velocity();
 		int Average_Cell_Velocity(int id_sphere, RTriangulation& Tri);
 		void Average_Cell_Velocity();
 		void Average_Grain_Velocity();

=== modified file 'lib/triangulation/Network.cpp'
--- lib/triangulation/Network.cpp	2010-11-17 20:07:21 +
+++ lib/triangulation/Network.cpp	2010-11-25 14:22:43 +
@@ -31,30 +31,13 @@
 const double FAR = 500;
 
 using namespace std;
-using namespace boost;
+// using namespace boost;
 namespace CGT {
 
 Network::~Network(){}
 
 Network::Network(){}
 
-double Network::Volume_Pore ( Cell_handle cell)
-{
-	RTriangulation& Tri = T[currentTes].Triangulation();
-	Real v;
-	switch (cell->info().fictious()) {
-case(0) :
-v=std::abs(Tri.tetrahedron(cell).volume());
-for (int k=0;k<4;k++) v-= spherical_triangle_volume(cell->vertex(permut4[k][0])->point(),
-	cell->vertex(permut4[k][1])->point(),
-	cell->vertex(permut4[k][2])->point(),
-	cell->vertex(permut4[k][3])->point());
-return v;
-case(1) : return 0;
-case(2) : return 0;
-			case(3) : return 0;}
-}
-
 int Network::Detect_facet_fictious_vertices (Cell_handle& cell, int& j)
 {
 	fictious_vertex = 0;
@@ -104,6 +87,8 @@
 
 		Vsolid_tot += Vsolid1 + Vsolid2;
 		Vporale += Vtot - (Vsolid1 + Vsolid2);
+		V_porale_porosity += Vtot - (Vsolid1 + Vsolid2);
+		V_totale_porosity += Vtot;
 
 		/**Vpore**/ return Vtot - (Vsolid1 + Vsolid2);
 }; break;
@@ -116,20 +101,20 @@
 double A [3], B[3];
 
 Boundary &bi1

Re: [Yade-dev] can't launch yade

2010-11-25 Thread Giulia Macaro
I don't get the FPE but:

*giu...@engs-19155:~$ gdb /usr/bin/python
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
(gdb) run /home/giulia/YADE/bin/yade-bzr2567 --debug -x/
Starting program: /usr/bin/python /home/giulia/YADE/bin/yade-bzr2567 --debug
-x/
[Thread debugging using libthread_db enabled]
Usage: yade-bzr2567 [options] [ simulation.xml[.bz2] | script.py [script
options]]

yade-bzr2567: error: no such option: -/

Program exited with code 02.*


I have tried without -/, and I got:
*
(gdb) run /home/giulia/YADE/bin/yade-bzr2567
Starting program: /usr/bin/python /home/giulia/YADE/bin/yade-bzr2567
[Thread debugging using libthread_db enabled]
Welcome to Yade bzr2567

Program received signal SIGFPE, Arithmetic exception.
0x7fffe6d4602f in OpenMPAccumulator::OpenMPAccumulator() ()
   from /home/giulia/YADE/lib/yade-bzr2567/plugins/libplugins.so
(gdb) thread apply bt full
*
but I don't have anything after that.. I'm completely lost


Here it is the scons.profile-default:

PREFIX = '/home/giulia/YADE'
exclude = 'none'
features = 'gts,log4cxx,opengl,openmp,vtk'
CXXFLAGS = []
SHCCFLAGS = ['-fPIC']


Any ideas?

Thanks
Giulia


2010/11/25 chiara modenese 

>
>
> -- Forwarded message --
> From: Václav Šmilauer 
> Date: 2010/11/24
> Subject: Re: [Yade-dev] [Yade-users] can't launch yade
> To: Yade Development Group 
>
>
>  I've heard that other people are running yade on ubuntu 09.10 but they
>> don't have the same problem.
>>
> The OS is not the problem, as far as I can imagine, don't worry.
>
>
>> What "floating point exception" stands for?
>>
> http://en.wikipedia.org/wiki/SIGFPE
>
> Ah, when you post the debugger output, also attach the
> scons.profile-default file (or another scons.profile-*, depending on which
> one was used for the compilation), it is in the source directory.
>
> v
>
>
> ___
>
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
>
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2573: 1. Assume cache line size 64 bytes in OpenMPAccumulator, if sysconf reports zero (should fix star...

2010-11-25 Thread noreply

revno: 2573
committer: Václav Šmilauer 
branch nick: yade
timestamp: Thu 2010-11-25 21:20:58 +0100
message:
  1. Assume cache line size 64 bytes in OpenMPAccumulator, if sysconf reports 
zero (should fix startup FPU exception reported by Giulia)
modified:
  lib/base/openmp-accu.hpp


--
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 'lib/base/openmp-accu.hpp'
--- lib/base/openmp-accu.hpp	2010-11-07 11:46:20 +
+++ lib/base/openmp-accu.hpp	2010-11-25 20:20:58 +
@@ -81,13 +81,17 @@
 */
 template
 class OpenMPAccumulator{
+		// in the ctor, assume 64 bytes (arbitrary, but safe) if sysconf does not report anything meaningful
+		// that might happen on newer proc models not yet reported by sysconf (?)
+		// e.g. https://lists.launchpad.net/yade-dev/msg06294.html
+		// where zero was reported, leading to FPU exception at startup
 		int CLS; // cache line size
 		int nThreads;
 		int eSize; // size of an element, computed from cache line size and sizeof(T)
 		char* data; // use void* rather than T*, since with T* the pointer arithmetics has sizeof(T) as unit, which is confusing; char* takes one byte
 	public:
 	// initialize storage with _zeroValue, depending on muber of threads
-	OpenMPAccumulator(): CLS(sysconf(_SC_LEVEL1_DCACHE_LINESIZE)), nThreads(omp_get_max_threads()), eSize(CLS*(sizeof(T)/CLS+(sizeof(T)%CLS==0 ? 0 :1))) {
+	OpenMPAccumulator(): CLS(sysconf(_SC_LEVEL1_DCACHE_LINESIZE)>0 ? sysconf(_SC_LEVEL1_DCACHE_LINESIZE) : 64), nThreads(omp_get_max_threads()), eSize(CLS*(sizeof(T)/CLS+(sizeof(T)%CLS==0 ? 0 :1))) {
 		int succ=posix_memalign(/*where allocated*/(void**)&data,/*alignment*/CLS,/*size*/ nThreads*eSize);
 		if(succ!=0) throw std::runtime_error("OpenMPAccumulator: posix_memalign failed to allocate memory.");
 		reset();

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] can't launch yade

2010-11-25 Thread Václav Šmilauer
/Starting program: /usr/bin/python /home/giulia/YADE/bin/yade-bzr2567 
--debug -x/

[Thread debugging using libthread_db enabled]
Usage: yade-bzr2567 [options] [ simulation.xml[.bz2] | script.py 
[script options]]


yade-bzr2567: error: no such option: -/
/
Oops, that was a typo on my part, it should have been just -x (without 
the slash), sorry.



/Program received signal SIGFPE, Arithmetic exception.
0x7fffe6d4602f in OpenMPAccumulator::OpenMPAccumulator() ()
   from /home/giulia/YADE/lib/yade-bzr2567/plugins/libplugins.so
(gdb) thread apply bt full
/
but I don't have anything after that.. I'm completely lost
Excellent! Had you run with --debug, you would get backtrace, but this 
is good enough already! I think I fixed it in the latest revision 
(2573). Do "bzr up" and re-compile, it should work. In the unexpected 
case that it does not, run again in the debugger and inside (gdb) run 
yade with --debug (with or without -x, that does not make much difference).


Explanation: since there is only one int division in OpenMPAccumulator 
constructor (by the constant CLS, cache line size, hardware-defined 
property of the CPU), it is apparently CLS that is not assigned 
correctly by sysconf(_SC_LEVEL1_DCACHE_LINESIZE) for your processor: it 
should be something like 32, 64, 128 but in your case it gives zero -- I 
guess that your processor model is too new for the system lib to know it 
(ubuntu 9.10 you said, right?). I added a check for zero value there, in 
which case 64 will be used as fallback.


Cheers, Vaclav

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] New Material and new contact law

2010-11-25 Thread Klaus Thoeni
Hi Guys!

I have to implement a simple contact law which considers normal tensile force 
only but elasto-plastic behaviour (steel wire). Once the connection breaks 
there is no more interaction. Any idea if there is already something similar 
in the code? 

Any suggestion how to start? I was thinking to create a new material 
ElPlastMat. Makes it sense or not?

I am still not really familiar with the code. So I appreciate any kind of 
help.

Thanks

Klaus

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2574: 1. Changes from 0.60 (debian packaging).

2010-11-25 Thread noreply

revno: 2574
committer: Anton Gladky 
branch nick: trunk
timestamp: Fri 2010-11-26 08:42:42 +0100
message:
  1. Changes from 0.60 (debian packaging).
removed:
  debian/yade-dbg.menu-template
added:
  debian/yade.desktop-template
modified:
  debian/rules
  debian/yade.menu-template
  debian/yade.postinst-template
  scripts/debian-prep


--
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 'debian/rules'
--- debian/rules	2010-10-16 18:31:17 +
+++ debian/rules	2010-11-26 07:42:42 +
@@ -51,7 +51,7 @@
 	# remove the profile, if existing, to have clean config
 	rm -f scons.profile-deb
 	# the last argument specified that we only want files in lib installed -- common files (the executable) are already in the optimized package
-	NO_SCONS_GET_RECENT= scons profile=deb buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=1 jobs=1 features=vtk,gts,opengl,openmp,qt4 PREFIX=debian/yade${_VERSION}-dbg/usr variant='' optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2 QT4DIR=/usr/share/qt4 debian/yade${_VERSION}-dbg/usr/lib
+	NO_SCONS_GET_RECENT= scons profile=deb buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=5 jobs=1 features=vtk,gts,opengl,qt4 PREFIX=debian/yade${_VERSION}-dbg/usr variant='' optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2 QT4DIR=/usr/share/qt4 debian/yade${_VERSION}-dbg/usr/lib
 	#optimized build
 	NO_SCONS_GET_RECENT= scons profile=deb PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
 	#install platform-independent files (docs, scripts, examples)
@@ -59,7 +59,11 @@
 	cp -r examples scripts debian/yade${_VERSION}/usr/share/doc/yade${_VERSION}
 	# copy pixmap files in relevant directories
 	mkdir -p debian/yade${_VERSION}/usr/share/pixmaps
-	cp debian/*.xpm debian/yade${_VERSION}/usr/share/pixmaps
+	mkdir -p debian/yade${_VERSION}/usr/share/applications
+	cp debian/yade16x16.xpm debian/yade${_VERSION}/usr/share/pixmaps/yade${_VERSION}_16x16.xpm
+	cp debian/yade32x32.xpm debian/yade${_VERSION}/usr/share/pixmaps/yade${_VERSION}_32x32.xpm
+	cp debian/yade${_VERSION}.desktop debian/yade${_VERSION}/usr/share/applications/
+	dh_installmenu
 
 	# UGLY! generate sphinx docs only if python-sphinx is installed (distinguishes distributions which should build it or not as per debian/control-template build-deps)
 	if dpkg-query -W python-sphinx; then cd doc/sphinx; PYTHONPATH=. YADE_PREFIX=../../debian/yade${_VERSION}/usr/ ../../debian/yade${_VERSION}/usr/bin/yade${_VERSION} yadeSphinx.py; cd _build/latex; xelatex Yade.tex; xelatex Yade.tex; xelatex Yade.tex; cd ../..; mkdir -p ../../debian/yade${_VERSION}-doc/usr/share/doc/yade${_VERSION}; cp -r _build/html _build/latex/Yade.pdf ../../debian/yade${_VERSION}-doc/usr/share/doc/yade${_VERSION}; else echo "Not building HTML documentation, since the python-sphinx package is not installed"; fi
@@ -75,7 +79,7 @@
 	YADE_PREFIX=debian/yade${_VERSION}-dbg/usr debian/yade${_VERSION}/usr/bin/yade${_VERSION} --debug --test
 
 # Build architecture-independent files here.
-binary-indep: build install
+binary-indep: build install 
 # We have nothing to do by default.
 
 # Build architecture-dependent files here.
@@ -87,7 +91,6 @@
 	dh_installdocs
 	dh_installexamples
 #	dh_install
-	dh_installmenu
 #	dh_installdebconf	
 #	dh_installlogrotate
 #	dh_installemacsen

=== removed file 'debian/yade-dbg.menu-template'
--- debian/yade-dbg.menu-template	2010-10-16 18:31:17 +
+++ debian/yade-dbg.menu-template	1970-01-01 00:00:00 +
@@ -1,9 +0,0 @@
-?package(y...@_version@):\
-	needs="X11"\
-	section="Applications/Science/Physics"\
-	title="Yade (@SNAPSHOT@ @VERSION@)"\
-	command="x-terminal-emulator -T 'Yade @SNAPSHOT@ @VERSION@ (debug)' -x /usr/bin/y...@_version@ -- debug"\
-	icon=/usr/share/pixmaps/yade32x32.xpm\
-	icon16x16=/usr/share/pixmaps/yade16x16.xpm\
-	icon32x32=/usr/share/pixmaps/yade32x32.xpm
-

=== added file 'debian/yade.desktop-template'
--- debian/yade.desktop-template	1970-01-01 00:00:00 +
+++ debian/yade.desktop-template	2010-11-26 07:42:42 +
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Name=Yade @SNAPSHOT@ @VERSION@
+GenericName=Yade
+Exec=x-terminal-emulator -T 'Yade @SNAPSHOT@ @VERSION@' -x /usr/bin/y...@_version@
+Icon=/usr/share/pixmaps/y...@_version@_32x32.xpm
+Terminal=true
+Categories=Education;Physics;Science;

=== modified file 'debian/yade.menu-template'
--- debian/yade.menu-template	2010-10-16 18:31:17 +
+++ debian/yade.menu-template	2010-11-26 07:42:42 +
@@ -3,7 +3,7 @@
 	section="Applications/Science/Physics"\
 	title="Yade (@SNAPSHOT@ @VERSION@)"\
 	command="x-terminal-emulator -