[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2767: 1. Invalidate persistent collider data when interactions are cleared (not tested yet)

2011-02-27 Thread noreply

revno: 2767
committer: Václav Šmilauer e...@doxos.eu
branch nick: yade
timestamp: Sun 2011-02-27 14:54:43 +0100
message:
  1. Invalidate persistent collider data when interactions are cleared (not 
tested yet)
  2. Add renderer pointer to scene, so that functors can find display attributes
  3. Gl1_NormPhys honors displacement scaling now
  4. Fix scalarOnColorScale bug
  5. Add RadialForceEngine, fix AxialGravityEngine
modified:
  core/InteractionContainer.cpp
  core/InteractionContainer.hpp
  core/Scene.cpp
  core/Scene.hpp
  gui/qt4/GLViewer.cpp
  lib/base/Logging.hpp
  lib/serialization/Serializable.hpp
  pkg/common/ForceEngine.cpp
  pkg/common/ForceEngine.hpp
  pkg/common/GLDrawFunctors.hpp
  pkg/common/Gl1_NormPhys.cpp
  pkg/common/GravityEngines.cpp
  pkg/common/InsertionSortCollider.cpp
  pkg/common/InteractionLoop.cpp
  pkg/dem/Shop.cpp
  py/wrapper/yadeWrapper.cpp
  scripts/test/beam-l6geom.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/InteractionContainer.cpp'
--- core/InteractionContainer.cpp	2010-12-01 11:09:53 +
+++ core/InteractionContainer.cpp	2011-02-27 13:54:43 +
@@ -33,6 +33,7 @@
 	linIntrs.clear(); // clear the linear container
 	pendingErase.clear();
 	currSize=0;
+	dirty=true;
 }
 
 

=== modified file 'core/InteractionContainer.hpp'
--- core/InteractionContainer.hpp	2010-11-24 22:42:15 +
+++ core/InteractionContainer.hpp	2011-02-27 13:54:43 +
@@ -60,8 +60,10 @@
 		// used only during serialization/deserialization
 		vectorshared_ptrInteraction  interaction;
 	public:
+		// flag for notifying the collider that persistent data should be invalidated
+		bool dirty;
 		// required by the class factory... :-|
-		InteractionContainer(): currSize(0),serializeSorted(false),iterColliderLastRun(-1){
+		InteractionContainer(): currSize(0),dirty(false),serializeSorted(false),iterColliderLastRun(-1){
 			bodies=NULL;
 			#ifdef YADE_OPENMP
 threadsPendingErase.resize(omp_get_max_threads());
@@ -159,7 +161,7 @@
 	void postSave(InteractionContainer);
 
 
-	REGISTER_ATTRIBUTES(Serializable,(interaction)(serializeSorted));
+	REGISTER_ATTRIBUTES(Serializable,(interaction)(serializeSorted)(dirty));
 	REGISTER_CLASS_AND_BASE(InteractionContainer,Serializable);
 };
 REGISTER_SERIALIZABLE(InteractionContainer);

=== modified file 'core/Scene.cpp'
--- core/Scene.cpp	2011-01-20 14:55:15 +
+++ core/Scene.cpp	2011-02-27 13:54:43 +
@@ -74,10 +74,14 @@
 		checkStateTypes();
 		forces.resize(bodies-size()); // optimization, not necessary
 	}
-	// substepping or not, update engines from _nextEngines, if defined
-	if(!_nextEngines.empty()  subStep0){
+	// substepping or not, update engines from _nextEngines, if defined, at the beginning of step
+	// subStep can be 0, which happens if simulations is saved in the middle of step (without substepping)
+	// this assumes that prologue will not set _nextEngines, which is safe hopefully
+	if(!_nextEngines.empty()  (subStep0 || (subStep=0  !subStepping))){
 		engines=_nextEngines;
 		_nextEngines.clear();
+		// hopefully this will not break in some margin cases (subStepping with setting _nextEngines and such)
+		subStep=-1;
 	}
 	if(likely(!subStepping  subStep0)){
 		/* set substep to 0 during the loop, so that engines/nextEngines handler know whether we are inside the loop currently */

=== modified file 'core/Scene.hpp'
--- core/Scene.hpp	2011-01-29 22:47:18 +
+++ core/Scene.hpp	2011-02-27 13:54:43 +
@@ -26,6 +26,9 @@
 
 
 class Bound;
+#ifdef YADE_OPENGL
+	class OpenGLRenderer;
+#endif
 
 class Scene: public Serializable{
 	public:
@@ -54,6 +57,10 @@
 
 		shared_ptrEngine engineByName(const string s);
 
+		#ifdef YADE_OPENGL
+			shared_ptrOpenGLRenderer renderer;
+		#endif
+
 		void postLoad(Scene);
 
 		// bits for Scene::flags

=== modified file 'gui/qt4/GLViewer.cpp'
--- gui/qt4/GLViewer.cpp	2011-01-12 12:01:03 +
+++ gui/qt4/GLViewer.cpp	2011-02-27 13:54:43 +
@@ -515,13 +515,16 @@
 			}
 			renderer-clipPlaneSe3[manipulatedClipPlane]=newSe3;
 		}
-		renderer-render(Omega::instance().getScene(), selectedName());
+		const shared_ptrScene scene=Omega::instance().getScene();
+		scene-renderer=renderer;
+		renderer-render(scene, selectedName());
 	}
 }
 
 void GLViewer::drawWithNames(){
 	qglviewer::Vec vd=camera()-viewDirection(); renderer-viewDirection=Vector3r(vd[0],vd[1],vd[2]);
 	const shared_ptrScene scene(Omega::instance().getScene());
+	scene-renderer=renderer;
 	renderer-scene=scene;
 	renderer-renderShape();
 }

=== modified file 'lib/base/Logging.hpp'
--- lib/base/Logging.hpp	2011-02-15 16:52:24 +
+++ lib/base/Logging.hpp	2011-02-27 13:54:43 +
@@ -61,8 +61,8 @@
 #	define _LOG_HEAD __FILE__ :__LINE__ __FUNCTION__: 
 #	define LOG_TRACE(msg) // 

[Yade-dev] [Bug 724396] Re: crash after add particles in parallel mode

2011-02-27 Thread Václav Šmilauer
I don't think so. I think sizeof(vectorT) is always
sizeof(size_t)+sizeof(void*), the array is allocated on the heap
dynamically. For the independent resizing: sounds fine, though sizes
should be re-synced in sync() before the summation loop, otherwise it
will run slower due to in-loop size checks.

-- 
You received this bug notification because you are a member of Yade
developers, which is the registrant for Yade.
https://bugs.launchpad.net/bugs/724396

Title:
  crash after add particles in parallel mode

Status in Yet Another Dynamic Engine:
  New

Bug description:
  Yade crash in parallel mode if to add particles after run of simulation.
  Attached script runs without errors in serial mode (-j 1 option),
  but in parallel mode (-j 2 or more) it crash at second O.run.

___
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] buildbot failure in Yade on yade-full

2011-02-27 Thread buildbot
The Buildbot has detected a failed build of yade-full on Yade.
Full details are available at:
 http://yade-dem.org/buildbot/builders/yade-full/builds/401

Buildbot URL: http://yade-dem.org/buildbot/

Buildslave for this Build: r0calcul9

Build Reason: 
Build Source Stamp: 2767
Blamelist: Václav Šmilauer e...@doxos.eu

BUILD FAILED: failed test

sincerely,
 -The Buildbot


___
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 2768: fix error in last commit

2011-02-27 Thread noreply

revno: 2768
committer: Václav Šmilauer e...@doxos.eu
branch nick: yade
timestamp: Sun 2011-02-27 15:26:15 +0100
message:
  fix error in last commit
modified:
  pkg/common/InteractionLoop.cpp
  scripts/test/hdaps.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 'pkg/common/InteractionLoop.cpp'
--- pkg/common/InteractionLoop.cpp	2011-02-27 13:54:43 +
+++ pkg/common/InteractionLoop.cpp	2011-02-27 14:26:15 +
@@ -35,9 +35,11 @@
 		LOG_WARN(Interactions pending erase found (erased), no collider being used?);
 		alreadyWarnedNoCollider=true;
 	}
+	/*
 	if(scene-interactions-dirty){
 		throw std::logic_error(InteractionContainer::dirty is true; the collider should re-initialize in such case and clear the dirty flag.);
 	}
+	*/
 	// update Scene* of the dispatchers
 	geomDispatcher-scene=physDispatcher-scene=lawDispatcher-scene=scene;
 	// ask dispatchers to update Scene* of their functors

=== modified file 'scripts/test/hdaps.py'
--- scripts/test/hdaps.py	2011-01-12 16:22:18 +
+++ scripts/test/hdaps.py	2011-02-27 14:26:15 +
@@ -3,7 +3,7 @@
 # laptop.
 
 O.bodies.append(
-	geom.facetBox(center=(0,0,.1),extents=(.5,.5,.1),wallMask=31,color=(0,0,1))+
+	utils.facetBox(center=(0,0,.1),extents=(.5,.5,.1),wallMask=31,color=(0,0,1))+
 	[utils.sphere((0,0,.1),.04,color=(1,1,1))]
 )
 

___
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] Contact between two different materials

2011-02-27 Thread Klaus Thoeni
Hi Guys!

I try to implement an interaction between two different materials, e.g. between 
FrictMat and my WireMat.

My first guess would be to implement (in WirePM.cpp):
1. Ip2_WireMat_FrictMat_FrictPhys
2. Law2_ScGeam_FrictPhys_WirePM

Any comments or suggestions?

I saw that Chiara posted a similar questions last year but I couldn't find any 
implementation for that. So did anyone already implement something similar?

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


Re: [Yade-dev] Contact between two different materials

2011-02-27 Thread Bruno Chareyre
Hi Klaus,

It sounds correct. I think you are the first to do that.

I don't know if it will apply in your case, but note that it is possible
to make different materials interact without a Ip2_M1_M2_Phys functor,
as long as M2 inherits from M1 (or vice-versa).

See for instance:
https://yade-dem.org/wiki/Screenshots_and_videos#Representing_beams_and_wires_with_connected_cylinder

- spheres and boxes have FrictMat
- cylinders have CohFrictMat

Cylinders interact with the other shapes even though there is no
FrictMat_CohFrictMat functor.
Since CohFrictMat inherits from FrictMat, sphere-cylinder and
box-cylinder interactions will get FrictPhys from
Ip2_FrictMat_FrictMat_FrictPhys, and only cylinder-cylinder interactions
will be cohesive.
You could use the same strategy by making WireMat inherit from FrictPhys
(which would be logical if the WireMat interacts frictionaly with
spheres), if you think it is more convenient.

For the contact law, same remark: you need an additional contact law
_only if_ it will implement a new behaviour, else you can use one of the
existing laws (e.g. Law2_ScGeom_FrictPhys_CundallStrack is used for
cylinder-sphere interactions).

Cheers.

Bruno 


On 28/02/11 06:34, Klaus Thoeni wrote:
 Hi Guys!

 I try to implement an interaction between two different materials, e.g. 
 between 
 FrictMat and my WireMat.

 My first guess would be to implement (in WirePM.cpp):
 1. Ip2_WireMat_FrictMat_FrictPhys
 2. Law2_ScGeam_FrictPhys_WirePM

 Any comments or suggestions?

 I saw that Chiara posted a similar questions last year but I couldn't find 
 any 
 implementation for that. So did anyone already implement something similar?

 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



-- 
___
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43


___
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 2769: INSTALL_PREFIX option is added to CMakeLists.txt

2011-02-27 Thread noreply

revno: 2769
committer: Anton Gladky gladky.an...@gmail.com
branch nick: yade
timestamp: Mon 2011-02-28 08:55:17 +0100
message:
  INSTALL_PREFIX option is added to CMakeLists.txt
modified:
  CMakeLists.txt


--
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 'CMakeLists.txt'
--- CMakeLists.txt	2011-01-31 19:09:24 +
+++ CMakeLists.txt	2011-02-28 07:55:17 +
@@ -49,7 +49,14 @@
 	
 
 #set(CMAKE_VERBOSE_MAKEFILE 1)
-set(CMAKE_INSTALL_PREFIX /usr/local)
+IF (NOT INSTALL_PREFIX)
+ SET(CMAKE_INSTALL_PREFIX /usr/local)
+ MESSAGE(Yade will be installed to default path ${CMAKE_INSTALL_PREFIX}, if you want to override it use -DINSTALL_PREFIX option.)
+ELSE (NOT INSTALL_PREFIX)
+	SET(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX})
+	MESSAGE(Yade will be installed to ${CMAKE_INSTALL_PREFIX})
+ENDIF (NOT CMAKE_INSTALL_PREFIX)
+
 SET(YADE_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/yade-${SUFFIX})
 SET(YADE_EXEC_PATH ${CMAKE_INSTALL_PREFIX}/bin)
 SET(YADE_PY_PATH ${YADE_LIB_PATH}/py)

___
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