------------------------------------------------------------------------
r1462 | eudoxos | 2008-08-12 16:20:23 +0200 (wto, 12 sie 2008) | 4 lines
Changed paths:
   M /trunk/extra/Brefcom.cpp
   M /trunk/extra/Brefcom.hpp
   M /trunk/gui/py/PythonUI_rc.py
   M /trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp

1. Fix error with newer ipython coming from the fact that sys.argv wasn't 
defined in the embedded python env.
2. Fixes in brefcom.
3. stopSimulationLoop in TriaxialCompressionEngine if we enter LIMBO state.

------------------------------------------------------------------------
Index: pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp  (revision 1461)
+++ pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp  (revision 1462)
@@ -216,6 +216,7 @@
        
        if ( currentState==STATE_LIMBO )
        {               
+               Omega::instance().stopSimulationLoop();
                return;
        }
 
@@ -233,14 +234,14 @@
                Real dt = Omega::instance().getTimeStep();
                
                if (abs(epsilonMax) > abs(strain[1])) {
-               if ( currentStrainRate != strainRate ) currentStrainRate += ( 
strainRate-currentStrainRate ) *0.0003; // !!! if unloading (?)
-               //else currentStrainRate = strainRate;
+                       if ( currentStrainRate != strainRate ) 
currentStrainRate += ( strainRate-currentStrainRate ) *0.0003; // !!! if 
unloading (?)
+                       //else currentStrainRate = strainRate;
 
-               /* Move top and bottom wall according to strain rate */
-               PhysicalParameters* p=static_cast<PhysicalParameters*> ( 
Body::byId ( wall_bottom_id )->physicalParameters.get() );
-               p->se3.position += 
0.5*currentStrainRate*height*translationAxis*dt;
-               p = static_cast<PhysicalParameters*> ( Body::byId ( wall_top_id 
)->physicalParameters.get() );
-               p->se3.position -= 
0.5*currentStrainRate*height*translationAxis*dt;
+                       /* Move top and bottom wall according to strain rate */
+                       PhysicalParameters* p=static_cast<PhysicalParameters*> 
( Body::byId ( wall_bottom_id )->physicalParameters.get() );
+                       p->se3.position += 
0.5*currentStrainRate*height*translationAxis*dt;
+                       p = static_cast<PhysicalParameters*> ( Body::byId ( 
wall_top_id )->physicalParameters.get() );
+                       p->se3.position -= 
0.5*currentStrainRate*height*translationAxis*dt;
                } else {
                        Omega::instance().stopSimulationLoop();
                }
Index: extra/Brefcom.hpp
===================================================================
--- extra/Brefcom.hpp   (revision 1461)
+++ extra/Brefcom.hpp   (revision 1462)
@@ -280,12 +280,12 @@
 class GLDrawBrefcomContact: public GLDrawInteractionPhysicsFunctor {
        public: virtual void go(const shared_ptr<InteractionPhysics>&,const 
shared_ptr<Interaction>&,const shared_ptr<Body>&,const shared_ptr<Body>&,bool 
wireFrame);
        virtual ~GLDrawBrefcomContact() {};
-       virtual void registerAttributes(){ REGISTER_ATTRIBUTE(contactLine); 
REGISTER_ATTRIBUTE(dmgLabel); REGISTER_ATTRIBUTE(epsT); 
REGISTER_ATTRIBUTE(epsTAxes); REGISTER_ATTRIBUTE(normal); 
REGISTER_ATTRIBUTE(colorStrain); }
+       virtual void registerAttributes(){ REGISTER_ATTRIBUTE(contactLine); 
REGISTER_ATTRIBUTE(dmgLabel); REGISTER_ATTRIBUTE(epsT); 
REGISTER_ATTRIBUTE(epsTAxes); REGISTER_ATTRIBUTE(normal); 
REGISTER_ATTRIBUTE(colorStrain); REGISTER_ATTRIBUTE(epsNLabel);}
        RENDERS(BrefcomContact);
        REGISTER_CLASS_NAME(GLDrawBrefcomContact);
        REGISTER_BASE_CLASS_NAME(GLDrawInteractionPhysicsFunctor);
        DECLARE_LOGGER;
-       static bool contactLine,dmgLabel,epsT,epsTAxes,normal,colorStrain;
+       static bool 
contactLine,dmgLabel,epsT,epsTAxes,normal,colorStrain,epsNLabel;
 };
 REGISTER_SERIALIZABLE(GLDrawBrefcomContact,false);
 
Index: extra/Brefcom.cpp
===================================================================
--- extra/Brefcom.cpp   (revision 1461)
+++ extra/Brefcom.cpp   (revision 1462)
@@ -284,6 +284,7 @@
 
 bool GLDrawBrefcomContact::contactLine=true;
 bool GLDrawBrefcomContact::dmgLabel=true;
+bool GLDrawBrefcomContact::epsNLabel=true;
 bool GLDrawBrefcomContact::epsT=false;
 bool GLDrawBrefcomContact::epsTAxes=false;
 bool GLDrawBrefcomContact::normal=false;
@@ -299,9 +300,15 @@
                glScale(len,radius,radius);
                glutSolidCube(1);
        } */
+       Vector3r lineColor(BC->omega,1-BC->omega,0.0); /* damaged links red, 
undamaged green */
 
-       if(contactLine) 
Shop::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position,Vector3r(BC->omega,1-BC->omega,0.0)
 /* damaged links red, undamaged green */ );
-       if(dmgLabel){ 
Shop::GLDrawNum(BC->omega,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),Vector3r(BC->omega,1-BC->omega,0.));
 }
+       Real epsTransNegAbs=-max(0.,BC->epsTrans);
+       if(colorStrain) 
lineColor=Vector3r(min(1.,max(0.,epsTransNegAbs/BC->epsCrackOnset-1)),min(1.,epsTransNegAbs/BC->epsCrackOnset),1);
+
+       if(contactLine) 
Shop::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position);
+       if(dmgLabel){ 
Shop::GLDrawNum(BC->omega,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor);
 }
+       if(epsNLabel){ 
Shop::GLDrawNum(BC->epsN,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor);
 }
+
        const Vector3r& 
cp=static_pointer_cast<SpheresContactGeometry>(i->interactionGeometry)->contactPoint;
        if(epsT){
                Real 
maxShear=(BC->undamagedCohesion-BC->sigmaN*BC->tanFrictionAngle)/BC->G;
Index: gui/py/PythonUI_rc.py
===================================================================
--- gui/py/PythonUI_rc.py       (revision 1461)
+++ gui/py/PythonUI_rc.py       (revision 1462)
@@ -42,6 +42,7 @@
        import time;
        while True: time.sleep(1)
 else:
+       sys.argv=runtime.args # could be [] as well
        from IPython.Shell import IPShellEmbed
        sys.argv=['<embedded python interpreter>']
        ipshell = IPShellEmbed(banner=r"""__   __    ____          ____         
             _      

_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to