← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2830: - use same ordering convention for boundaries in triax and in aabbBoxes.

 

Bruno,

does this work to you? You say in this commit that: ...(default value is ok
if aabbWalls are appended BEFORE spheres.)
but utils.aabbWalls needs the packing first. Hence it should not be possible
to append aabbWalls before spheres. Do you agree?

Cheers.
Chiara

>
>
>
>> On 22 April 2011 09:07, <noreply@xxxxxxxxxxxxx> wrote:
>>
>>> ------------------------------------------------------------
>>> revno: 2830
>>> committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
>>> branch nick: trunk
>>> timestamp: Fri 2011-04-22 11:04:48 +0200
>>> message:
>>>  - use same ordering convention for boundaries in triax and in aabbBoxes.
>>>  - removed useless variable
>>>  - correct initialisation of compression axis
>>> modified:
>>>  pkg/dem/TriaxialCompressionEngine.hpp
>>>  pkg/dem/TriaxialStressController.cpp
>>>  pkg/dem/TriaxialStressController.hpp
>>>  pkg/dem/TriaxialTest.cpp
>>>  pkg/dem/TriaxialTest.hpp
>>>
>>>
>>> --
>>> 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<https://code.launchpad.net/%7Eyade-dev/yade/trunk/+edit-subscription>
>>>
>>> === modified file 'pkg/dem/TriaxialCompressionEngine.hpp'
>>> --- pkg/dem/TriaxialCompressionEngine.hpp       2010-12-15 16:51:20 +0000
>>> +++ pkg/dem/TriaxialCompressionEngine.hpp       2011-04-22 09:04:48 +0000
>>> @@ -91,7 +91,7 @@
>>>                ((Real,currentStrainRate,0,,"current strain rate -
>>> converging to :yref:`TriaxialCompressionEngine::strainRate` (./s)"))
>>>                ((Real,UnbalancedForce,1,,"mean resultant forces divided
>>> by mean contact force"))
>>>                ((Real,StabilityCriterion,0.001,,"tolerance in terms of
>>> :yref:`TriaxialCompressionEngine::UnbalancedForce` to consider the packing
>>> is stable"))
>>> -
>>> ((Vector3r,translationAxis,TriaxialStressController::normal[wall_bottom_id],,"compression
>>> axis"))
>>> +
>>> ((Vector3r,translationAxis,TriaxialStressController::normal[wall_bottom],,"compression
>>> axis"))
>>>                ((bool,autoCompressionActivation,true,,"Auto-switch from
>>> isotropic compaction (or unloading state if
>>> sigmaLateralConfinement<sigmaIsoCompaction) to deviatoric loading"))
>>>                ((bool,autoUnload,true,,"Auto-switch from isotropic
>>> compaction to unloading"))
>>>                ((bool,autoStopSimulation,true,,"Stop the simulation when
>>> the sample reach STATE_LIMBO, or keep running"))
>>>
>>> === modified file 'pkg/dem/TriaxialStressController.cpp'
>>> --- pkg/dem/TriaxialStressController.cpp        2011-04-03 16:49:58 +0000
>>> +++ pkg/dem/TriaxialStressController.cpp        2011-04-22 09:04:48 +0000
>>> @@ -75,12 +75,12 @@
>>>        // sync thread storage of ForceContainer
>>>        scene->forces.sync();
>>>        if (first) {// sync boundaries ids in the table
>>> -               wall_id[0] = wall_bottom_id;
>>> -               wall_id[1] = wall_top_id;
>>> -               wall_id[2] = wall_left_id;
>>> -               wall_id[3] = wall_right_id;
>>> -               wall_id[4] = wall_front_id;
>>> -               wall_id[5] = wall_back_id;}
>>> +               wall_id[wall_bottom] = wall_bottom_id;
>>> +               wall_id[wall_top] = wall_top_id;
>>> +               wall_id[wall_left] = wall_left_id;
>>> +               wall_id[wall_right] = wall_right_id;
>>> +               wall_id[wall_front] = wall_front_id;
>>> +               wall_id[wall_back] = wall_back_id;}
>>>
>>>        if(thickness<0)
>>> thickness=2.0*YADE_PTR_CAST<Box>(Body::byId(wall_bottom_id,scene)->shape)->extents.y();
>>>        State* p_bottom=Body::byId(wall_bottom_id,scene)->state.get();
>>>
>>> === modified file 'pkg/dem/TriaxialStressController.hpp'
>>> --- pkg/dem/TriaxialStressController.hpp        2010-12-31 14:35:21 +0000
>>> +++ pkg/dem/TriaxialStressController.hpp        2011-04-22 09:04:48 +0000
>>> @@ -28,7 +28,7 @@
>>>                inline const Vector3r getForce(Scene* rb, Body::id_t id){
>>> return rb->forces.getForce(id); /* needs sync, which is done at the
>>> beginning of action */ }
>>>        public :
>>>                //! internal index values for retrieving walls
>>> -               enum { wall_bottom=0, wall_top, wall_left, wall_right,
>>> wall_front, wall_back };
>>> +               enum {wall_left=0, wall_right, wall_bottom, wall_top,
>>> wall_back, wall_front};
>>>                //! real index values of walls in the Scene
>>>                int wall_id [6];
>>>                //! Stores the value of the translation at the previous
>>> time step, stiffness, and normal
>>> @@ -82,12 +82,12 @@
>>>                ((unsigned int,computeStressStrainInterval,10,,""))
>>>                ((Real,wallDamping,0.25,,"wallDamping coefficient -
>>> wallDamping=0 implies a (theoretical) perfect control, wallDamping=1 means
>>> no movement"))
>>>                ((Real,thickness,-1,,"thickness of boxes (needed by some
>>> functions)"))
>>> -               ((int,wall_bottom_id,0,,"id of boundary ; coordinate
>>> 1-"))
>>> -               ((int,wall_top_id,0,,"id of boundary ; coordinate 1+"))
>>> -               ((int,wall_left_id,0,,"id of boundary ; coordinate 0-"))
>>> -               ((int,wall_right_id,0,,"id of boundary ; coordinate 0+"))
>>> -               ((int,wall_front_id,0,,"id of boundary ; coordinate 2+"))
>>> -               ((int,wall_back_id,0,,"id of boundary ; coordinate 2-"))
>>> +               ((int,wall_bottom_id,2,,"id of boundary ; coordinate 1-
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>> +               ((int,wall_top_id,3,,"id of boundary ; coordinate 1+
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>> +               ((int,wall_left_id,0,,"id of boundary ; coordinate 0-
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>> +               ((int,wall_right_id,1,,"id of boundary ; coordinate 0+
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>> +               ((int,wall_front_id,5,,"id of boundary ; coordinate 2+
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>> +               ((int,wall_back_id,4,,"id of boundary ; coordinate 2-
>>> (default value is ok if aabbWalls are appended BEFORE spheres.)"))
>>>                ((bool,wall_bottom_activated,true,,"if true, the engine is
>>> keeping stress constant on this boundary."))
>>>                ((bool,wall_top_activated,true,,"if true, the engine is
>>> keeping stress constant on this boundary."))
>>>                ((bool,wall_left_activated,true,,"if true, the engine is
>>> keeping stress constant on this boundary."))
>>>
>>> === modified file 'pkg/dem/TriaxialTest.cpp'
>>> --- pkg/dem/TriaxialTest.cpp    2011-01-11 14:47:55 +0000
>>> +++ pkg/dem/TriaxialTest.cpp    2011-04-22 09:04:48 +0000
>>> @@ -114,10 +114,9 @@
>>>                Vector3r halfSize       =
>>> Vector3r(wallOversizeFactor*fabs(lowerCorner[0]-upperCorner[0])/2+thickness,
>>>                                                thickness/2.0,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[2]-upperCorner[2])/2+thickness);
>>> -               createBox(body,center,halfSize,wall_bottom_wire);
>>> -               if(wall_bottom) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_bottom_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_bottom_id =
>>> body->getId();
>>>        // top box
>>>                center                  =
>>> Vector3r((lowerCorner[0]+upperCorner[0])/2,
>>>
>>>  upperCorner[1]+thickness/2.0,
>>> @@ -125,10 +124,9 @@
>>>                halfSize                =
>>> Vector3r(wallOversizeFactor*fabs(lowerCorner[0]-upperCorner[0])/2+thickness,
>>>                                                thickness/2.0,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[2]-upperCorner[2])/2+thickness);
>>> -               createBox(body,center,halfSize,wall_top_wire);
>>> -               if(wall_top) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_top_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_top_id = body->getId();
>>>        // box 1
>>>                center                  =
>>> Vector3r(lowerCorner[0]-thickness/2.0,
>>>
>>>  (lowerCorner[1]+upperCorner[1])/2,
>>> @@ -136,10 +134,9 @@
>>>                halfSize                = Vector3r(thickness/2.0,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[1]-upperCorner[1])/2+thickness,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[2]-upperCorner[2])/2+thickness);
>>> -               createBox(body,center,halfSize,wall_1_wire);
>>> -               if(wall_1) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_left_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_left_id = body->getId();
>>>        // box 2
>>>                center                  =
>>> Vector3r(upperCorner[0]+thickness/2.0,
>>>
>>>  (lowerCorner[1]+upperCorner[1])/2,
>>> @@ -148,10 +145,9 @@
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[1]-upperCorner[1])/2+thickness,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[2]-upperCorner[2])/2+thickness);
>>>
>>> -               createBox(body,center,halfSize,wall_2_wire);
>>> -               if(wall_2) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_right_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_right_id = body->getId();
>>>        // box 3
>>>                center                  =
>>> Vector3r((lowerCorner[0]+upperCorner[0])/2,
>>>
>>>  (lowerCorner[1]+upperCorner[1])/2,
>>> @@ -159,10 +155,9 @@
>>>                halfSize                =
>>> Vector3r(wallOversizeFactor*fabs(lowerCorner[0]-upperCorner[0])/2+thickness,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[1]-upperCorner[1])/2+thickness,
>>>                                                thickness/2.0);
>>> -               createBox(body,center,halfSize,wall_3_wire);
>>> -               if(wall_3) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_back_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_back_id = body->getId();
>>>        // box 4
>>>                center                  =
>>> Vector3r((lowerCorner[0]+upperCorner[0])/2,
>>>
>>>  (lowerCorner[1]+upperCorner[1])/2,
>>> @@ -170,10 +165,9 @@
>>>                halfSize                =
>>> Vector3r(wallOversizeFactor*fabs(lowerCorner[0]-upperCorner[0])/2+thickness,
>>>
>>>  wallOversizeFactor*fabs(lowerCorner[1]-upperCorner[1])/2+thickness,
>>>                                                thickness/2.0);
>>> -               createBox(body,center,halfSize,wall_3_wire);
>>> -               if(wall_4) {
>>> -                       scene->bodies->insert(body);
>>> -                       triaxialcompressionEngine->wall_front_id =
>>> body->getId();}
>>> +               createBox(body,center,halfSize,true);
>>> +               scene->bodies->insert(body);
>>> +               triaxialcompressionEngine->wall_front_id = body->getId();
>>>        }
>>>        size_t imax=sphere_pack.pack.size();
>>>        for(size_t i=0; i<imax; i++){
>>>
>>> === modified file 'pkg/dem/TriaxialTest.hpp'
>>> --- pkg/dem/TriaxialTest.hpp    2011-01-21 08:14:28 +0000
>>> +++ pkg/dem/TriaxialTest.hpp    2011-04-22 09:04:48 +0000
>>> @@ -45,19 +45,7 @@
>>>        private :
>>>                Vector3r         gravity;
>>>                Vector3r         spheresColor;
>>> -               bool             wall_top
>>> -                               ,wall_bottom
>>> -                               ,wall_1
>>> -                               ,wall_2
>>> -                               ,wall_3
>>> -                               ,wall_4
>>> -                               ,wall_top_wire
>>> -                               ,wall_bottom_wire
>>> -                               ,wall_1_wire
>>> -                               ,wall_2_wire
>>> -                               ,wall_3_wire
>>> -                               ,wall_4_wire
>>> -                               ,spheresRandomColor;
>>> +               bool            spheresRandomColor;
>>>
>>>                shared_ptr<TriaxialCompressionEngine>
>>> triaxialcompressionEngine;
>>>                shared_ptr<TriaxialStressController>
>>> triaxialstressController;
>>> @@ -123,18 +111,6 @@
>>>                /* init */
>>>                ,
>>>                /* constructor */
>>> -               wall_top                = true;
>>> -               wall_bottom             = true;
>>> -               wall_1                  = true;
>>> -               wall_2                  = true;
>>> -               wall_3                  = true;
>>> -               wall_4                  = true;
>>> -               wall_top_wire           = true;
>>> -               wall_bottom_wire        = true;
>>> -               wall_1_wire             = true;
>>> -               wall_2_wire             = true;
>>> -               wall_3_wire             = true;
>>> -               wall_4_wire             = true;
>>>                spheresColor            = Vector3r(0.8,0.3,0.3);
>>>                spheresRandomColor      = false;
>>>                WallStressRecordFile = "./WallStresses"+Key;
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>

Follow ups

References