Question #378395 on Yade changed:
https://answers.launchpad.net/yade/+question/378395

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,
I just tried your script and it worked as expected, the sleeper stopped
after contact with ballast and also a force jump was recorded.. what
version of Yade do you use? I now used 2016-04-21 (not the newest one..)
cheers
Jan


2016-09-02 0:47 GMT+02:00 Weimin Song <question378...@answers.launchpad.net>
:

> New question #378395 on Yade:
> https://answers.launchpad.net/yade/+question/378395
>
> Dear all,
>
>           I am running a similar simulation to [1], which is about the
> sleeper on ballast layer.  I have two questions:
>
>           (a) As said in [1], box can be used to model the sleeper,
> allowing the behavior as a dynamic body (dynamic=True,fixed=False). I put
> the sleeper above the ballast and gave sleeper velocity and set one max
> load, however, after the contact between sleeper and ballast, the sleeper
> does not move and there is no increase of the load (fz).  How should I
> modify the code?
>
>           (b) Besides the box,  what can be used to model the sleeper
> better?
>
>
> #####compress.txt
> #format x_y_z_r
> 0.947086        0.831475        0.284021        0.0477039
> 0.450034        0.952387        0.120053        0.0476128
> 0.646373        0.618515        0.0409984       0.0409984
> 0.498326        0.563153        0.074989        0.0478509
> 0.323288        0.495           0.164916        0.0477942
> 0.93579         0.147124        0.398074        0.053411
> 0.83032         0.575083        0.0367456       0.0367457
> 0.480093        0.45683         0.225252        0.0421577
> 0.449375        0.903246        0.397459        0.0513119
> 0.138988        0.198482        0.168299        0.058746
> 0.306789        0.318781        0.0649523       0.0649523
> 0.693017        0.157485        0.0644752       0.0644753
> 0.649656        0.87162         0.265032        0.0480424
> 0.749124        0.225969        0.141352        0.0408891
> 0.68096         0.221957        0.311608        0.0474974
> 0.176216        0.386136        0.331596        0.0354314
> 0.468504        0.653722        0.121246        0.0502423
> 0.312465        0.191316        0.062637        0.0626371
> 0.346562        0.821341        0.0981689       0.0522149
> 0.951508        0.90208         0.148318        0.0449059
> 0.617955        0.602218        0.228009        0.0496856
> 0.160421        0.0357093       0.273775        0.0350106
> 0.39686         0.145847        0.303583        0.0423115
> 0.054697        0.860839        0.352874        0.0443734
> 0.340806        0.456822        0.359142        0.0620779
> 0.884794        0.286295        0.227674        0.0523843
> 0.129303        0.12767         0.241812        0.0420248
> 0.929743        0.446237        0.391947        0.0619074
> 0.581925        0.632365        0.326891        0.0414924
> 0.690471        0.755576        0.152238        0.047335
> 0.895328        0.187066        0.163544        0.064954
> 0.794705        0.499789        0.0364907       0.0364908
> 0.0619091       0.871396        0.0938363       0.058947
> 0.372246        0.364942        0.420368        0.0350741
> 0.894859        0.950734        0.366489        0.0467399
> 0.74198         0.889548        0.0377409       0.0377409
> 0.174689        0.405193        0.247011        0.0508009
> 0.188015        0.96039         0.146972        0.0396097
> 0.787366        0.939611        0.389144        0.0603188
> 0.347655        0.122137        0.394573        0.0580475
> 0.158852        0.203066        0.343461        0.0357254
> 0.123726        0.814216        0.179682        0.0482266
> 0.658175        0.696686        0.226838        0.0406917
> 0.765749        0.358235        0.148825        0.0404131
> 0.939201        0.466295        0.259859        0.0607987
> 0.957038        0.0424501       0.263338        0.0421011
> 0.150003        0.786254        0.388105        0.0557299
> 0.784285        0.251494        0.288619        0.0618017
> 0.416394        0.553035        0.1484          0.0626229
> 0.963509        0.611442        0.405887        0.0356438
> 0.324006        0.644522        0.394429        0.0510247
> 0.514523        0.723883        0.154689        0.0396758
> 0.792249        0.300144        0.201533        0.0375461
> 0.552467        0.861477        0.265064        0.0486583
> 0.617693        0.304028        0.314302        0.055041
> 0.671466        0.430064        0.189515        0.0558252
> 0.128094        0.703944        0.14021         0.0535805
> 0.342876        0.661106        0.144546        0.0380088
> 0.222793        0.462785        0.32049         0.0526685
> 0.494929        0.743023        0.0593009       0.0591999
> 0.595232        0.220057        0.0471151       0.0471151
> 0.947578        0.569841        0.168569        0.0469065
> 0.706965        0.597767        0.0888265       0.038932
> 0.713107        0.520495        0.0479858       0.0478411
> 0.234168        0.179433        0.302829        0.0413953
> 0.628693        0.262827        0.405714        0.0453377
> 0.86118         0.94027         0.0938651       0.0597297
> 0.240001        0.369939        0.134953        0.0444732
> 0.507675        0.245124        0.402008        0.0499993
> 0.592381        0.792342        0.111559        0.0436291
> 0.720738        0.587355        0.40626         0.0467056
> 0.397405        0.356544        0.0362316       0.0362316
> 0.420696        0.440849        0.0391549       0.0387864
> 0.060001        0.475249        0.237288        0.0599622
> 0.387668        0.124852        0.131674        0.0591788
> 0.520346        0.645345        0.0429898       0.0429898
> 0.520985        0.279778        0.312372        0.0446535
> 0.850381        0.414746        0.121207        0.0632809
> 0.774088        0.794743        0.0401247       0.0401247
> 0.738511        0.415946        0.31357 0.0617332
> 0.613828        0.793937        0.386986        0.0474196
> 0.189925        0.278124        0.277268        0.0644271
> 0.956033        0.962939        0.0935952       0.0370609
> 0.63864 0.157277        0.390086        0.0617935
> 0.074175        0.0467785       0.119684        0.0467785
> 0.489163        0.341346        0.40541 0.0462878
> 0.273976        0.50839 0.258966        0.0393711
> 0.103184        0.194786        0.404293        0.04597
> 0.285857        0.122722        0.136712        0.0417676
> 0.421312        0.811347        0.0418853       0.0418845
> 0.947906        0.731198        0.0518385       0.0516906
> 0.609461        0.394694        0.265059        0.0479474
> 0.841594        0.0486871       0.0583808       0.0486367
> 0.55703 0.126528        0.0510891       0.0504705
> 0.720166        0.733215        0.0395534       0.0375486
> 0.881003        0.504472        0.177329        0.0467903
> 0.83964 0.736185        0.392031        0.06062
> 0.822886        0.383668        0.235762        0.0549484
> 0.644354        0.535413        0.140565        0.0634611
> 0.0440037       0.956004        0.374548        0.0439868
> 0.142893        0.549818        0.0413219       0.0413219
> 0.766512        0.848358        0.0954289       0.0372682
> 0.15626 0.938958        0.0576143       0.0576143
> 0.682074        0.280082        0.0748855       0.058967
> 0.0487276       0.76617 0.376968        0.0470041
> 0.31279 0.170846        0.22424 0.0615935
> 0.261667        0.241248        0.346454        0.0379404
> 0.79808 0.333123        0.356939        0.0423478
> 0.26498 0.957781        0.173938        0.0419727
> 0.428987        0.770664        0.158345        0.0570391
> 0.109658        0.138081        0.324441        0.0421696
> 0.786733        0.155263        0.214251        0.0590249
> 0.124806        0.933025        0.212093        0.0551796
> 0.615401        0.921349        0.0457292       0.0457292
> 0.468293        0.935445        0.0380704       0.0380704
> 0.570912        0.70891 0.403116        0.0437944
> 0.433619        0.357361        0.173867        0.0562092
> 0.718661        0.65635 0.162817        0.0561648
> 0.666206        0.577882        0.316966        0.0541216
> 0.639935        0.643667        0.401098        0.0509298
> 0.739836        0.435393        0.0938615       0.0523595
> 0.709831        0.222572        0.21998 0.0432682
> 0.698288        0.945738        0.316163        0.0540886
> 0.487658        0.0569604       0.292981        0.0569561
> 0.816943        0.427709        0.399159        0.0525088
> 0.175262        0.705209        0.230481        0.0463205
> 0.273731        0.69764 0.317912        0.0544715
> 0.262037        0.350036        0.22476 0.0501155
> 0.824755        0.598848        0.156381        0.0645543
> 0.803654        0.540482        0.412004        0.045843
> 0.335023        0.577155        0.231942        0.0564453
> 0.935437        0.113196        0.0645519       0.0645519
> 0.493969        0.769779        0.38787 0.0550718
> 0.621934        0.695705        0.0984392       0.0582739
> 0.951959        0.642884        0.322787        0.047986
> 0.511392        0.275657        0.102785        0.0559607
> 0.504269        0.434819        0.0431251       0.0429722
> 0.581617        0.190581        0.291121        0.056271
> 0.75542 0.801927        0.236474        0.0355605
> 0.774215        0.491005        0.206962        0.064823
> 0.376667        0.554093        0.399621        0.0378678
> 0.248965        0.199349        0.139655        0.0374874
> 0.376264        0.390139        0.10343 0.0391088
> 0.354201        0.845411        0.398167        0.0513852
> 0.617438        0.254841        0.176361        0.0637425
> 0.123294        0.203773        0.262114        0.036519
> 0.938509        0.667157        0.216998        0.0611932
> 0.867437        0.511378        0.0359309       0.0359309
> 0.354525        0.405246        0.248278        0.0594617
> 0.679218        0.733356        0.408977        0.0429424
> 0.957806        0.89586 0.342881        0.039601
> 0.214137        0.1367  0.169846        0.0384377
> 0.530244        0.477588        0.139626        0.0591298
> 0.778987        0.628953        0.347985        0.0455466
> 0.536068        0.633774        0.419668        0.0359356
> 0.38568 0.0505655       0.323714        0.0494938
> 0.797126        0.850772        0.30323 0.0550926
> 0.74669 0.720872        0.327877        0.0519071
> 0.041566        0.0720553       0.041566        0.0415661
> 0.221666        0.887483        0.252023        0.0590311
> 0.329545        0.198873        0.328659        0.0429608
> 0.0474659       0.169442        0.252151        0.0467083
> 0.378417        0.593421        0.049742        0.049742
> 0.948306        0.885079        0.0516941       0.0516945
> 0.125395        0.0479353       0.198453        0.0471859
> 0.211407        0.0995264       0.268104        0.0464802
> 0.882682        0.688549        0.123939        0.0470169
> 0.60328 0.784425        0.212413        0.0499003
> 0.949945        0.74709 0.156035        0.0392864
> 0.575322        0.431565        0.356998        0.0538141
> 0.449242        0.631319        0.223169        0.0479868
> 0.0638226       0.657861        0.397682        0.0514515
> 0.360792        0.912251        0.0478495       0.0478495
> 0.177293        0.582602        0.132253        0.0594905
> 0.382335        0.73858 0.379773        0.0604821
> 0.21105 0.785124        0.143275        0.0507164
> 0.552041        0.362525        0.172563        0.0620264
> 0.0773323       0.265438        0.0712904       0.0633001
> 0.87013 0.396805        0.324698        0.0398678
> 0.138939        0.445323        0.392625        0.0573682
> 0.180511        0.500006        0.214455        0.0487276
> 0.115404        0.643359        0.0528443       0.0528443
> 0.582388        0.342819        0.406166        0.0466846
> 0.418946        0.301846        0.327761        0.0608555
> 0.356364        0.756159        0.251419        0.0613715
> 0.576311        0.513235        0.0484663       0.0484662
> 0.0408735       0.36165 0.0875356       0.0408624
> 0.514402        0.132975        0.393083        0.0619781
> 0.670612        0.362906        0.38157 0.0467236
> 0.0658148       0.459268        0.062868        0.0628679
> 0.670868        0.960603        0.408127        0.0365926
> 0.462716        0.0617661       0.0614297       0.0614298
> 0.799127        0.744663        0.169019        0.0631224
> 0.050484        0.881728        0.270497        0.0399161
> 0.303164        0.756663        0.0385943       0.0385943
> 0.470468        0.936758        0.275914        0.0630937
> 0.392995        0.0539297       0.219322        0.0536239
> 0.708805        0.048904        0.215345        0.0488984
> 0.125297        0.638052        0.31303 0.0543287
> 0.85406 0.347696        0.41219 0.0364822
> 0.0401791       0.199647        0.135567        0.0357042
> 0.495254        0.786871        0.245201        0.046628
> 0.840116        0.233834        0.396032        0.0561055
> 0.812202        0.138677        0.0467731       0.0466828
> 0.178033        0.356876        0.0564148       0.0564148
> 0.2743  0.957164        0.0393251       0.0393183
> 0.760255        0.138335        0.391451        0.0608448
> 0.452595        0.712892        0.295611        0.0520975
> 0.248872        0.753506        0.225917        0.0417314
> 0.218507        0.599688        0.251404        0.0637709
> 0.128878        0.288025        0.392788        0.0374351
> 0.444152        0.0471805       0.399912        0.0463479
> 0.469483        0.186987        0.0497104       0.0497104
> 0.879782        0.822066        0.115149        0.0609678
> 0.776462        0.668251        0.248614        0.0450083
> 0.190825        0.215004        0.0612952       0.0612952
> 0.408826        0.851182        0.236126        0.0476341
> 0.854052        0.126911        0.335561        0.0479448
> 0.869059        0.846831        0.224476        0.051641
> 0.179661        0.870705        0.139917        0.039936
> 0.455632        0.421401        0.103342        0.0355075
> 0.139049        0.326138        0.167129        0.0649209
> 0.6009  0.0640955       0.244275        0.0637124
> 0.943246        0.462465        0.0571582       0.0567518
> 0.200633        0.661293        0.395995        0.0563755
> 0.233342        0.114597        0.0626282       0.0473784
> 0.631185        0.893359        0.366355        0.0446465
> 0.498379        0.259589        0.214576        0.0577139
> 0.0634402       0.538456        0.386106        0.0620613
> 0.114337        0.643852        0.217734        0.0357355
> 0.325862        0.28513 0.398388        0.0539703
> 0.951275        0.357496        0.0865394       0.0455235
> 0.719768        0.830584        0.389993        0.062889
> 0.0375512       0.694996        0.0371376       0.0371376
> 0.526961        0.0358312       0.393412        0.0358034
> 0.678197        0.819779        0.0602074       0.0594118
> 0.436121        0.519552        0.0370167       0.0370167
> 0.938979        0.245846        0.0610174       0.0610174
> 0.749147        0.0592123       0.11438 0.0592123
> 0.945854        0.354108        0.285589        0.0540409
> 0.306062        0.669683        0.233597        0.0399931
> 0.0605116       0.606126        0.14542 0.0603474
> 0.751393        0.523098        0.316588        0.0462252
> 0.528032        0.859545        0.0612378       0.0612378
> 0.769387        0.915698        0.234384        0.0402417
> 0.567154        0.955642        0.396804        0.0443283
> 0.560521        0.778054        0.311381        0.0445815
> 0.106765        0.0575908       0.385103        0.0575618
> 0.496182        0.0881155       0.177893        0.0625782
> 0.139746        0.936131        0.329799        0.0635095
> 0.382021        0.639166        0.305163        0.0492684
> 0.0479288       0.122867        0.167316        0.0467446
> 0.0375975       0.697852        0.17058 0.0374879
> 0.893306        0.0611883       0.171366        0.0611778
> 0.513622        0.386562        0.274209        0.0486285
> 0.38362 0.722606        0.0694322       0.0534209
> 0.588699        0.948747        0.295502        0.05056
> 0.866555        0.856304        0.397272        0.053207
> 0.284035        0.832839        0.0364156       0.0364156
> 0.105862        0.769681        0.0557092       0.0557093
> 0.774949        0.342188        0.0545807       0.0545701
> 0.874298        0.609474        0.39892 0.0521287
> 0.674166        0.951026        0.215476        0.0487129
> 0.849495        0.293656        0.123138        0.0576814
> 0.229895        0.794712        0.313509        0.0521242
> 0.77832 0.65618 0.0582244       0.0582231
> 0.299272        0.608904        0.312503        0.0370809
> 0.356556        0.948112        0.387721        0.0517992
> 0.321539        0.279118        0.270218        0.052714
> 0.684991        0.0595354       0.333963        0.0593157
> 0.705759        0.847472        0.182374        0.0504684
> 0.134095        0.533776        0.296639        0.0514413
> 0.751609        0.678204        0.4113  0.0381799
> 0.282883        0.598547        0.0455272       0.0454016
> 0.404509        0.215583        0.402144        0.0497718
> 0.9025  0.202241        0.285561        0.0490817
> 0.224791        0.485636        0.413558        0.0397173
> 0.267824        0.361032        0.333768        0.0580376
> 0.933839        0.687528        0.403457        0.0456629
> 0.311674        0.739336        0.134996        0.0441211
> 0.479786        0.540574        0.228629        0.0402202
> 0.550537        0.689544        0.242969        0.0615045
> 0.436617        0.811993        0.320277        0.0431008
> 0.964183        0.538332        0.415268        0.0353617
> 0.121773        0.341018        0.317148        0.0364822
> 0.559415        0.169085        0.195469        0.0415248
> 0.15573 0.433081        0.120784        0.0413841
> 0.579205        0.602552        0.0892549       0.0432337
> 0.95901 0.743803        0.288571        0.0406291
> 0.279864        0.552308        0.37887 0.0521164
> 0.964972        0.559616        0.247982        0.0350256
> 0.354022        0.553964        0.324749        0.0385237
> 0.692896        0.792089        0.286435        0.0449748
> 0.2619  0.893302        0.102437        0.051295
> 0.439872        0.657727        0.0374133       0.0373887
> 0.0501457       0.566415        0.0466294       0.0466294
> 0.39902 0.248523        0.135621        0.0642131
> 0.844721        0.487881        0.317793        0.0521036
> 0.19449 0.831681        0.0524996       0.0524996
> 0.846843        0.739128        0.0496999       0.0496999
> 0.944749        0.783985        0.376702        0.0548595
> 0.130941        0.828011        0.282873        0.0532548
> 0.446215        0.411177        0.347588        0.0532031
> 0.605593        0.0554642       0.403268        0.0455625
> 0.726172        0.5874  0.236592        0.0442944
> 0.0382544       0.454681        0.335379        0.0377607
> 0.404913        0.227143        0.250327        0.047474
> 0.259408        0.260589        0.194349        0.0437369
> 0.0519195       0.587536        0.255879        0.0514326
> 0.695241        0.48926 0.394722        0.0551657
> 0.492347        0.864579        0.186414        0.0503525
> 0.292567        0.828304        0.188301        0.0518917
> 0.586287        0.349398        0.0581353       0.0581349
> 0.574272        0.500838        0.255124        0.0627199
> 0.913169        0.0485111       0.382136        0.0479869
> 0.748174        0.939146        0.135675        0.0607688
> 0.516086        0.797877        0.136104        0.0364826
> 0.0571913       0.358981        0.251247        0.0569603
> 0.795758        0.0570487       0.276563        0.0565297
> 0.93063 0.597776        0.0633083       0.0633083
> 0.645428        0.441282        0.0513466       0.0513466
> 0.821323        0.0533857       0.400228        0.0396113
> 0.536061        0.5847  0.171477        0.0513206
> 0.578524        0.545482        0.390884        0.0647998
> 0.3642  0.501402        0.0758633       0.0402604
> 0.729172        0.273279        0.396242        0.0557977
> 0.816512        0.861359        0.0384156       0.0384156
> 0.244274        0.49165 0.0900987       0.0610728
> 0.420132        0.144469        0.22398 0.0406167
> 0.2009  0.129507        0.388665        0.0593693
> 0.038574        0.90127 0.194248        0.0382819
> 0.336753        0.335666        0.166264        0.0396993
> 0.496279        0.163911        0.249942        0.0419252
> 0.964316        0.67205 0.120294        0.0356695
> 0.0646485       0.729238        0.263907        0.0646253
> 0.360451        0.837668        0.309454        0.0374163
> 0.0466874       0.775381        0.139081        0.0466874
> 0.871121        0.301455        0.321884        0.0415963
> 0.700753        0.957414        0.0417062       0.0417062
> 0.43389 0.861554        0.111414        0.0447848
> 0.744251        0.544441        0.126407        0.0362
> 0.875048        0.124469        0.250218        0.0390558
> 0.250832        0.440112        0.191688        0.0463824
> 0.691832        0.136408        0.259022        0.0455822
> 0.20292 0.0525438       0.136023        0.0524577
> 0.673776        0.371502        0.113292        0.0400885
> 0.283822        0.056032        0.208205        0.0560211
> 0.277663        0.037336        0.0854591       0.0372274
> 0.161845        0.468769        0.0362315       0.0362315
> 0.637948        0.71434 0.319593        0.0557768
> 0.782809        0.234698        0.0532504       0.053212
> 0.247376        0.668459        0.159386        0.0546081
> 0.842055        0.935684        0.195946        0.0442253
> 0.647634        0.141845        0.171252        0.0525951
> 0.173498        0.55765 0.396546        0.0490775
> 0.701696        0.326412        0.235664        0.0615893
> 0.959655        0.822516        0.18025 0.0401745
> 0.332867        0.928102        0.276877        0.0618501
> 0.322529        0.429395        0.047586        0.0475859
> 0.267188        0.751636        0.400834        0.0421299
> 0.958294        0.101816        0.318064        0.0386168
> 0.4037  0.500288        0.245931        0.0475698
> 0.465438        0.203807        0.324934        0.0470071
> 0.0640181       0.258529        0.321117        0.0634469
> 0.203929        0.241125        0.410656        0.0433524
> 0.0518465       0.257147        0.202856        0.0518408
> 0.356452        0.915583        0.158084        0.0598963
> 0.0593948       0.360993        0.388828        0.0582729
> 0.0478509       0.158847        0.0615574       0.0477201
> 0.941852        0.546617        0.334526        0.0485028
> 0.15051 0.052037        0.0490699       0.0490699
> 0.858055        0.597587        0.280627        0.0625559
> 0.956573        0.14004 0.239474        0.0429311
> 0.861144        0.746539        0.272669        0.0571527
> 0.217364        0.714131        0.059367        0.0593671
> 0.337368        0.0834333       0.0467152       0.0467152
> 0.518457        0.955552        0.181542        0.0444168
> 0.834072        0.951194        0.286384        0.0464471
> 0.279538        0.0554101       0.333114        0.055395
> 0.520746        0.59304 0.281228        0.0443113
> 0.251931        0.896207        0.376812        0.0644046
> 0.444606        0.636574        0.395764        0.0562834
> 0.936804        0.93687 0.25046 0.0631158
> 0.656556        0.0486756       0.0362033       0.0362033
> 0.459477        0.527526        0.344566        0.06382
> 0.0410512       0.822467        0.212974        0.0410296
> 0.0385739       0.961151        0.123682        0.0383284
> 0.0402043       0.958908        0.252648        0.0399635
> 0.112921        0.50229 0.149713        0.0448907
> 0.603093        0.888281        0.156609        0.0628658
> 0.156189        0.728352        0.315501        0.0366034
> 0.942989        0.325016        0.39185 0.0556502
> 0.95288 0.421076        0.160895        0.0467776
> 0.543891        0.863118        0.396372        0.0510769
> 0.0585283       0.0594232       0.279523        0.0585283
> 0.475318        0.343097        0.041739        0.0412125
> 0.042977        0.134912        0.377376        0.0429572
> 0.0442115       0.411645        0.15631 0.0442115
>
>
>
> from yade import pack, plot, export, ymport
>
> aggregate=O.materials.append(FrictMat(density=3e3, young=30e9,poisson=.3,
> frictionAngle=.5,label="aggregate"))
> O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))
>
> sp=pack.SpherePack()
> O.bodies.append(ymport.text('compress.txt'))
> sp.toSimulation(material=aggregate)
>
> boxMat=O.materials.append(FrictMat(density=4e3, young=500e9, poisson=0.1,
> frictionAngle=0.5, label="boxMat"))
>
> O.engines=[
>    ForceResetter(),
>    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()
> ,Bo1_Box_Aabb()]),
>    InteractionLoop(
>       [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_
> Box_Sphere_ScGeom()],
>       [Ip2_FrictMat_FrictMat_FrictPhys()],
>       [Law2_ScGeom_FrictPhys_CundallStrack()]
>    ),
>    NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5),
>    PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker'),
> ]
> O.dt=.5*PWaveTimeStep()
>
>
> def checkUnbalanced():
>    if O.iter<10000: return
>    if unbalancedForce()>0.3: return
>    O.bodies.append(box((.5,.5,1.05),(0.1,0.2,0.05),orientation=Quaternion((1,
> 0, 0), 0), dynamic=True, fixed=False, wire=False, color=(0.5,0.5,0.5),
> highlight=False, material=boxMat))
>    global BOX
>    BOX=O.bodies[-1]
>    BOX.state.vel=(0,0,-.4)
>    O.engines=O.engines+[PyRunner(command='addPlotData()',iterPeriod=50)]
>    checker.command='unloadBox()'
>
> def unloadBox():
>    if abs(O.forces.f(BOX.id)[2])>2e8:
>       plot.saveDataTxt('2.txt')
>       O.pause()
>
>
> def addPlotData():
>    if not isinstance(O.bodies[-1].shape,Box):
>       plot.addData(); return
>    Fz=O.forces.f(BOX.id)[2]
>    plot.addData(Fz=Fz,w=BOX.state.pos[2]-BOX.state.refPos[
> 2],unbalanced=unbalancedForce(),i=O.iter)
>
> # besides unbalanced force evolution, also plot the displacement-force
> diagram
> plot.plots={'i':('unbalanced',),'w':('Fz',)}
> plot.plot()
>
>
>
>
> [1] https://answers.launchpad.net/yade/+question/230299
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

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

Reply via email to