------------------------------------------------------------
revno: 2858
committer: Anton Gladky <[email protected]>
branch nick: yade
timestamp: Wed 2011-05-11 09:05:07 +0200
message:
  Remove PressTestEngine, because python-variant works much better
removed:
  pkg/common/PressTestEngine.cpp
  pkg/common/PressTestEngine.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
=== removed file 'pkg/common/PressTestEngine.cpp'
--- pkg/common/PressTestEngine.cpp	2011-04-21 13:59:13 +0000
+++ pkg/common/PressTestEngine.cpp	1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-
-#include"PressTestEngine.hpp"
-#include<yade/core/Scene.hpp>
-
-
-void PressTestEngine::action(){
-	if (curentDirection != stop) {
-		if (curentDirection==forward) { 										 ///<Forward direction of the press
-			FOREACH(Body::id_t id, ids){
-				if (!(scene->bodies->exists(id))) continue;
-				currentVerticalForce = scene->forces.getForce(id)[2]; 	///<Define current vertical force
-				minimalForce = maxVerticalForce*0.1;									///<Define minimal edge of the force (10% from Maximal)
-				minimalPredictedForce = predictedForce*0.1;						///<Define minimal edge of the Predicted force (10% from Predicted)
-				if (currentVerticalForce > maxVerticalForce) {				///<Force increasing. Press is working normally
-					maxVerticalForce = currentVerticalForce;
-				} else if ((currentVerticalForce<=(minimalForce))&&(maxVerticalForce>minimalPredictedForce)) {
-					/**
-					 * Force is decreased lower, than minimal. The body seems "cracked".
-					 * Starting the countdown
-					 */ 
-					currentIterationAfterDestruction++;
-					if (currentIterationAfterDestruction>=numberIterationAfterDestruction) {
-						/**
-						 * The body definitly cracked. Change the direction of press and increase the velosity in 5 times.
-						 */ 
-						curentDirection=backward;
-						TranslationEngine::velocity *= -pressVelocityForw2Back;
-						currentIterationAfterDestruction = scene->iter/pressVelocityForw2Back*riseUpPressHigher;
-					}
-				}  else if (((currentIterationAfterDestruction!=0)&&(maxVerticalForce !=0))) {
-					/**
-					 * We have found, that it was not "Finish destruction"
-					 * Abnulling currentIterationAfterDestruction
-					 */
-					currentIterationAfterDestruction=0;
-				}
-			}
-			TranslationEngine::action();
-		} else if (curentDirection==backward) {							 ///<The press returns back to the normal position
-			if (currentIterationAfterDestruction > 0) {
-				currentIterationAfterDestruction--;
-				TranslationEngine::action();
-			} else {
-				curentDirection=stop;														///<If the press is in normal position -> STOP
-				Omega::instance().pause();					///<Stop simulation loop
-			}
-		}
-	}
-}
-
-CREATE_LOGGER(PressTestEngine);
-YADE_PLUGIN((PressTestEngine));
-

=== removed file 'pkg/common/PressTestEngine.hpp'
--- pkg/common/PressTestEngine.hpp	2010-12-21 12:19:50 +0000
+++ pkg/common/PressTestEngine.hpp	1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-
-#pragma once
-#include<yade/pkg/common/KinematicEngines.hpp>
-#include<yade/core/PartialEngine.hpp>
-
-class PressTestEngine: public TranslationEngine{
-	/**
-	 * This class simulates the simple press work
-	 * When the press "cracks" the solid brittle material,
-	 * it returns back to the initial position 
-	 * and stops the simulation loop.
-	 */ 
-	public:
-		enum motionDirection {forward, backward, stop};
-		motionDirection curentDirection;
-		Real currentVerticalForce, maxVerticalForce, minimalForce, minimalPredictedForce;
-		long int currentIterationAfterDestruction;
-		int pressVelocityForw2Back;
-		virtual ~PressTestEngine(){};
-		virtual void action();
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(PressTestEngine,TranslationEngine,"This class simulates the simple press work When the press cracks the solid brittle material, it returns back to the initial position and stops the simulation loop.",((long int,numberIterationAfterDestruction,0,,"The number of iterations, which will be carry out after destruction [-]"))
-		((Real,predictedForce,0,,"The minimal force, after what the engine will look for a destruction [N]"))
-		((long int,riseUpPressHigher,1,,"After destruction press rises up. This is the relationship between initial press velocity and velocity for going *back* [-]")),
-		curentDirection=forward;currentVerticalForce=0;maxVerticalForce=0;minimalForce=0;minimalPredictedForce=0;currentIterationAfterDestruction=0;pressVelocityForw2Back=25;
-	);
-	DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(PressTestEngine);

_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to