yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00620
[svn] r1504 - in trunk: core gui/qt3 pkg/dem pkg/dem/Engine/DeusExMachina pkg/dem/PreProcessor
Author: cosurgi
Date: 2008-09-05 01:52:38 +0200 (Fri, 05 Sep 2008)
New Revision: 1504
Modified:
trunk/core/NullGUI.cpp
trunk/gui/qt3/SimulationController.cpp
trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp
trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp
trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
trunk/pkg/dem/SConscript
Log:
more configurable MakeItFlat,
TriaxialTest can be now a biaxial test as well.
small fixes in UIs
Modified: trunk/core/NullGUI.cpp
===================================================================
--- trunk/core/NullGUI.cpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/core/NullGUI.cpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -114,12 +114,13 @@
}
else // FileGenerator
{
- for(int i=0; i<inputFiles.size() ; ++i)
+ for(unsigned int i=0; i<inputFiles.size() ; ++i)
{
std::cerr << "filegenerator: \"" << inputFiles[i] << "\"";
file=inputFiles[i];
gen();
}
+ return 0;
}
assert(false); // never reach this place
Modified: trunk/gui/qt3/SimulationController.cpp
===================================================================
--- trunk/gui/qt3/SimulationController.cpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/gui/qt3/SimulationController.cpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -281,7 +281,7 @@
Omega::instance().setSimulationFileName(name);
pbResetSimulation->setEnabled(true);
}
-
+ YadeQtMainWindow::self->redrawAll(true);
// pbCenterSceneClicked(); // FIXME - add autocenter option...
}
Modified: trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -13,6 +13,9 @@
MakeItFlat::MakeItFlat() : actionParameterForce(new Force)
{
+ direction=1;
+ plane_position=0;
+ reset_force=true;
}
@@ -23,14 +26,16 @@
void MakeItFlat::registerAttributes()
{
- // REGISTER_ATTRIBUTE(hydraulicForce);
+ REGISTER_ATTRIBUTE(direction);
+ REGISTER_ATTRIBUTE(plane_position);
+ REGISTER_ATTRIBUTE(reset_force);
}
void MakeItFlat::applyCondition(MetaBody* ncb)
{
shared_ptr<BodyContainer>& bodies = ncb->bodies;
-
+
BodyContainer::iterator bi = bodies->begin();
BodyContainer::iterator biEnd = bodies->end();
for( ; bi!=biEnd ; ++bi )
@@ -46,14 +51,15 @@
if(b->geometricalModel->getClassName()=="Sphere")
{
- ParticleParameters* p = dynamic_cast<ParticleParameters*>(b->physicalParameters.get());
- if (p)
- {
- p->se3.position[1]=0;
- static_cast<Force*>( ncb->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force[1]=0;//
+ ParticleParameters* p = dynamic_cast<ParticleParameters*>(b->physicalParameters.get());
+ if (p)
+ {
+ p->se3.position[direction]=plane_position;
+ if(reset_force)
+ static_cast<Force*>( ncb->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force[direction]=0;//
+ }
}
- }
- }
+ }
}
YADE_PLUGIN();
Modified: trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -23,6 +23,10 @@
virtual ~MakeItFlat();
virtual void applyCondition(MetaBody*);
+
+ int direction;
+ Real plane_position;
+ bool reset_force;
protected :
virtual void registerAttributes();
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -23,6 +23,7 @@
#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
+#include<yade/pkg-dem/MakeItFlat.hpp>
#include<yade/pkg-dem/AveragePositionRecorder.hpp>
#include<yade/pkg-dem/ForceRecorder.hpp>
@@ -155,6 +156,8 @@
sigmaLateralConfinement=sigmaIsoCompaction;
wallOversizeFactor=1.3;
+
+ biaxial2dTest=false;
// wall_top_id =0;
// wall_bottom_id =0;
@@ -182,6 +185,7 @@
//REGISTER_ATTRIBUTE(nlayers);
//REGISTER_ATTRIBUTE(boxWalls);
REGISTER_ATTRIBUTE(internalCompaction);
+ REGISTER_ATTRIBUTE(biaxial2dTest);
REGISTER_ATTRIBUTE(maxMultiplier);
REGISTER_ATTRIBUTE(finalMaxMultiplier);
@@ -251,6 +255,12 @@
// unsigned int startId=boost::numeric::bounds<unsigned int>::highest(), endId=0; // record forces from group 2
message="";
+ if(biaxial2dTest && (8.0*(upperCorner[2]-lowerCorner[2]))>(upperCorner[0]-lowerCorner[0]))
+ {
+ message="Biaxial test can be generated only if Z size is more than 8 times smaller than X size";
+ return false;
+ }
+
rootBody = shared_ptr<MetaBody>(new MetaBody);
createActors(rootBody);
positionRootBody(rootBody);
@@ -593,12 +603,16 @@
//cerr << "fin de section triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
// recording global stress
- triaxialStateRecorder = shared_ptr<TriaxialStateRecorder>(new
- TriaxialStateRecorder);
+ triaxialStateRecorder = shared_ptr<TriaxialStateRecorder>(new TriaxialStateRecorder);
triaxialStateRecorder-> outputFile = WallStressRecordFile + Key;
triaxialStateRecorder-> interval = recordIntervalIter;
//triaxialStateRecorderer-> thickness = thickness;
-
+
+ shared_ptr<MakeItFlat> makeItFlat(new MakeItFlat);
+ makeItFlat->direction=2;
+ makeItFlat->plane_position = (lowerCorner[2]+upperCorner[2])*0.5;
+ makeItFlat->reset_force = false;
+
#if 0
// moving walls to regulate the stress applied
//cerr << "triaxialstressController = shared_ptr<TriaxialStressController> (new TriaxialStressController);" << std::endl;
@@ -632,6 +646,8 @@
//rootBody->engines.push_back(gravityCondition);
rootBody->engines.push_back(shared_ptr<Engine> (new NewtonsDampedLaw));
+
+ if(biaxial2dTest) rootBody->engines.push_back(makeItFlat);
//if(!rotationBlocked)
// rootBody->engines.push_back(orientationIntegrator);
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.hpp 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.hpp 2008-09-04 23:52:38 UTC (rev 1504)
@@ -95,7 +95,8 @@
,boxWalls
//! flag for choosing between moving boundaries or increasing particles sizes during the compaction stage.
,internalCompaction
- ,saveAnimationSnapshots;
+ ,saveAnimationSnapshots
+ ,biaxial2dTest;
int recordIntervalIter
,timeStepUpdateInterval
Modified: trunk/pkg/dem/SConscript
===================================================================
--- trunk/pkg/dem/SConscript 2008-09-03 02:02:15 UTC (rev 1503)
+++ trunk/pkg/dem/SConscript 2008-09-04 23:52:38 UTC (rev 1504)
@@ -637,6 +637,7 @@
'SimpleElasticRelationships',
'ElasticCriterionTimeStepper',
'PhysicalActionVectorVector',
+ 'MakeItFlat',
'InteractionVecSet',
'InteractionHashMap',
'BodyRedirectionVector',
Follow ups