yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01376
[svn] r1834 - in trunk/pkg/dem: . Engine/DeusExMachina
Author: chareyre
Date: 2009-07-02 17:26:02 +0200 (Thu, 02 Jul 2009)
New Revision: 1834
Added:
trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.hpp
Modified:
trunk/pkg/dem/SConscript
Log:
Base class for the solid-fluid coupling (E. Catalano PhD).
Added: trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp 2009-07-02 13:33:47 UTC (rev 1833)
+++ trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp 2009-07-02 15:26:02 UTC (rev 1834)
@@ -0,0 +1,89 @@
+/*************************************************************************
+* Copyright (C) 2009 by Bruno Chareyre *
+* bruno.chareyre@xxxxxxxxxxx *
+* *
+* This program is free software; it is licensed under the terms of the *
+* GNU General Public License v2 or later. See file LICENSE for details. *
+*************************************************************************/
+
+#include "FlowEngine.hpp"
+#include <yade/pkg-common/ParticleParameters.hpp>
+#include<yade/core/MetaBody.hpp>
+#include<yade/core/MetaBody.hpp>
+#include<yade/pkg-common/RigidBodyParameters.hpp>
+#include<yade/lib-base/yadeWm3Extra.hpp>
+
+
+FlowEngine::FlowEngine() : gravity(Vector3r::ZERO), isActivated(false)
+{
+dummyParameter = false;
+}
+
+
+FlowEngine::~FlowEngine()
+{
+}
+
+
+void FlowEngine::registerAttributes()
+{
+// REGISTER_ATTRIBUTE(gravity);
+ REGISTER_ATTRIBUTE(isActivated);
+ REGISTER_ATTRIBUTE(dummyParameter);
+}
+
+
+void FlowEngine::applyCondition(MetaBody* ncb)
+{
+
+ if (isActivated)
+ {
+ shared_ptr<BodyContainer>& bodies = ncb->bodies;
+
+
+
+ FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
+ // clump members are non-dynamic; they skip the rest of loop once their forces are properly taken into account, however
+ //if (!b->isDynamic && !b->isClumpMember()) continue;
+
+ RigidBodyParameters* rb = YADE_CAST<RigidBodyParameters*>(b->physicalParameters.get());
+ ///Access data (examples)
+ const body_id_t& id=b->getId();
+ Real vx = rb->velocity[0];
+ Real rx = rb->angularVelocity[0];
+ Real x = rb->se3.position[0];
+ }
+
+ ///Compute flow and and forces here
+
+
+
+
+
+
+
+
+
+ ///End Compute flow and and forces
+
+
+
+
+ int Nspheres=100;
+ for (long i=1; i<Nspheres; ++i)
+ {
+
+ //file >> id >> fx >> fy >> fz >> mx >> my >> mz;
+
+ //Vector3r f (fx,fy,fz);
+ //Vector3r t (mx,my,mz);
+
+ //b->bex.addForce(id,f);
+ //ncb->bex.addTorque(id,t);
+
+ }
+
+ }
+}
+
+YADE_PLUGIN();
Added: trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.hpp 2009-07-02 13:33:47 UTC (rev 1833)
+++ trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.hpp 2009-07-02 15:26:02 UTC (rev 1834)
@@ -0,0 +1,32 @@
+/*************************************************************************
+* Copyright (C) 2009 by Bruno Chareyre *
+* bruno.chareyre@xxxxxxxxxxx *
+* *
+* This program is free software; it is licensed under the terms of the *
+* GNU General Public License v2 or later. See file LICENSE for details. *
+*************************************************************************/
+
+#pragma once
+
+#include<yade/core/DeusExMachina.hpp>
+
+class FlowEngine : public DeusExMachina
+{
+ public :
+ Vector3r gravity;
+ bool isActivated;
+ bool dummyParameter;
+ FlowEngine();
+ virtual ~FlowEngine();
+
+ virtual void applyCondition(MetaBody*);
+
+ protected :
+ virtual void registerAttributes();
+ REGISTER_CLASS_NAME(FlowEngine);
+ REGISTER_BASE_CLASS_NAME(DeusExMachina);
+};
+
+REGISTER_SERIALIZABLE(FlowEngine);
+
+
Modified: trunk/pkg/dem/SConscript
===================================================================
--- trunk/pkg/dem/SConscript 2009-07-02 13:33:47 UTC (rev 1833)
+++ trunk/pkg/dem/SConscript 2009-07-02 15:26:02 UTC (rev 1834)
@@ -846,18 +846,18 @@
['DataClass/InteractionPhysics/CapillaryParameters.cpp'],
LIBS=env['LIBS']+['ElasticContactInteraction']),
-env.SharedLibrary('InteractingSphere2InteractingSphere4SpheresContactGeometryWater',
- ['Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometryWater.cpp'],
- LIBS=env['LIBS']+['SpheresContactGeometry',
- 'InteractionGeometryMetaEngine',
- 'InteractingSphere' ]),
+#env.SharedLibrary('InteractingSphere2InteractingSphere4SpheresContactGeometryWater',
+ #['Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometryWater.cpp'],
+ #LIBS=env['LIBS']+['SpheresContactGeometry',
+ #'InteractionGeometryMetaEngine',
+ #'InteractingSphere' ]),
-env.SharedLibrary('InteractingBox2InteractingSphere4SpheresContactGeometryWater',
- ['Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometryWater.cpp'],
- LIBS=env['LIBS']+['SpheresContactGeometry',
- 'InteractionGeometryMetaEngine',
- 'InteractingSphere',
- 'InteractingBox' ]),
+#env.SharedLibrary('InteractingBox2InteractingSphere4SpheresContactGeometryWater',
+ #['Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometryWater.cpp'],
+ #LIBS=env['LIBS']+['SpheresContactGeometry',
+ #'InteractionGeometryMetaEngine',
+ #'InteractingSphere',
+ #'InteractingBox' ]),
#env.SharedLibrary('MacroMicroElasticRelationshipsWater',
#['Engine/EngineUnit/MacroMicroElasticRelationshipsWater.cpp'],
@@ -883,6 +883,15 @@
'$PREFIX/include',
'DataClass/PhysicalParameters']),
+#env.SharedLibrary('FlowEngine',
+ #['Engine/DeusExMachina/FlowEngine.cpp'],
+ #LIBS=env['LIBS']+['yade-base', 'ParticleParameters', 'CohesiveFrictionalBodyParameters', 'TriaxialCompressionEngine', 'GravityEngines'],
+ #CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
+ #'DataClass/PhysicalAction',
+ #'RigidBodyParameters',
+ #'$PREFIX/include',
+ #'DataClass/PhysicalParameters']),
+
env.SharedLibrary('SampleCapillaryPressureEngine',
['Engine/DeusExMachina/SampleCapillaryPressureEngine.cpp'],
LIBS=env['LIBS']+['yade-factory',
Follow ups