Re: [Yade-dev] Constitutive laws
Hi Jérôme, nice idea. However, not sure if this is the way to go. I don't think we need a new attribute. Why not just adding a little table in each LawFunctor description in the doc? We can still grep for the table and build up the current wiki table. BTW, if we don't find a solution here we can discuss and implement it at the workshop. I can put it on the list ;-) Cheers Klaus On Mon, May 26, 2014 at 10:27 PM, Jérôme Duriez jerome.dur...@3sr-grenoble.fr wrote: So, I have a proposal, introducing two new attributes : One would be LawFunctor.status in ... LawFunctor. Here is a possible c++ implementation in LawFunctor.hpp ((bool, status,0,,boolean expressing the status of the considered LawFunctor. The use is safe if status=True (law validated, support might come from mailing list..), whereas for status=False, no warranty exists that the law is validated and/or maintained/used by anyone else. A warning, see InteractionLoop.Law2warning, is displayed in this case.)) The idea is to put in InteractionLoop something like (please apologize possible syntax mistakes) : if (LawFunctor-status==False) cout/cerr You're using a non validated constitutive law ! Please consider using another LawFunctor with status = True (e.g. Law2_ScGeom_FrictPhys_CundallStrack), unless you are 100% autonom; This warning would display at each iteration, so that users necessarily see it. To not bother 100% autonom people, here comes the second attribute : InteractionLoop.Law2warning ! Wich has such a c++ implementation, in InteractionLoop.hpp, for example : ((bool,Law2warning,1,,Autonom people that use constitutive laws with status=0 may set this attribute to False to get rid of related warnings.)) In this framework : - For what concerns the devs, we get rid of the wiki page. Devs would only have to take care of defining correctly the value of their status, rather than painting in green or red in the wiki page. All other informations such as description, publications, example scripts, should be already in the sphinx doc (If not, such infos would probably be neither on the wiki). There would be no risk of deprecation of the wiki page compared to c++ code. If new laws are commited, it is easy to check which status value is defined in the commit. - For users, the warning of https://www.yade-dem.org/doc/user.html#law2-functor-s would be rephrased, to put attention of users on LawFunctor.status, rather than pointing towards the wiki page. Users that did not read nor this warning, nor the doc of their Law and pick unfortunately a red Law2 would be bored by the warning, and quickly would use e.g. Law2_ScGeom_FrictPhys_CundallStrack, before asking useless questions. Among the drawbacks, I confess that there is no synthetic presentation with such design, compared with the coloured table of the wiki. But maybe this could be generated automaticcaly, grepping for status,1 in the code ? And I consider in any case, that an up-to-date not so synthetic information is better that a deprecated synthetic one... Tell me what you think ! Jérôme Le 26/05/2014 11:06, Bruno Chareyre a écrit : 2/ is very unlikely to happen. More realistic is to translate the table in *.rst. I was secretely hopping that you would be volunteer for that. :) Besides, I'm open to suggestions on how to improve. B On 26/05/14 10:19, Jérôme Duriez wrote: Hi, Many thanks to the guy who in fact updated Law2_ScGeom6D_NormalInelasticityPhys_NormalInelasticity for me ! I had only to add the name of the example script... So, I edited my one (or even two) lines in the wiki page. I do not know how much you were serious about your 2/ proposition, Bruno (this could be a project for a computer science student ?), but let us hope that this day will come. Otherwise I have no doubt that the destiny of this page is to be most of the time deprecated. We just had another example with Law2_ScGeom_ViscElPhys_Basic, with guys that are nevertheless quite involved in Yade... (there is an euphemism there) Jérôme Le 23/05/2014 13:21, Bruno Chareyre a écrit : Hi Jerome, Thank you for suggestions. First, I'm glad you recognize that the functors table is less puzzling than the inheritance diagram (or let's say, they have different purpose). I saw many situations where users would come with a very specific question, then we realize that they picked a wrong contact law (bugged and/or unmaintained, L3 to name one). Frustrating for users, wasted time for everyone. It was the reason to write this table. Another possible solution would be to reduce the total number of functors. For instance eliminate from the source code every law which results at least partly from code duplication, and/or has no example script, and/or is not documented, and/or has no known maintainer. Now, your message is twofold: 1/ where this content should be, and 2/ what this content should be. 1/ If someone could
[Yade-dev] [Branch ~yade-pkg/yade/git-trunk] Rev 3987: missing declaration of function
revno: 3987 committer: Bruno Chareyre bruno.chare...@hmg.inpg.fr timestamp: Tue 2014-05-27 12:20:39 +0200 message: missing declaration of function modified: pkg/pfv/DFNFlow.cpp -- 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 'pkg/pfv/DFNFlow.cpp' --- pkg/pfv/DFNFlow.cpp 2014-05-26 23:23:29 + +++ pkg/pfv/DFNFlow.cpp 2014-05-27 10:20:39 + @@ -38,6 +38,7 @@ void trickPermeability(); void trickPermeability (RTriangulation::Facet_circulator facet,Real somethingBig); void trickPermeability (RTriangulation::Finite_edges_iterator edge,Real somethingBig); + void setPositionsBuffer(bool current); YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(DFNFlowEngine,DFNFlowEngineT,documentation here, ((Real, myNewAttribute, 0,,useless example)) ___ 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 3986: make FlowEngine::setPositionsBuffer virtual
revno: 3986 committer: Bruno Chareyre bruno.chare...@hmg.inpg.fr timestamp: Tue 2014-05-27 09:50:01 +0200 message: make FlowEngine::setPositionsBuffer virtual modified: pkg/pfv/FlowEngine.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 'pkg/pfv/FlowEngine.hpp' --- pkg/pfv/FlowEngine.hpp 2014-05-26 23:23:29 + +++ pkg/pfv/FlowEngine.hpp 2014-05-27 07:50:01 + @@ -88,7 +88,7 @@ vectorposData positionBufferCurrent;//reflect last known positions before we start computations vectorposData positionBufferParallel;//keep the positions from a given step for multithread factorization //copy positions in a buffer for faster and/or parallel access - void setPositionsBuffer(bool current); + virtual void setPositionsBuffer(bool current); virtual void trickPermeability() {}; public : ___ 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 3988: fix default attribute in DFNFlow
revno: 3988 committer: Bruno Chareyre bruno.chare...@hmg.inpg.fr timestamp: Tue 2014-05-27 12:33:52 +0200 message: fix default attribute in DFNFlow modified: pkg/pfv/DFNFlow.cpp -- 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 'pkg/pfv/DFNFlow.cpp' --- pkg/pfv/DFNFlow.cpp 2014-05-27 10:20:39 + +++ pkg/pfv/DFNFlow.cpp 2014-05-27 10:33:52 + @@ -42,7 +42,7 @@ YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(DFNFlowEngine,DFNFlowEngineT,documentation here, ((Real, myNewAttribute, 0,,useless example)) - ((bool, updatePositions, False,,update particles positions when rebuilding the mesh (experimental))) + ((bool, updatePositions, false,,update particles positions when rebuilding the mesh (experimental))) ,/*DFNFlowEngineT()*/, , ) ___ 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 3989: Add particleconserve parameter to LiqControl.
revno: 3989 committer: Anton Gladky gladky.an...@gmail.com timestamp: Tue 2014-05-27 13:24:16 +0200 message: Add particleconserve parameter to LiqControl. modified: pkg/dem/ViscoelasticCapillarPM.cpp pkg/dem/ViscoelasticCapillarPM.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 'pkg/dem/ViscoelasticCapillarPM.cpp' --- pkg/dem/ViscoelasticCapillarPM.cpp 2014-05-08 05:57:04 + +++ pkg/dem/ViscoelasticCapillarPM.cpp 2014-05-27 11:24:16 + @@ -118,8 +118,12 @@ NLiqBridg -= 1; } #ifdef YADE_LIQMIGRATION -const intReal B1={id1, phys.Vb/2.0}; -const intReal B2={id2, phys.Vb/2.0}; +if (phys.Vb 0.0 and ((phys.Vf1+phys.Vf2) == 0.0)) { + phys.Vf1 = phys.Vb/2.0; + phys.Vf2 = phys.Vb/2.0; +} +const intReal B1={id1, phys.Vf1}; +const intReal B2={id2, phys.Vf2}; scene-delIntrs.push_back(B1); scene-delIntrs.push_back(B2); #endif @@ -411,6 +415,13 @@ addBodyMapReal(bodyUpdateLiquid, id2, -Vf2); Vb-Vb = Vrup; +if (particleconserve) { + Vb-Vf1 = Vf1; + Vb-Vf2 = Vf2; +} else { + Vb-Vf1 = Vrup/2.0; + Vb-Vf2 = Vrup/2.0; +} } scene-addIntrs.clear(); @@ -462,8 +473,19 @@ if(!((*it).second) or !(((*it).second)-isReal())) continue; ViscElCapPhys* physT=dynamic_castViscElCapPhys*(((*it).second)-phys.get()); if (physT-VbphysT-Vmax) { - liqVolShr += (physT-Vmax - physT-Vb)*FillLevel; - physT-Vb += (physT-Vmax - physT-Vb)*FillLevel; + const Real addVolLiq = (physT-Vmax - physT-Vb)*FillLevel; + liqVolShr += addVolLiq; + physT-Vb += addVolLiq; + if (particleconserve) { +if (((*it).second)-getId1() == (*it).first) { + physT-Vf1+=addVolLiq; +} else if (((*it).second)-getId2() == (*it).first) { + physT-Vf2+=addVolLiq; +} + } else { +physT-Vf1+=addVolLiq/2.0; +physT-Vf2+=addVolLiq/2.0; + } } } return; === modified file 'pkg/dem/ViscoelasticCapillarPM.hpp' --- pkg/dem/ViscoelasticCapillarPM.hpp 2014-05-23 13:20:43 + +++ pkg/dem/ViscoelasticCapillarPM.hpp 2014-05-27 11:24:16 + @@ -35,6 +35,8 @@ ((CapType,CapillarType,None_Capillar,,Different types of capillar interaction: Willett_numeric, Willett_analytic, Weigert, Rabinovich, Lambert, Soulie)) #ifdef YADE_LIQMIGRATION ((Real,Vmax,0.0,,Maximal liquid bridge volume [m^3])) + ((Real,Vf1,0.0,, Liquid which will be returned to the 1st body after rupture [m^3])) + ((Real,Vf2,0.0,, Liquid which will be returned to the 2nd body after rupture [m^3])) #endif , createIndex(); @@ -95,6 +97,7 @@ ((Real,liqVolRup,0.,, Liquid volume (integral value), which has been freed after rupture occured, [m^3].)) ((Real,liqVolShr,0.,, Liquid volume (integral value), which has been shared among of contacts, [m^3].)) ((Real,vMaxCoef,0.03,, Coefficient for vMax, [-].)) + ((bool,particleconserve,false,, If True, the particle will have the same liquid volume during simulation e.g. liquid will not migrate [false].)) ,/* ctor */ ,/* py */ .def(totalLiq,LiqControl::totalLiqVol,(boost::python::arg(mask)=0),Return total volume of water in simulation.) ___ 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 3991: Prevent first empty item in features.
revno: 3991 committer: Anton Gladky gladky.an...@gmail.com timestamp: Tue 2014-05-27 13:24:16 +0200 message: Prevent first empty item in features. modified: core/main/main.py.in core/main/yade-batch.in py/config.py.in -- 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 'core/main/main.py.in' --- core/main/main.py.in 2014-05-27 11:24:16 + +++ core/main/main.py.in 2014-05-27 11:24:16 + @@ -20,6 +20,8 @@ # duplicate some items from yade.config here, so that we can increase verbosity when the c++ part is booting features,version,debugbuild='${CONFIGURED_FEATS}'.split(' '),'${realVersion}',' ${debugbuild}' +if (features[0]==''): features=features[1:] + libPATH='${LIBRARY_OUTPUT_PATH}' if (libPATH[1:] == '{LIBRARY_OUTPUT_PATH}'): libPATH='lib' === modified file 'core/main/yade-batch.in' --- core/main/yade-batch.in 2014-05-27 11:24:16 + +++ core/main/yade-batch.in 2014-05-27 11:24:16 + @@ -345,6 +345,7 @@ numCores=getNumCores() maxOmpThreads=numCores if 'OpenMP' in yade.config.features else 1 features,version='${CONFIGURED_FEATS}'.split(','),'${realVersion}' +if (features[0]==''): features=features[1:] prog = os.path.basename(sys.argv[0]) parser=argparse.ArgumentParser(usage='%s [options] [ TABLE [SIMULATION.py] | SIMULATION.py[/nCores] [...] ]'%prog,description='%s runs yade simulation multiple times with different parameters.\n\nSee https://yade-dem.org/sphinx/user.html#batch-queuing-and-execution-yade-batch for details.\n\nBatch can be specified either with parameter table TABLE (must not end in .py), which is either followed by exactly one SIMULATION.py (must end in .py), or contains !SCRIPT column specifying the simulation to be run. The second option is to specify multiple scripts, which can optionally have /nCores suffix to specify number of cores for that particular simulation (corresponds to !THREADS column in the parameter table), e.g. sim.py/3.'%prog) === modified file 'py/config.py.in' --- py/config.py.in 2014-05-27 11:24:16 + +++ py/config.py.in 2014-05-27 11:24:16 + @@ -14,7 +14,10 @@ libDir=os.path.abspath(prefix+'/'+libPATH+'/yade${SUFFIX}') confDir=os.environ['HOME']+'/.yade${SUFFIX}' libstdcxx='${libstdcxx}' + features='${CONFIGURED_FEATS}'.split(' ') +if (features[0]==''): features=features[1:] + revision='${realVersion}' version='${version}' sourceRoot='${sourceRoot}' ___ 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 3992: Add checkLiquidMigration autotest.
revno: 3992 committer: Anton Gladky gladky.an...@gmail.com timestamp: Tue 2014-05-27 13:24:16 +0200 message: Add checkLiquidMigration autotest. added: scripts/checks-and-tests/checks/checkLiquidMigration.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 === added file 'scripts/checks-and-tests/checks/checkLiquidMigration.py' --- scripts/checks-and-tests/checks/checkLiquidMigration.py 1970-01-01 00:00:00 + +++ scripts/checks-and-tests/checks/checkLiquidMigration.py 2014-05-27 11:24:16 + @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# The model checks liquid migration model if it is enabled during compilation +from yade import utils, plot + +if ('LIQMIGRATION' in features): + o = Omega() + fr = 0.5;rho=2000 + tc = 0.001; en = 0.7; et = 0.7; + o.dt = 1.0 + + + r1 = 1.0 + r2 = 1.0 + Gamma = 20.6*1e-3 + Theta = 0 + VB = 74.2*1e-12 + + tolerance = 1e-6 + + + CapillarType = Lambert + + mat1 = O.materials.append(ViscElCapMat(frictionAngle=fr,density=rho,Vb=VB,gamma=Gamma,theta=Theta,Capillar=True,CapillarType=CapillarType,tc=tc,en=en,et=et)) + + d = 1.1 + id0 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True, color=[1,0,0])) + + id1 = O.bodies.append(sphere(center=[0,0,(r1+r2)*d],radius=r2,material=mat1,fixed=True, color=[0,1,0])) + id2 = O.bodies.append(sphere(center=[0,0,-(r1+r2)*d],radius=r2,material=mat1,fixed=True, color=[0,1,0])) + + + O.bodies[id0].Vf = 0.3e-1 + O.bodies[id0].Vmin = 0.1e-1 + + O.bodies[id1].Vf = 0.4e-1 + O.bodies[id1].Vmin = 0.1e-1 + + O.bodies[id2].Vf = 0.5e-1 + O.bodies[id2].Vmin = 0.1e-1 + + vel = -0.15 + O.bodies[id1].state.vel=[0,0,vel] + O.bodies[id2].state.vel=[0,0,-vel] + + o.engines = [ +ForceResetter(), +InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=(r1+r2)*5.0), +InteractionLoop( + [Ig2_Sphere_Sphere_ScGeom()], + [Ip2_ViscElCapMat_ViscElCapMat_ViscElCapPhys()], + [Law2_ScGeom_ViscElCapPhys_Basic()], +), +LiqControl(particleconserve=True,label='liqcontrol'), +NewtonIntegrator(damping=0,gravity=[0,0,0]), +PyRunner(command='showData()',iterPeriod=1,dead=True), + ] + + def showData(): +print Step %d%O.iter +print idB=%d, Vf=%s, Vmin=%s;%(id0, O.bodies[id0].Vf, O.bodies[id0].Vmin) +print idB=%d, Vf=%s, Vmin=%s;%(id1, O.bodies[id1].Vf, O.bodies[id1].Vmin) +print idB=%d, Vf=%s, Vmin=%s;%(id2, O.bodies[id2].Vf, O.bodies[id2].Vmin) +try: + print Interaction[%d, %d].Vb=%s%(id0, id1, O.interactions[id0,id1].phys.Vb) +except: + pass + +try: + print Interaction[%d, %d].Vb=%s%(id0, id2, O.interactions[id0,id2].phys.Vb) +except: + pass +print + + def switchVel(): +O.bodies[id1].state.vel=-O.bodies[id1].state.vel +O.bodies[id2].state.vel=-O.bodies[id2].state.vel + + resultStatus = 0 + O.run(3, True) + if ((abs((O.interactions[id0,id1].phys.Vb - 0.03)/0.03) tolerance) or + (abs((O.interactions[id0,id1].phys.Vb - 0.03)/0.03) tolerance)): +resultStatus += 1 + + switchVel() + O.run(5, True) + if ((abs((O.bodies[id0].Vf - 0.03)/0.03) tolerance) or + (abs((O.bodies[id1].Vf - 0.04)/0.04) tolerance) or + (abs((O.bodies[id2].Vf - 0.05)/0.05) tolerance)): +resultStatus += 1 + + liqcontrol.particleconserve=False + switchVel() + O.run(5, True) + switchVel() + O.run(5, True) + if ((abs((O.bodies[id0].Vf - 0.0465)/0.0465) tolerance) or + (abs((O.bodies[id1].Vf - 0.0325)/0.0325) tolerance) or + (abs((O.bodies[id2].Vf - 0.041)/0.041) tolerance)): +resultStatus += 1 +else: + print This checkLiquidMigration.py cannot be executed because LIQMIGRATION is disables + ___ 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 3982: Revert removal of embedded floating_point_utilities_v3.
Tanks Anton, We can maybe keep ref of this commit in a wishlist bug, to apply it again in the future? Bruno On 26/05/14 11:13, nore...@launchpad.net wrote: revno: 3982 committer: Anton Gladky gladky.an...@gmail.com timestamp: Mon 2014-05-26 10:10:59 +0200 message: Revert removal of embedded floating_point_utilities_v3. http://www.mail-archive.com/yade-dev@lists.launchpad.net/msg10200.html added: extra/ extra/floating_point_utilities_v3/ extra/floating_point_utilities_v3/README extra/floating_point_utilities_v3/boost/ extra/floating_point_utilities_v3/boost/math/ extra/floating_point_utilities_v3/boost/math/detail/ extra/floating_point_utilities_v3/boost/math/detail/fp_traits.hpp extra/floating_point_utilities_v3/boost/math/fpclassify.hpp extra/floating_point_utilities_v3/boost/math/nonfinite_num_facets.hpp extra/floating_point_utilities_v3/boost/math/signbit.hpp modified: CMakeLists.txt -- 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