yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04283
[Branch ~yade-dev/yade/trunk] Rev 2201: - Use Shop::kineticEnergy in the recorder (adds the rotational term).
------------------------------------------------------------
revno: 2201
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Wed 2010-05-05 18:22:26 +0200
message:
- Use Shop::kineticEnergy in the recorder (adds the rotational term).
modified:
pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.cpp
pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.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
=== modified file 'pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.cpp'
--- pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.cpp 2010-03-31 16:24:16 +0000
+++ pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.cpp 2010-05-05 16:22:26 +0000
@@ -17,6 +17,7 @@
#include <boost/lexical_cast.hpp>
#include <yade/pkg-dem/ScGeom.hpp>
#include <yade/pkg-dem/FrictPhys.hpp>
+#include <yade/pkg-dem/Shop.hpp>
CREATE_LOGGER(TriaxialStateRecorder);
TriaxialStateRecorder::~TriaxialStateRecorder() {};
@@ -24,19 +25,13 @@
void TriaxialStateRecorder::action ()
{
// at the beginning of the file; write column titles
- if(out.tellp()==0){
- out<<"iteration s11 s22 s33 e11 e22 e33 unb_force porosity kineticE"<<endl;
- }
-
- if ( !triaxialStressController )
- {
+ if(out.tellp()==0) out<<"iteration s11 s22 s33 e11 e22 e33 unb_force porosity kineticE"<<endl;
+
+ if ( !triaxialStressController ){
vector<shared_ptr<Engine> >::iterator itFirst = scene->engines.begin();
vector<shared_ptr<Engine> >::iterator itLast = scene->engines.end();
- for ( ;itFirst!=itLast; ++itFirst )
- {
-
- if ( ( *itFirst )->getClassName() == "TriaxialCompressionEngine" || ( *itFirst )->getClassName() == "ThreeDTriaxialEngine" )
- {
+ for ( ;itFirst!=itLast; ++itFirst ){
+ if ( ( *itFirst )->getClassName() == "TriaxialCompressionEngine" || ( *itFirst )->getClassName() == "ThreeDTriaxialEngine" ){
LOG_DEBUG ( "stress controller engine found" );
triaxialStressController = YADE_PTR_CAST<TriaxialStressController> ( *itFirst );
//triaxialCompressionEngine = shared_ptr<TriaxialCompressionEngine> (static_cast<TriaxialCompressionEngine*> ( (*itFirst).get()));
@@ -47,22 +42,15 @@
if ( ! ( Omega::instance().getCurrentIteration() % triaxialStressController->computeStressStrainInterval == 0 ) )
triaxialStressController->computeStressStrain ();
- /// Compute kinetic energy and porosity :
-
- Real Vs=0, kinematicE = 0;
+ /// Compute porosity :
+ Real Vs=0;
Real V = ( triaxialStressController->height ) * ( triaxialStressController->width ) * ( triaxialStressController->depth );
-
BodyContainer::iterator bi = scene->bodies->begin();
BodyContainer::iterator biEnd = scene->bodies->end();
-
- for ( ; bi!=biEnd; ++bi )
- {
+ for ( ; bi!=biEnd; ++bi ){
const shared_ptr<Body>& b = *bi;
if ( b->isDynamic ){
const Vector3r& v = b->state->vel;
- kinematicE +=
- 0.5* ( b->state->mass ) * ( v[0]*v[0]+v[1]*v[1]+v[2]*v[2] );
-
Vs += 1.3333333*Mathr::PI*pow ( YADE_PTR_CAST<Sphere>( b->shape)->radius, 3 );}
}
porosity = ( V - Vs ) /V;
@@ -76,9 +64,8 @@
<< lexical_cast<string> ( triaxialStressController->strain[2] ) << " "
<< lexical_cast<string> ( triaxialStressController->ComputeUnbalancedForce () ) << " "
<< lexical_cast<string> ( porosity ) << " "
- << lexical_cast<string> ( kinematicE )
+ << lexical_cast<string> ( Shop::kineticEnergy() )
<< endl;
}
-
YADE_PLUGIN((TriaxialStateRecorder));
=== modified file 'pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.hpp'
--- pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.hpp 2010-04-10 15:11:48 +0000
+++ pkg/dem/Engine/PartialEngine/TriaxialStateRecorder.hpp 2010-05-05 16:22:26 +0000
@@ -32,7 +32,7 @@
virtual ~TriaxialStateRecorder ();
virtual void action();
- YADE_CLASS_BASE_DOC_ATTRS_CTOR(TriaxialStateRecorder,Recorder,"Engine recording triaxial variables (needs :yref:`TriaxialCompressionEngine` or :yref:`ThreeDTriaxialEngine` present in the simulation).",
+ YADE_CLASS_BASE_DOC_ATTRS_CTOR(TriaxialStateRecorder,Recorder,"Engine recording triaxial variables (see the variables list in the first line of the output file). This recorder needs :yref:`TriaxialCompressionEngine` or :yref:`ThreeDTriaxialEngine` present in the simulation).",
((Real,porosity,1,"porosity of the packing [-]")), //Is it really needed to have this value as a serializable?
initRun=true;
);