← Back to team overview

yade-dev team mailing list archive

[svn] r1906 - in trunk: pkg/dem/DataClass/InteractionGeometry pkg/dem/Engine/DeusExMachina pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry py/yadeWrapper

 

Author: eudoxos
Date: 2009-07-31 11:45:22 +0200 (Fri, 31 Jul 2009)
New Revision: 1906

Modified:
   trunk/pkg/dem/DataClass/InteractionGeometry/SpheresContactGeometry.hpp
   trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp
   trunk/py/yadeWrapper/yadeWrapper.cpp
Log:
1. Add docstrings to all wrapper.Omega() methods
2. Fix a few warnings.


Modified: trunk/pkg/dem/DataClass/InteractionGeometry/SpheresContactGeometry.hpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionGeometry/SpheresContactGeometry.hpp	2009-07-29 20:36:40 UTC (rev 1905)
+++ trunk/pkg/dem/DataClass/InteractionGeometry/SpheresContactGeometry.hpp	2009-07-31 09:45:22 UTC (rev 1906)
@@ -40,7 +40,7 @@
 		#endif
 
 
-		SpheresContactGeometry():contactPoint(Vector3r::ZERO),normal(GenericSpheresContact::normal),radius1(GenericSpheresContact::refR1),radius2(GenericSpheresContact::refR2)
+		SpheresContactGeometry():normal(GenericSpheresContact::normal),contactPoint(Vector3r::ZERO),radius1(GenericSpheresContact::refR1),radius2(GenericSpheresContact::refR2)
 		#ifdef SCG_SHEAR
 			,shear(Vector3r::ZERO), prevNormal(Vector3r::ZERO) /*initialized to proper value by geom functor*/
 		#endif

Modified: trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-29 20:36:40 UTC (rev 1905)
+++ trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-31 09:45:22 UTC (rev 1906)
@@ -27,25 +27,21 @@
 
 void FlowEngine::applyCondition(MetaBody* ncb)
 {
-
-    if (isActivated)
-    {
-        shared_ptr<BodyContainer>& bodies = ncb->bodies;
-
-
-
-	FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
+	if (!isActivated) return;
+	shared_ptr<BodyContainer>& bodies = ncb->bodies;
+	FOREACH(const shared_ptr<Body>& b, *bodies){
 		// clump members are non-dynamic; they skip the rest of loop once their forces are properly taken into account, however
 		//if (!b->isDynamic && !b->isClumpMember()) continue;
 		
-		RigidBodyParameters* rb = YADE_CAST<RigidBodyParameters*>(b->physicalParameters.get());
 		///Access data (examples)
-		const body_id_t& id=b->getId();
-		Real vx = rb->velocity[0];
-		Real rx = rb->angularVelocity[0];
-		Real x = rb->se3.position[0];
+		#if 0
+			RigidBodyParameters* rb = YADE_CAST<RigidBodyParameters*>(b->physicalParameters.get());
+			const body_id_t& id=b->getId();
+			Real vx = rb->velocity[0];
+			Real rx = rb->angularVelocity[0];
+			Real x = rb->se3.position[0];
+		#endif
 	}
-
 	///Compute flow and and forces here
 
 	
@@ -53,9 +49,6 @@
 	
 	
 	
-		
-	
-	
 	///End Compute flow and and forces
 	
 	
@@ -74,8 +67,6 @@
 		//ncb->bex.addTorque(id,t);
 
 	}
-	
-    }
 }
 
-YADE_PLUGIN("FlowEngine");
\ No newline at end of file
+YADE_PLUGIN("FlowEngine");

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp	2009-07-29 20:36:40 UTC (rev 1905)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp	2009-07-31 09:45:22 UTC (rev 1906)
@@ -158,10 +158,11 @@
 					     B=b1->id2,
 					     C=b2->id1,
 					     D=b2->id2;
-				if( !(A!=B && A!=C && B!=C) )
+				if( !(A!=B && A!=C && B!=C) ){
 					if( A==B )	A=D;
 					else if(A==C)	A=D;
 					else if(B==C)	B=D;
+				}
 
 				if(wire && (damaged.size()>static_cast<unsigned int>(std::max((*angles)->getId1(),(*angles)->getId2()))) && (damaged[(*angles)->getId1()]>=limit && damaged[(*angles)->getId2()]>=limit))
 				{

Modified: trunk/py/yadeWrapper/yadeWrapper.cpp
===================================================================
--- trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-29 20:36:40 UTC (rev 1905)
+++ trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-31 09:45:22 UTC (rev 1906)
@@ -588,50 +588,49 @@
 BOOST_PYTHON_MODULE(wrapper)
 {
 	python::class_<pyOmega>("Omega")
-		.add_property("iter",&pyOmega::iter)
-		.add_property("stopAtIter",&pyOmega::stopAtIter_get,&pyOmega::stopAtIter_set)
-		.add_property("time",&pyOmega::simulationTime)
-		.add_property("realtime",&pyOmega::realTime)
-		.add_property("dt",&pyOmega::dt_get,&pyOmega::dt_set)
-		.add_property("usesTimeStepper",&pyOmega::usesTimeStepper_get,&pyOmega::usesTimeStepper_set)
-		.def("load",&pyOmega::load)
-		.def("reload",&pyOmega::reload)
-		.def("save",&pyOmega::save)
-		.def("loadTmp",&pyOmega::loadTmp,omega_loadTmp_overloads(python::args("mark")))
-		.def("saveTmp",&pyOmega::saveTmp,omega_saveTmp_overloads(python::args("mark")))
-		.def("tmpToFile",&pyOmega::tmpToFile)
-		.def("tmpToString",&pyOmega::tmpToString)
-		.def("saveSpheres",&pyOmega::saveSpheres)
-		.def("run",&pyOmega::run,omega_run_overloads())
-		.def("pause",&pyOmega::pause)
-		.def("step",&pyOmega::step)
-		.def("wait",&pyOmega::wait)
-		.def("reset",&pyOmega::reset)
-		.def("switchWorld",&pyOmega::switchWorld)
-		.def("labeledEngine",&pyOmega::labeled_engine_get)
-		.def("resetTime",&pyOmega::resetTime)
-		.def("plugins",&pyOmega::plugins_get)
-		.add_property("engines",&pyOmega::engines_get,&pyOmega::engines_set)
-		.add_property("miscParams",&pyOmega::miscParams_get,&pyOmega::miscParams_set)
-		.add_property("initializers",&pyOmega::initializers_get,&pyOmega::initializers_set)
-		.add_property("bodies",&pyOmega::bodies_get)
-		.add_property("interactions",&pyOmega::interactions_get)
-		.add_property("actions",&pyOmega::bex_get)
-		.add_property("bex",&pyOmega::bex_get)
-		.add_property("tags",&pyOmega::tags_get)
-		.def("childClasses",&pyOmega::listChildClasses)
-		.def("isChildClassOf",&pyOmega::isChildClassOf)
-		.add_property("bodyContainer",&pyOmega::bodyContainer_get,&pyOmega::bodyContainer_set)
-		.add_property("interactionContainer",&pyOmega::interactionContainer_get,&pyOmega::interactionContainer_set)
-		.add_property("timingEnabled",&pyOmega::timingEnabled_get,&pyOmega::timingEnabled_set)
-		.add_property("bexSyncCount",&pyOmega::bexSyncCount_get,&pyOmega::bexSyncCount_set)
-		.add_property("numThreads",&pyOmega::numThreads_get,&pyOmega::numThreads_set)
+		.add_property("iter",&pyOmega::iter,"Get current step number")
+		.add_property("stopAtIter",&pyOmega::stopAtIter_get,&pyOmega::stopAtIter_set,"Get/set number of iteration after which the simulation will stop.")
+		.add_property("time",&pyOmega::simulationTime,"Return virtual (model world) time of the simulation.")
+		.add_property("realtime",&pyOmega::realTime,"Return clock (human world) time the simulation has been running.")
+		.add_property("dt",&pyOmega::dt_get,&pyOmega::dt_set,"Current timestep (assignable); note that assigning to dt will not turn of TimeStepper, if used.")
+		.add_property("usesTimeStepper",&pyOmega::usesTimeStepper_get,&pyOmega::usesTimeStepper_set,"Enable/disable use of TimeStepper in the simulation")
+		.def("load",&pyOmega::load,"Load simulation from file.")
+		.def("reload",&pyOmega::reload,"Reload current simulation")
+		.def("save",&pyOmega::save,"Save current simulation to file (should be .xml or .xml.bz2)")
+		.def("loadTmp",&pyOmega::loadTmp,omega_loadTmp_overloads(python::args("mark"),"Load simulation previously stored in memory by saveTmp.\n @param mark optionally distinguishes multiple saved simulations"))
+		.def("saveTmp",&pyOmega::saveTmp,omega_saveTmp_overloads(python::args("mark"),"Save simulation to memory (disappears at shutdown), can be loaded later with loadTmp.\n @param mark optionally distinguishes different memory-saved simulations."))
+		.def("tmpToFile",&pyOmega::tmpToFile,"Return XML of saveTmp'd simulation as string.")
+		.def("tmpToString",&pyOmega::tmpToString,"Save XML of saveTmp'd simulation in file.")
+		.def("saveSpheres",&pyOmega::saveSpheres,"Saves spherical bodies to external ASCII file, one sphere (x y z r) per line.")
+		.def("run",&pyOmega::run,omega_run_overloads("Run the simulation.\n@param nSteps how many steps to run, then stop.\n@param wait if True, doesn't return until the simulation will have stopped."))
+		.def("pause",&pyOmega::pause,"Stop simulation execution.\n(may be called from within the loop, and it will stop after the current step).")
+		.def("step",&pyOmega::step,"Advance the simulation by one step. Returns after the step will have finished.")
+		.def("wait",&pyOmega::wait,"Don't return until the simulation will have been paused. (Returns immediately if not running).")
+		.def("reset",&pyOmega::reset,"Reset simulation completely.")
+		.def("switchWorld",&pyOmega::switchWorld,"Switch to alternative simulation (while keeping the old one). Calling the function again switches back to the first one. Note that most variables from the first simulation will still refer to the first simulation even after the switch\n(e.g. b=O.bodies[4]; O.switchWorld(); [b still refers to the body in the first simulation here])")
+		.def("labeledEngine",&pyOmega::labeled_engine_get,"Return instance of engine/functor with the given label. This function shouldn't be called by the user directly; every ehange in O.engines will assign respective global python variables according to labels.\n For example: \n\tO.engines=[InsertionSortCollider(label='collider')]\n\tcollider['nBins']=5 ## collider has become a variable after assignment to O.engines automatically)")
+		.def("resetTime",&pyOmega::resetTime,"Reset simulation time: step number, virtual and real time. (Doesn't touch anything else, including timings).")
+		.def("plugins",&pyOmega::plugins_get,"Return list of all plugins registered in the class factory.")
+		.add_property("engines",&pyOmega::engines_get,&pyOmega::engines_set,"List of engines in the simulation (MetaBody::engines).")
+		.add_property("miscParams",&pyOmega::miscParams_get,&pyOmega::miscParams_set,"MiscParams in the simulation (MetaBody::mistParams), usually used to save serializables that don't fit anywhere else, like GL functors")
+		.add_property("initializers",&pyOmega::initializers_get,&pyOmega::initializers_set,"List of initializers (MetaBody::initializers).")
+		.add_property("bodies",&pyOmega::bodies_get,"Bodies in the current simulation (container supporting index access by id and iteration)")
+		.add_property("interactions",&pyOmega::interactions_get,"Interactions in the current simulation (container supporting index acces by either (id1,id2) or interactionNumber and iteration)")
+		.add_property("actions",&pyOmega::bex_get,"Deprecated alias for Omega().bex")
+		.add_property("bex",&pyOmega::bex_get,"BodyExternalVariables (forces, torques, ..) in  the current simulation.")
+		.add_property("tags",&pyOmega::tags_get,"Tags (string=string dictionary) of the current simulation (container supporting string-index access/assignment)")
+		.def("childClasses",&pyOmega::listChildClasses,"Return list of all classes deriving from given class, as registered in the class factory")
+		.def("isChildClassOf",&pyOmega::isChildClassOf,"Tells whether the first class derives from the second one (both given as strings).")
+		.add_property("bodyContainer",&pyOmega::bodyContainer_get,&pyOmega::bodyContainer_set,"Get/set type of body container (as string); there must be no bodies.")
+		.add_property("interactionContainer",&pyOmega::interactionContainer_get,&pyOmega::interactionContainer_set,"Get/set type of interaction container (as string); there must be no interactions.")
+		.add_property("timingEnabled",&pyOmega::timingEnabled_get,&pyOmega::timingEnabled_set,"Globally enable/disable timing services (see documentation of yade.timing).")
+		.add_property("bexSyncCount",&pyOmega::bexSyncCount_get,&pyOmega::bexSyncCount_set,"Counter for number of syncs in BexContainer, for profiling purposes.")
+		.add_property("numThreads",&pyOmega::numThreads_get /* ,&pyOmega::numThreads_set*/ ,"Get maximum number of threads openMP can use.")
 		;
 	python::class_<pyTags>("TagsWrapper",python::init<pyTags&>())
 		.def("__getitem__",&pyTags::getItem)
 		.def("__setitem__",&pyTags::setItem)
 		.def("keys",&pyTags::keys);
-	
 	python::class_<pyBodyContainer>("BodyContainer",python::init<pyBodyContainer&>())
 		.def("__getitem__",&pyBodyContainer::pyGetitem)
 		.def("__len__",&pyBodyContainer::length)