← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2952: Fix --test

 

Thank you for notifying and fixing the error.
I see SpherePack_toSimulation has a feature that I did not suspect (and
that I find in fact annoying): it sets the cell's size to the packing's
size (which means I can't generate a cloud smaller, or with a different
geometry, than the cell itself).
Commenting  the line blocked this behaviour, hence was detected by some
doc-testing (pack.py:73):

Add generated packing to the simulation, rotated by 45° along +z

    >>> sp.toSimulation(rot=Quaternion((0,0,1),pi/4),color=(0,0,1))
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]

Periodic properties are transferred to the simulation correctly,
including rotation:

    >>> O.periodic
    True
    >>> O.cell.refSize
    Vector3(5,5,5)
    >>> O.cell.hSize
    Matrix3(3.53553,-3.53553,0, 3.53553,3.53553,0, 0,0,5)

It is ok to revert the change and keep the line uncommented as you did.
Fortunately, I think there is a workaround to avoid modifying the cell.

Bruno




On 02/11/11 08:03, Anton Gladky wrote:
> Bruno,
>
> you have commented that line and it breaks "--test".
> Please, have a look.
>
> Anton
>
>
>
>
> On Wed, Nov 2, 2011 at 8:01 AM,  <noreply@xxxxxxxxxxxxx> wrote:
>> ------------------------------------------------------------
>> revno: 2952
>> committer: Anton Gladky <gladky.anton@xxxxxxxxx>
>> branch nick: yade
>> timestamp: Wed 2011-11-02 07:59:51 +0100
>> message:
>>  Fix --test
>> modified:
>>  pkg/dem/SpherePack.cpp
>>
>>
>> --
>> 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/dem/SpherePack.cpp'
>> --- pkg/dem/SpherePack.cpp      2011-10-31 18:05:09 +0000
>> +++ pkg/dem/SpherePack.cpp      2011-11-02 06:59:51 +0000
>> @@ -140,7 +140,7 @@
>>        if(err || mode<0) throw invalid_argument("SpherePack.makeCloud: at least one of rMean, porosity, psdSizes & psdCumm arguments must be specified. rMean can't be combined with psdSizes.");
>>        // adjust uniform distribution parameters with distributeMass; rMean has the meaning (dimensionally) of _volume_
>>        const int maxTry=1000;
>> -//     if(periodic)(cellSize=size);
>> +       if(periodic)(cellSize=size);
>>        Real r=0;
>>        for(int i=0; (i<num) || (num<0); i++) {
>>                Real norm, rand;
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~yade-dev
>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~yade-dev
>> More help   : https://help.launchpad.net/ListHelp
>>
>>


-- 
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
11, rue des Mathématiques
BP 46
38402 St Martin d'Hères, France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________



References