------------------------------------------------------------ revno: 2152 committer: Bruno Chareyre <bchare...@r1arduina> branch nick: trunk timestamp: Sun 2010-04-18 19:45:38 +0200 message: - Remove unused unregistered engine. removed: pkg/dem/Engine/PartialEngine/HydraulicForceEngine.cpp pkg/dem/Engine/PartialEngine/HydraulicForceEngine.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/dem/Engine/PartialEngine/HydraulicForceEngine.cpp' --- pkg/dem/Engine/PartialEngine/HydraulicForceEngine.cpp 2010-03-20 12:40:44 +0000 +++ pkg/dem/Engine/PartialEngine/HydraulicForceEngine.cpp 1970-01-01 00:00:00 +0000 @@ -1,176 +0,0 @@ -/************************************************************************* -* Copyright (C) 2004 by Andrea Cortis & Bruno Chareyre * -* [email protected], [email protected] * -* * -* 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 "HydraulicForceEngine.hpp" -#include <yade/core/Scene.hpp> -#include <yade/core/Body.hpp> -#include <yade/pkg-dem/CohesiveFrictionalMat.hpp> -#include <vector> -#include "HydraulicForceEngine.hpp" -#include <yade/pkg-dem/Shop.hpp> -#include<yade/pkg-common/Sphere.hpp> - -vector<Real> initialPositions; - -HydraulicForceEngine::HydraulicForceEngine() : gravity(Vector3r::ZERO), isActivated(true) -{ - dummyParameter = false; - HFinverted = false; - savePositions = 1; - outputFile = "positions.dat"; - inputFile = "forces.dat"; - HFinversion_counter = 1000; - forceFactor = 1; - - -} - - -HydraulicForceEngine::~HydraulicForceEngine() -{ -} - - - -void HydraulicForceEngine::action() -{ - - if (isActivated) - { - shared_ptr<BodyContainer>& bodies = scene->bodies; - - - ///This commented is to artificially remove eroded (i.e. bond-breaked) grains by applying a force moving them away -//cerr << "HFinverted " << HFinverted << " Omega::instance().getTimeStep() " << Omega::instance().getCurrentIteration() << endl; -// if (HFinversion_counter < (Omega::instance().getCurrentIteration() - 1500)) -// { -// //cerr << "HFinverted " << HFinverted << " HFinversion_counter " << HFinversion_counter << endl; -// HFinversion_counter = Omega::instance().getCurrentIteration(); -// HFinverted = !HFinverted; -// // initialPositions.clear(); -// // for (int i =0; i < initialPositions.size(); ++i) -// // { -// // initialPositions[i-6] = (static_cast<CohesiveFrictionalMat*> (b->physicalParameters.get()))->se3.position[1]; -// // -// // } -// -// -// } -// - - if (HFinverted) - { - BodyContainer::iterator bi = bodies->begin(); - BodyContainer::iterator biEnd = bodies->end(); - for ( ; bi!=biEnd ; ++bi ) - { - shared_ptr<Body> b = *bi; - if (b->shape && b->shape->getClassName()=="Sphere") - { - //cerr << "translate it" << endl; - if ((static_cast<CohesiveFrictionalMat*> (b->material.get()))->isBroken == true) - { - scene->forces.addForce(b->getId(),Vector3r(0,5,0)); - } - } - } - } - else - { - long Nspheres; - long id; - Real temp; - Real realID; - Real fx, fy, fz, mx, my, mz; - ifstream file (inputFile.c_str()); - ofstream ofile (outputFile.c_str()); - - //cerr << "r = " << R << endl; - //#define USELINENUMBERSFORID - if (file.is_open()) - { - file >> realID >> temp >> temp>> temp>> temp>> temp>> temp; - Nspheres = realID; - cerr << "Nspheres" << Nspheres << endl; - initialPositions.resize(Nspheres); - - for (long i=6; i<Nspheres+6; ++i) - { - file >> realID >> fx >> fy >> fz >> mx >> my >> mz; - id = realID; - #ifdef USELINENUMBERSFORID - id = i; - #endif - - - Vector3r f (fx,fy,fz); - Vector3r t (mx,my,mz); - f*=forceFactor; - t*=forceFactor; -// cerr << "f=" << f << " on " << id << endl; - //f /= -10000; - //t *= 0; - scene->forces.addForce(id,f); - scene->forces.addTorque(id,t); - } - file.close(); - } - else cerr << "problem opening the file with hydraulic forces" << endl; - - if (savePositions) - #ifdef USELINENUMBERSFORID - {Shop::saveSpheresToFile(outputFile.c_str()); savePositions = false;}//only once - #else - { - const shared_ptr<Scene>& rootBody=Omega::instance().getScene(); - ofstream f(outputFile.c_str()); - if(!f.good()) throw runtime_error("Unable to open file `"+outputFile+"'"); - FOREACH(shared_ptr<Body> b, *rootBody->bodies){ - if (!b->isDynamic) continue; - shared_ptr<Sphere> intSph=dynamic_pointer_cast<Sphere>(b->shape); - if(!intSph) continue; - const Vector3r& pos=b->state->pos; - f<< b->getId()<<" "<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<" "<<intSph->radius<<endl; // <<" "<<1<<" "<<1<<endl; - } - f.close(); - } - #endif - - } - -// BodyContainer::iterator bi = bodies->begin(); -// BodyContainer::iterator biEnd = bodies->end(); -// for ( ; bi!=biEnd ; ++bi ) -// { -// shared_ptr<Body> b = *bi; -// /* skip bodies that are within a clump; -// * even if they are marked isDynamic==false, forces applied to them are passed to the clump, which is dynamic; -// * and since clump is a body with mass equal to the sum of masses of its components, it would have gravity applied twice. -// * -// * The choice is to skip (b->isClumpMember()) or (b->isClump()). We rather skip members, -// * since that will apply smaller number of forces and (theoretically) improve numerical stability ;-) */ -// if (b->isClumpMember()) continue; -// -// // cerr << "particle id = "<< b->getId() << endl; -// // cout << "cout version" << endl; -// -// ParticleParameters* p = dynamic_cast<ParticleParameters*>(b->physicalParameters.get()); -// //if (p) -// // if (b->getId() == 67) -// // { -// // static_cast<Force*>( scene->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force += Vector3r((Real) -100000,(Real) 0,(Real) 0); -// // } -// //static_cast<Force*>( scene->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force += gravity * p->mass; -// } - } -} - -YADE_PLUGIN((HydraulicForceEngine)); - - - === removed file 'pkg/dem/Engine/PartialEngine/HydraulicForceEngine.hpp' --- pkg/dem/Engine/PartialEngine/HydraulicForceEngine.hpp 2010-03-20 12:40:44 +0000 +++ pkg/dem/Engine/PartialEngine/HydraulicForceEngine.hpp 1970-01-01 00:00:00 +0000 @@ -1,37 +0,0 @@ -/************************************************************************* -* Copyright (C) 2004 by Andrea Cortis & Bruno Chareyre * -* [email protected], [email protected] * -* * -* 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/PartialEngine.hpp> - -class HydraulicForceEngine : public PartialEngine -{ - public : - Vector3r gravity; - bool isActivated; - bool dummyParameter; - bool HFinverted; - bool savePositions; - string outputFile; - string inputFile; - int HFinversion_counter; - Real forceFactor; - - HydraulicForceEngine(); - virtual ~HydraulicForceEngine(); - virtual void action(); - - REGISTER_ATTRIBUTES(PartialEngine,(gravity)(isActivated)(dummyParameter)(HFinverted)(savePositions)(outputFile)(inputFile)(HFinversion_counter)(forceFactor)); - REGISTER_CLASS_NAME(HydraulicForceEngine); - REGISTER_BASE_CLASS_NAME(PartialEngine); -}; - -REGISTER_SERIALIZABLE(HydraulicForceEngine); - -
_______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

