← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 3039: - Periodic::applyViscousForces() removed with Donia

 

------------------------------------------------------------
revno: 3039
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2012-03-06 20:22:30 +0100
message:
  - Periodic::applyViscousForces() removed with Donia
modified:
  pkg/dem/FlowEngine.cpp
  pkg/dem/FlowEngine.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/FlowEngine.cpp'
--- pkg/dem/FlowEngine.cpp	2012-03-06 11:49:48 +0000
+++ pkg/dem/FlowEngine.cpp	2012-03-06 19:22:30 +0000
@@ -605,7 +605,7 @@
 
         ///Application of vicscous forces
         scene->forces.sync();
-        if ( viscousShear ) ApplyViscousForces();
+        if ( viscousShear ) ApplyViscousForces(solver);
 
         Finite_vertices_iterator vertices_end = solver->T[solver->currentTes].Triangulation().finite_vertices_end();
         for ( Finite_vertices_iterator V_it = solver->T[solver->currentTes].Triangulation().finite_vertices_begin(); V_it !=  vertices_end; V_it++ ) {
@@ -711,44 +711,44 @@
 
 
 
-void PeriodicFlowEngine::ApplyViscousForces()
-{
-//   flow->ComputeEdgesSurfaces(); //only done in buildTriangulation
-        if ( Debug ) cout << "Application of viscous forces" << endl;
-        if ( Debug ) cout << "Number of edges = " << solver->Edge_ids.size() << endl;
-        for ( unsigned int k=0; k<solver->viscousShearForces.size(); k++ ) solver->viscousShearForces[k]=Vector3r::Zero();
-
-        const Tesselation& Tes = solver->T[solver->currentTes];
-        for ( int i=0; i< ( int ) solver->Edge_ids.size(); i++ ) {
-                int hasFictious= Tes.vertex ( solver->Edge_ids[i].first )->info().isFictious +  Tes.vertex ( solver->Edge_ids[i].second )->info().isFictious;
-                const shared_ptr<Body>& sph1 = Body::byId ( solver->Edge_ids[i].first, scene );
-                const shared_ptr<Body>& sph2 = Body::byId ( solver->Edge_ids[i].second, scene );
-                Vector3r deltaV;
-                if ( !hasFictious )
-                        deltaV = ( sph2->state->vel - sph1->state->vel );
-                else {
-                        if ( hasFictious==1 ) {//for the fictious sphere, use velocity of the boundary, not of the body
-                                Vector3r v1 = ( Tes.vertex ( solver->Edge_ids[i].first )->info().isFictious ) ? solver->boundary ( solver->Edge_ids[i].first ).velocity:sph1->state->vel;
-                                Vector3r v2 = ( Tes.vertex ( solver->Edge_ids[i].second )->info().isFictious ) ? solver->boundary ( solver->Edge_ids[i].second ).velocity:sph2->state->vel;
-                                deltaV = v2-v1;
-                        } else {//both fictious, ignore
-                                deltaV = Vector3r::Zero();
-                        }
-                }
-                deltaV = deltaV - ( solver->Edge_normal[i].dot ( deltaV ) ) *solver->Edge_normal[i];
-                Vector3r visc_f = solver->ComputeViscousForce ( deltaV, i );
-                if ( Debug ) cout << "la force visqueuse entre " << solver->Edge_ids[i].first << " et " << solver->Edge_ids[i].second << "est " << visc_f << endl;
-///    //(1) directement sur le body Yade...
-//     scene->forces.addForce(flow->Edge_ids[i].first,visc_f);
-//     scene->forces.addForce(flow->Edge_ids[i].second,-visc_f);
-///   //(2) ou dans CGAL? On a le choix (on pourrait même avoir info->viscousF pour faire la différence entre les deux types de forces... mais ça prend un peu plus de mémoire et de temps de calcul)
-//     Tes.vertex(flow->Edge_ids[i].first)->info().forces=Tes.vertex(flow->Edge_ids[i].first)->info().forces+makeCgVect(visc_f);
-//     Tes.vertex(flow->Edge_ids[i].second)->info().forces=Tes.vertex(flow->Edge_ids[i].second)->info().forces+makeCgVect(visc_f);
-/// //(3) ou dans un vecteur séparé (rapide)
-                solver->viscousShearForces[solver->Edge_ids[i].first]+=visc_f;
-                solver->viscousShearForces[solver->Edge_ids[i].second]-=visc_f;
-        }
-}
+// void PeriodicFlowEngine::ApplyViscousForces()
+// {
+// //   flow->ComputeEdgesSurfaces(); //only done in buildTriangulation
+//         if ( Debug ) cout << "Application of viscous forces" << endl;
+//         if ( Debug ) cout << "Number of edges = " << solver->Edge_ids.size() << endl;
+//         for ( unsigned int k=0; k<solver->viscousShearForces.size(); k++ ) solver->viscousShearForces[k]=Vector3r::Zero();
+// 
+//         const Tesselation& Tes = solver->T[solver->currentTes];
+//         for ( int i=0; i< ( int ) solver->Edge_ids.size(); i++ ) {
+//                 int hasFictious= Tes.vertex ( solver->Edge_ids[i].first )->info().isFictious +  Tes.vertex ( solver->Edge_ids[i].second )->info().isFictious;
+//                 const shared_ptr<Body>& sph1 = Body::byId ( solver->Edge_ids[i].first, scene );
+//                 const shared_ptr<Body>& sph2 = Body::byId ( solver->Edge_ids[i].second, scene );
+//                 Vector3r deltaV;
+//                 if ( !hasFictious )
+//                         deltaV = ( sph2->state->vel - sph1->state->vel );
+//                 else {
+//                         if ( hasFictious==1 ) {//for the fictious sphere, use velocity of the boundary, not of the body
+//                                 Vector3r v1 = ( Tes.vertex ( solver->Edge_ids[i].first )->info().isFictious ) ? solver->boundary ( solver->Edge_ids[i].first ).velocity:sph1->state->vel;
+//                                 Vector3r v2 = ( Tes.vertex ( solver->Edge_ids[i].second )->info().isFictious ) ? solver->boundary ( solver->Edge_ids[i].second ).velocity:sph2->state->vel;
+//                                 deltaV = v2-v1;
+//                         } else {//both fictious, ignore
+//                                 deltaV = Vector3r::Zero();
+//                         }
+//                 }
+//                 deltaV = deltaV - ( solver->Edge_normal[i].dot ( deltaV ) ) *solver->Edge_normal[i];
+//                 Vector3r visc_f = solver->ComputeViscousForce ( deltaV, i );
+//                 if ( Debug ) cout << "la force visqueuse entre " << solver->Edge_ids[i].first << " et " << solver->Edge_ids[i].second << "est " << visc_f << endl;
+// ///    //(1) directement sur le body Yade...
+// //     scene->forces.addForce(flow->Edge_ids[i].first,visc_f);
+// //     scene->forces.addForce(flow->Edge_ids[i].second,-visc_f);
+// ///   //(2) ou dans CGAL? On a le choix (on pourrait même avoir info->viscousF pour faire la différence entre les deux types de forces... mais ça prend un peu plus de mémoire et de temps de calcul)
+// //     Tes.vertex(flow->Edge_ids[i].first)->info().forces=Tes.vertex(flow->Edge_ids[i].first)->info().forces+makeCgVect(visc_f);
+// //     Tes.vertex(flow->Edge_ids[i].second)->info().forces=Tes.vertex(flow->Edge_ids[i].second)->info().forces+makeCgVect(visc_f);
+// /// //(3) ou dans un vecteur séparé (rapide)
+//                 solver->viscousShearForces[solver->Edge_ids[i].first]+=visc_f;
+//                 solver->viscousShearForces[solver->Edge_ids[i].second]-=visc_f;
+//         }
+// }
 
 void PeriodicFlowEngine::locateCell ( Cell_handle baseCell, unsigned int& index, unsigned int count)
 {

=== modified file 'pkg/dem/FlowEngine.hpp'
--- pkg/dem/FlowEngine.hpp	2012-02-29 12:46:28 +0000
+++ pkg/dem/FlowEngine.hpp	2012-03-06 19:22:30 +0000
@@ -239,7 +239,7 @@
 		void UpdateVolumes ();
 		Real Volume_cell (Cell_handle cell);
 		Real Volume_cell_single_fictious (Cell_handle cell);
-		void ApplyViscousForces();
+// 		void ApplyViscousForces();
 		inline void locateCell(Cell_handle baseCell, unsigned int& index, unsigned int count=0);
 		Vector3r MeanVelocity();