yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00869
[svn] r1625 - in trunk: extra/usct pkg/dem/PreProcessor
Author: eudoxos
Date: 2009-01-15 06:17:58 +0100 (Thu, 15 Jan 2009)
New Revision: 1625
Modified:
trunk/extra/usct/UniaxialStrainControlledTest.cpp
trunk/extra/usct/UniaxialStrainControlledTest.hpp
trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
Log:
1. Un-disallow (bug) having all dimensions scalable in triaxial if particle radius is fixed.
2. Don't record anything by default to file in UniaxialStrainer (only useful for debugging)
Modified: trunk/extra/usct/UniaxialStrainControlledTest.cpp
===================================================================
--- trunk/extra/usct/UniaxialStrainControlledTest.cpp 2009-01-14 03:17:46 UTC (rev 1624)
+++ trunk/extra/usct/UniaxialStrainControlledTest.cpp 2009-01-15 05:17:58 UTC (rev 1625)
@@ -113,7 +113,7 @@
// reverse if we're over the limit strain
if(notYetReversed && limitStrain!=0 && ((currentStrainRate>0 && strain>limitStrain) || (currentStrainRate<0 && strain<limitStrain))) { currentStrainRate*=-1; notYetReversed=false; LOG_INFO("Reversed strain rate to "<<currentStrainRate); }
- if(Omega::instance().getCurrentIteration()%10==0 ) {
+ if(Omega::instance().getCurrentIteration()%10==0) {
computeAxialForce(rootBody);
#if 0
vector<Real> widths;
@@ -122,7 +122,7 @@
for(size_t i=0; i<widths.size(); i++) avgTransStrain+=(widths[i]/originalWidths[i]-1); avgTransStrain/=widths.size();
#endif
avgStress=(sumPosForces+sumNegForces)/(2*crossSectionArea); // average nominal stress
- if(recStream.good()) recStream<<Omega::instance().getCurrentIteration()<<" "<<strain<<" "<<avgStress<<endl; // <<" "<<avgTransStrain<<endl;
+ if(!recordFile.empty() && recStream.good()) recStream<<Omega::instance().getCurrentIteration()<<" "<<strain<<" "<<avgStress<<endl; // <<" "<<avgTransStrain<<endl;
}
}
Modified: trunk/extra/usct/UniaxialStrainControlledTest.hpp
===================================================================
--- trunk/extra/usct/UniaxialStrainControlledTest.hpp 2009-01-14 03:17:46 UTC (rev 1624)
+++ trunk/extra/usct/UniaxialStrainControlledTest.hpp 2009-01-15 05:17:58 UTC (rev 1625)
@@ -131,7 +131,7 @@
Real strain, avgStress;
virtual void applyCondition(MetaBody* rootBody);
- UniaxialStrainer(){axis=2; asymmetry=0; currentStrainRate=0; originalLength=-1; limitStrain=0; notYetReversed=true; crossSectionArea=-1; needsInit=true; /* sensorsPusher=shared_ptr<UniaxialStrainSensorPusher>(); */ recordFile="/tmp/usct.data"; strain=avgStress=/*avgTransStrain=*/0; blockRotations=false; blockDisplacements=false; stopStrain=numeric_limits<Real>::quiet_NaN(); active=true; idleIterations=0; };
+ UniaxialStrainer(){axis=2; asymmetry=0; currentStrainRate=0; originalLength=-1; limitStrain=0; notYetReversed=true; crossSectionArea=-1; needsInit=true; /* sensorsPusher=shared_ptr<UniaxialStrainSensorPusher>(); */ recordFile=""; strain=avgStress=/*avgTransStrain=*/0; blockRotations=false; blockDisplacements=false; stopStrain=numeric_limits<Real>::quiet_NaN(); active=true; idleIterations=0; };
virtual ~UniaxialStrainer(){};
REGISTER_ATTRIBUTES(DeusExMachina,
(strainRate)
@@ -154,7 +154,7 @@
(blockDisplacements)
(blockRotations)
);
- void prepareRecStream(void){ if(recordFile!="") recStream.open(recordFile.c_str()); }
+ void prepareRecStream(void){ if(!recordFile.empty()) recStream.open(recordFile.c_str()); }
void postProcessAttributes(bool deserializing){ if(deserializing) prepareRecStream(); }
NEEDS_BEX("Force","Momentum","GlobalStiffness");
REGISTER_CLASS_AND_BASE(UniaxialStrainer,DeusExMachina);
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-01-14 03:17:46 UTC (rev 1624)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-01-15 05:17:58 UTC (rev 1625)
@@ -277,7 +277,7 @@
bool fixedDims[3];
fixedDims[0]=fixedBoxDims.find('x')!=string::npos; fixedDims[1]=fixedBoxDims.find('y')!=string::npos; fixedDims[2]=fixedBoxDims.find('z')!=string::npos;
int nScaled=(3-(int)fixedDims[0]+(int)fixedDims[1]+(int)fixedDims[2]);
- if(nScaled==3) throw std::invalid_argument("At most 2 (not 3) axes can have fixed dimensions in fixedBoxDims if scaling for given radiusMean.");
+ if(nScaled==0) throw std::invalid_argument("At most 2 (not 3) axes can have fixed dimensions in fixedBoxDims if scaling for given radiusMean.");
Real boxScaleFactor=radiusMean*pow((4/3.)*Mathr::PI*numberOfGrains/(volume*(1-porosity)),1./nScaled);
LOG_INFO("Mean radius value of "<<radiusMean<<" requested, scaling "<<nScaled<<" dimensions by "<<boxScaleFactor);
dimensions[0]*=fixedDims[0]?1.:boxScaleFactor; dimensions[1]*=fixedDims[1]?1.:boxScaleFactor; dimensions[2]*=fixedDims[2]?1.:boxScaleFactor;