← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1816: CohesiveStateRPMRecorder base templates are added. This Engine is for calculating

 

------------------------------------------------------------
revno: 1816
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2009-11-26 17:27:21 +0100
message:
  CohesiveStateRPMRecorder base templates are added. This Engine is for calculating 
  cohesive contacts in the RPM model.
added:
  pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.cpp
  pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.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.
=== added file 'pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.cpp'
--- pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.cpp	1970-01-01 00:00:00 +0000
+++ pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.cpp	2009-11-26 16:27:21 +0000
@@ -0,0 +1,33 @@
+#include"CohesiveStateRPMRecorder.hpp"
+
+YADE_PLUGIN((CohesiveStateRPMRecorder));
+CREATE_LOGGER(CohesiveStateRPMRecorder);
+
+CohesiveStateRPMRecorder::CohesiveStateRPMRecorder() 
+{
+	initRun=true;
+	numberCohesiveContacts=0;
+}
+
+CohesiveStateRPMRecorder::~CohesiveStateRPMRecorder()
+{
+}
+
+void CohesiveStateRPMRecorder::init(MetaBody* rootBody)
+{
+}
+
+void CohesiveStateRPMRecorder::action(MetaBody* rootBody)
+{
+	InteractionContainer::iterator ii = rootBody->interactions->begin();
+	InteractionContainer::iterator iiEnd = rootBody->interactions->end(); 
+	LOG_WARN("START !!!");
+	numberCohesiveContacts=0;
+	for(; ii!=iiEnd; ++ii ) {
+		const shared_ptr<Interaction>& interaction = *ii;
+		RpmPhys* contPhys = static_cast<RpmPhys*>(interaction->interactionPhysics.get());
+		if (contPhys->isCohesive==true) {
+		
+		}
+	}
+}

=== added file 'pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.hpp'
--- pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.hpp	1970-01-01 00:00:00 +0000
+++ pkg/dem/Engine/StandAloneEngine/CohesiveStateRPMRecorder.hpp	2009-11-26 16:27:21 +0000
@@ -0,0 +1,22 @@
+#pragma once
+#include<yade/pkg-common/PeriodicEngines.hpp>
+#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
+#include<yade/pkg-dem/RockPM.hpp>
+
+
+class CohesiveStateRPMRecorder: public PeriodicEngine {
+	public:
+		string fileName;
+		int numberCohesiveContacts;
+		CohesiveStateRPMRecorder(); 
+		~CohesiveStateRPMRecorder();
+		void init(MetaBody*);
+		virtual void action(MetaBody*);
+	private:
+		
+	REGISTER_ATTRIBUTES(PeriodicEngine,(fileName));
+	REGISTER_CLASS_AND_BASE(CohesiveStateRPMRecorder,PeriodicEngine);
+	DECLARE_LOGGER;
+};
+REGISTER_SERIALIZABLE(CohesiveStateRPMRecorder);
+