[Yade-dev] [Branch ~yade-pkg/yade/git-trunk] Rev 3714: Recover DomainLimiter (LawTester should be moved somewhere).
revno: 3714 committer: Anton Gladky gladky.an...@gmail.com timestamp: Tue 2013-10-15 07:01:48 +0200 message: Recover DomainLimiter (LawTester should be moved somewhere). added: pkg/dem/DomainLimiter.cpp pkg/dem/DomainLimiter.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 === added file 'pkg/dem/DomainLimiter.cpp' --- pkg/dem/DomainLimiter.cpp 1970-01-01 00:00:00 + +++ pkg/dem/DomainLimiter.cpp 2013-10-15 05:01:48 + @@ -0,0 +1,343 @@ +#includeyade/pkg/dem/DomainLimiter.hpp +#includeyade/pkg/dem/Shop.hpp + +YADE_PLUGIN((DomainLimiter)(LawTester) + #ifdef YADE_OPENGL + (GlExtra_LawTester)(GlExtra_OctreeCubes) + #endif +); + +void DomainLimiter::action(){ + std::listBody::id_t out; + FOREACH(const shared_ptrBody b, *scene-bodies){ + if((!b) or ((mask0) and ((b-groupMask mask)==0))) continue; + const Sphere* sphere = dynamic_castSphere*(b-shape.get()); + if (sphere){ //Delete only spheres + const Vector3r p(b-state-pos); + if(p[0]lo[0] || p[0]hi[0] || p[1]lo[1] || p[1]hi[1] || p[2]lo[2] || p[2]hi[2]) { +out.push_back(b-id); +nDeleted++; +mDeleted+=b-state-mass; +Real r = sphere-radius; vDeleted+=(4/3.)*Mathr::PI*pow(r,3); + } + } + } + FOREACH(Body::id_t id, out){ + scene-bodies-erase(id); + } +} + +#includeyade/pkg/dem/DemXDofGeom.hpp +#includeyade/pkg/dem/ScGeom.hpp +#includeyade/pkg/dem/L3Geom.hpp +#includeyade/pkg/common/NormShearPhys.hpp +#includeyade/lib/smoothing/LinearInterpolate.hpp +#includeyade/lib/pyutil/gil.hpp + +CREATE_LOGGER(LawTester); + +void LawTester::postLoad(LawTester){ + if(ids.size()==0) return; // uninitialized object, don't do nothing at all + if(ids.size()!=2) throw std::invalid_argument(LawTester.ids: exactly two values must be given.); + if(disPath.empty() rotPath.empty()) throw invalid_argument(LawTester.{disPath,rotPath}: at least one point must be given.); + if(pathSteps.empty()) throw invalid_argument(LawTester.pathSteps: at least one value must be given.); + size_t pathSize=max(disPath.size(),rotPath.size()); + // update path points + _path.clear(); _path.push_back(Vector6r::Zero()); + for(size_t i=0; ipathSize; i++) { + Vector6r pt; + pt.head3()=Vector3r(idisPath.size()?disPath[i]:(disPath.empty()?Vector3r::Zero():*(disPath.rbegin(; + pt.tail3()=Vector3r(irotPath.size()?rotPath[i]:(rotPath.empty()?Vector3r::Zero():*(rotPath.rbegin(; + _path.push_back(pt); + + } + // update time points from distances, repeat last distance if shorter than path + _pathT.clear(); _pathT.push_back(0); + for(size_t i=0; ipathSteps.size(); i++) _pathT.push_back(_pathT[i]+pathSteps[i]); + int lastDist=pathSteps[pathSteps.size()-1]; + for(size_t i=pathSteps.size(); ipathSize; i++) _pathT.push_back(*(_pathT.rbegin())+lastDist); +} + +void LawTester::action(){ + Vector2r foo; // avoid undefined ~Vector2r with clang? + if(ids.size()!=2) throw std::invalid_argument(LawTester.ids: exactly two values must be given.); + LOG_DEBUG(=== LawTester step step ); + const shared_ptrInteraction Inew=scene-interactions-find(ids[0],ids[1]); + string strIds(##+lexical_caststring(ids[0])+++lexical_caststring(ids[1])); + // interaction not found at initialization + if(!I (!Inew || !Inew-isReal())){ + LOG_WARN(Interaction strIds does not exist (yet?), no-op.); return; + //throw std::runtime_error(LawTester: interaction +strIds+ does not exist+(Inew? (to be honest, it does exist, but it is not real).:.)); + } + // interaction was deleted meanwhile + if(I (!Inew || !Inew-isReal())) throw std::runtime_error(LawTester: interaction +strIds+ was deleted+(Inew? (is not real anymore).:.)); + // different interaction object + if(I Inew I!=Inew) throw std::logic_error(LawTester: interacion +strIds+ is a different object now?!); + assert(Inew); + bool doInit=(!I); + if(doInit) I=Inew; + + id1=I-getId1(); id2=I-getId2(); + // test object types + GenericSpheresContact* gsc=dynamic_castGenericSpheresContact*(I-geom.get()); + ScGeom* scGeom=dynamic_castScGeom*(I-geom.get()); + L3Geom* l3Geom=dynamic_castL3Geom*(I-geom.get()); + L6Geom* l6Geom=dynamic_castL6Geom*(I-geom.get()); + ScGeom6D* scGeom6d=dynamic_castScGeom6D*(I-geom.get()); + bool hasRot=(l6Geom || scGeom6d); + //NormShearPhys* phys=dynamic_castNormShearPhys*(I-phys.get()); //Disabled because of warning + if(!gsc) throw std::invalid_argument(LawTester: IGeom of +strIds+ not a GenericSpheresContact.); + if(!scGeom !l3Geom) throw std::invalid_argument(LawTester: IGeom of +strIds+ is neither ScGeom, nor Dem3DofGeom, nor L3Geom (or L6Geom).); + assert(!((bool)scGeom (bool)l3Geom)); // nonsense + // get body objects + State *state1=Body::byId(id1,scene)-state.get(), *state2=Body::byId(id2,scene)-state.get(); +
Re: [Yade-dev] [Branch ~yade-pkg/yade/git-trunk] Rev 3713: Remove pkg/dem/DomainLimiter.*
Hi Anton, I don't know what DomainLimiter is (or was). In the same file however there is LawTester which is used in a script and is a very interesting piece of work (from Vaçlav). I think we should keep that one. Bruno On 14/10/13 23:48, nore...@launchpad.net wrote: revno: 3713 committer: Anton Gladky gladky.an...@gmail.com timestamp: Mon 2013-10-14 22:51:11 +0200 message: Remove pkg/dem/DomainLimiter.* It seems, the code is unmaintained and requires too much RAM for compilation. Feel free to recover it, if it is necessary. removed: pkg/dem/DomainLimiter.cpp pkg/dem/DomainLimiter.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 ___ 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 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
Re: [Yade-dev] [Branch ~yade-pkg/yade/git-trunk] Rev 3713: Remove pkg/dem/DomainLimiter.*
Hi guys the DomainLimiter is very useful as well. It removes particles which exit a defined region from the simulation. I am using it. What is the problem with it? Klaus On Tuesday 15 October 2013 12:37:18 Bruno Chareyre wrote: Hi Anton, I don't know what DomainLimiter is (or was). In the same file however there is LawTester which is used in a script and is a very interesting piece of work (from Vaçlav). I think we should keep that one. Bruno On 14/10/13 23:48, nore...@launchpad.net wrote: revno: 3713 committer: Anton Gladky gladky.an...@gmail.com timestamp: Mon 2013-10-14 22:51:11 +0200 message: Remove pkg/dem/DomainLimiter.* It seems, the code is unmaintained and requires too much RAM for compilation. Feel free to recover it, if it is necessary. removed: pkg/dem/DomainLimiter.cpp pkg/dem/DomainLimiter.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 ___ 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 Tél : +33 4 56 52 86 21 Fax : +33 4 76 82 70 43 -- Dr. Klaus Thoeni - Centre for Geotechnical and Materials Modelling Civil, Surveying and Environmental Engineering - Engineering Building EA The University of Newcastle, Callaghan, NSW 2308, Australia web: http://www.newcastle.edu.au/research-centre/cgmm phone: +61 (0)2 4921 5735 ___ 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-pkg/yade/git-trunk] Rev 3713: Remove pkg/dem/DomainLimiter.*
I returned that back already. Sorry, it was my mistake. I was thinking it is something about old-grid-engine, which was already removed long time ago. Anton 2013/10/15 Klaus Thoeni klaus.tho...@newcastle.edu.au: Hi guys the DomainLimiter is very useful as well. It removes particles which exit a defined region from the simulation. I am using it. What is the problem with it? Klaus On Tuesday 15 October 2013 12:37:18 Bruno Chareyre wrote: Hi Anton, I don't know what DomainLimiter is (or was). In the same file however there is LawTester which is used in a script and is a very interesting piece of work (from Vaçlav). I think we should keep that one. Bruno On 14/10/13 23:48, nore...@launchpad.net wrote: revno: 3713 committer: Anton Gladky gladky.an...@gmail.com timestamp: Mon 2013-10-14 22:51:11 +0200 message: Remove pkg/dem/DomainLimiter.* It seems, the code is unmaintained and requires too much RAM for compilation. Feel free to recover it, if it is necessary. removed: pkg/dem/DomainLimiter.cpp pkg/dem/DomainLimiter.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 ___ 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 Tél : +33 4 56 52 86 21 Fax : +33 4 76 82 70 43 -- Dr. Klaus Thoeni - Centre for Geotechnical and Materials Modelling Civil, Surveying and Environmental Engineering - Engineering Building EA The University of Newcastle, Callaghan, NSW 2308, Australia web: http://www.newcastle.edu.au/research-centre/cgmm phone: +61 (0)2 4921 5735 ___ 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-pkg/yade/git-trunk] Rev 3716: adding examples with tetrehadron modeled by new Polyhedron class
revno: 3716 committer: Jan Stransky jan.stran...@fsv.cvut.cz timestamp: Tue 2013-10-15 19:11:37 +0200 message: adding examples with tetrehadron modeled by new Polyhedron class added: examples/tetra/oneTetraPoly.py examples/tetra/twoTetrasPoly.py modified: examples/tetra/oneTetra.py py/utils.py -- 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/tetra/oneTetra.py' --- examples/tetra/oneTetra.py 2013-10-04 12:03:13 + +++ examples/tetra/oneTetra.py 2013-10-15 17:11:37 + @@ -8,7 +8,7 @@ v3 = (0,1,0) v4 = (0,0,1) -t1 = tetra((v1,v2,v3,v4),color=(0,1,0)) +t1 = tetraOld((v1,v2,v3,v4),color=(0,1,0)) O.bodies.append((t1)) def changeVelocity(): === added file 'examples/tetra/oneTetraPoly.py' --- examples/tetra/oneTetraPoly.py 1970-01-01 00:00:00 + +++ examples/tetra/oneTetraPoly.py 2013-10-15 17:11:37 + @@ -0,0 +1,43 @@ + +# +# Script to test tetra gl functions and prescribed motion +# + +v1 = (0,0,0) +v2 = (1,0,0) +v3 = (0,1,0) +v4 = (0,0,1) + +t1 = tetraPoly((v1,v2,v3,v4),color=(0,1,0)) +O.bodies.append((t1)) + +def changeVelocity(): + if O.iter == 5: + t1.state.vel = (-1,0,0) + if O.iter == 10: + t1.state.vel = (0,1,-1) + if O.iter == 15: + t1.state.vel = (0,0,0) + t1.state.angMom = (0,0,10) + if O.iter == 20: + O.pause() + +O.engines = [ + ForceResetter(), + InsertionSortCollider([Bo1_Polyhedra_Aabb()]), + InteractionLoop([],[],[]), + NewtonIntegrator(), + PyRunner(iterPeriod=1,command=changeVelocity()), +] +O.step() + + +try: + from yade import qt + qt.View() +except: + pass + +O.dt = 1e-5 +t1.state.vel = (1,0,0) +O.run() === added file 'examples/tetra/twoTetrasPoly.py' --- examples/tetra/twoTetrasPoly.py 1970-01-01 00:00:00 + +++ examples/tetra/twoTetrasPoly.py 2013-10-15 17:11:37 + @@ -0,0 +1,116 @@ + +# +# Python script to test tetra-tetra contact detection for different possible +# contact modes. Some tests are run twice to test the symmetry of the law. +# +# It runs several tests, making pause before each one. If run with GUI, you can +# adjust the viewer +# +# During the test, momentum, angular momentum and kinetic energy is tracked in +# plot.data. You can use plot.plot() to see the results (in sime modes the +# energy is not conserved for instace). +# + +from yade import qt,plot + +mat = PolyhedraMat() +mat.density = 2600 #kg/m^3 +mat.Ks = 200 +mat.Kn = 1E9 #Pa +mat.frictionAngle = 0.5 #rad +O.materials.append(mat) + +O.dt = 4e-5 +O.engines = [ + ForceResetter(), + InsertionSortCollider([Bo1_Polyhedra_Aabb()]), + InteractionLoop( + [Ig2_Polyhedra_Polyhedra_PolyhedraGeom()], + [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], + [PolyhedraVolumetricLaw()] + ), + NewtonIntegrator(damping=0), + PyRunner(iterPeriod=500,command=addPlotData()), + PyRunner(iterPeriod=1,command=runExamples()), +] + +def addPlotData(): + p = utils.momentum() + l = utils.angularMomentum() + plot.addData( + i = O.iter, + e = utils.kineticEnergy(), + px = p[0], + py = p[1], + pz = p[2], + lx = l[0], + ly = l[1], + lz = l[2], + ) + +def prepareExample(vertices1,vertices2,vel1=(0,0,0),vel2=(0,0,0),amom1=(0,0,0),amom2=(0,0,0),label=''): + O.interactions.clear() + O.bodies.clear() + t1 = tetraPoly(vertices1,color=(0,1,0),wire=False) + t2 = tetraPoly(vertices2,color=(0,1,1),wire=False) + O.bodies.append((t1,t2)) + t1.state.vel = vel1 + t2.state.vel = vel2 + t1.state.angMom = amom1 + t2.state.angMom = amom2 + if label: print label + O.pause() + O.step() + +def runExamples(): + dt = 2 + if O.iter == 1: + vertices1 = ((0,0,0),(2,0,0),(0,2,0),(0,0,2)) + vertices2 = ((1,1,1),(3,1,1),(1,3,1),(1,1,3)) + prepareExample(vertices1,vertices2,vel2=(-1,-1,-1),label='\ntesting vertex-triangle contact...\n') + if O.iter == 1*dt: + plot.data = {} + vertices1 = ((1,1,1),(3,1,1),(1,3,1),(1,1,3)) + vertices2 = ((0,0,0),(2,0,0),(0,2,0),(0,0,2)) + prepareExample(vertices1,vertices2,vel1=(-1,-1,-1),label='\ntesting vertex-triangle contact 2...\n') + elif O.iter == 2*dt: + vertices1 = ((0,0,0),(0,0,1.1),(1,0,1),(0,1,.9)) + vertices2 = ((0,.5,1.4),(-.5,.5,.6),(-1.6,0,1),(-1.6,1.1,1)) + prepareExample(vertices1,vertices2,vel2=(1,0,0),amom2=(0,10,0),label='\ntesting edge-edge contact\n') + elif O.iter == 3*dt: + vertices1 = ((0,0,0),(0,0,1.1),(1,0,1),(0,1,.9)) + vertices2 = ((-.5,.5,.6),(0,.5,1.4),(-1.6,1.1,1),(-1.6,0,1)) +
[Yade-dev] [Bug 1240252] Re: code builds but doesn't run
This is a clean build btw. All I did was create a fresh fork, clone, build, and run. -- You received this bug notification because you are a member of Yade developers, which is subscribed to Yade. https://bugs.launchpad.net/bugs/1240252 Title: code builds but doesn't run Status in Yet Another Dynamic Engine: New Bug description: Hi, I am building the most recent version of the code on github, and I am running into an error. The project builds without complaint but when I run Yade I get the following error in the terminal window. Welcome to Yade 2013-10-14.git-5a24a75 Traceback (most recent call last): File /usr/local/bin/yade-2013-10-14.git-5a24a75, line 121, in module import yade File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/__init__.py, line 91, in module import _extraDocs File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/_extraDocs.py, line 215, in module ''' AttributeError: 'module' object has no attribute 'LawTester' I noticed Anton made a commit yesterday titled: Recover DomainLimiter (LawTester should be moved somewhere). I'm guessing this error has something to do with this commit. Could someone please fix this error? Thanks! To manage notifications about this bug go to: https://bugs.launchpad.net/yade/+bug/1240252/+subscriptions ___ 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 1240252] [NEW] code builds but doesn't run
Public bug reported: Hi, I am building the most recent version of the code on github, and I am running into an error. The project builds without complaint but when I run Yade I get the following error in the terminal window. Welcome to Yade 2013-10-14.git-5a24a75 Traceback (most recent call last): File /usr/local/bin/yade-2013-10-14.git-5a24a75, line 121, in module import yade File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/__init__.py, line 91, in module import _extraDocs File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/_extraDocs.py, line 215, in module ''' AttributeError: 'module' object has no attribute 'LawTester' I noticed Anton made a commit yesterday titled: Recover DomainLimiter (LawTester should be moved somewhere). I'm guessing this error has something to do with this commit. Could someone please fix this error? Thanks! ** Affects: yade Importance: Undecided Assignee: Anton Gladky (gladky-anton) Status: New ** Changed in: yade Assignee: (unassigned) = Anton Gladky (gladky-anton) -- You received this bug notification because you are a member of Yade developers, which is subscribed to Yade. https://bugs.launchpad.net/bugs/1240252 Title: code builds but doesn't run Status in Yet Another Dynamic Engine: New Bug description: Hi, I am building the most recent version of the code on github, and I am running into an error. The project builds without complaint but when I run Yade I get the following error in the terminal window. Welcome to Yade 2013-10-14.git-5a24a75 Traceback (most recent call last): File /usr/local/bin/yade-2013-10-14.git-5a24a75, line 121, in module import yade File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/__init__.py, line 91, in module import _extraDocs File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/_extraDocs.py, line 215, in module ''' AttributeError: 'module' object has no attribute 'LawTester' I noticed Anton made a commit yesterday titled: Recover DomainLimiter (LawTester should be moved somewhere). I'm guessing this error has something to do with this commit. Could someone please fix this error? Thanks! To manage notifications about this bug go to: https://bugs.launchpad.net/yade/+bug/1240252/+subscriptions ___ 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 1240252] Re: code builds but doesn't run
You should update your code. ** Changed in: yade Assignee: Anton Gladky (gladky-anton) = (unassigned) ** Changed in: yade Status: New = Invalid -- You received this bug notification because you are a member of Yade developers, which is subscribed to Yade. https://bugs.launchpad.net/bugs/1240252 Title: code builds but doesn't run Status in Yet Another Dynamic Engine: Invalid Bug description: Hi, I am building the most recent version of the code on github, and I am running into an error. The project builds without complaint but when I run Yade I get the following error in the terminal window. Welcome to Yade 2013-10-14.git-5a24a75 Traceback (most recent call last): File /usr/local/bin/yade-2013-10-14.git-5a24a75, line 121, in module import yade File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/__init__.py, line 91, in module import _extraDocs File /usr/local/lib/i386-linux-gnu/yade-2013-10-14.git-5a24a75/py/yade/_extraDocs.py, line 215, in module ''' AttributeError: 'module' object has no attribute 'LawTester' I noticed Anton made a commit yesterday titled: Recover DomainLimiter (LawTester should be moved somewhere). I'm guessing this error has something to do with this commit. Could someone please fix this error? Thanks! To manage notifications about this bug go to: https://bugs.launchpad.net/yade/+bug/1240252/+subscriptions ___ 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