← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2556: - Removed some testing code

 

------------------------------------------------------------
revno: 2556
committer: Emanuele Catalano <catalano@xxxxxxxxxxx
branch nick: yade
timestamp: Wed 2010-11-17 11:44:05 +0100
message:
  - Removed some testing code
  - Reorganized debuggin'
modified:
  lib/triangulation/FlowBoundingSphere.cpp
  lib/triangulation/FlowBoundingSphere.h
  lib/triangulation/Network.cpp
  lib/triangulation/Network.h
  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 'lib/triangulation/FlowBoundingSphere.cpp'
--- lib/triangulation/FlowBoundingSphere.cpp	2010-11-16 13:10:35 +0000
+++ lib/triangulation/FlowBoundingSphere.cpp	2010-11-17 10:44:05 +0000
@@ -169,7 +169,7 @@
 		cell->info().volume() = Volume_Pore(cell); totV+=cell->info().volume();
                 cell->info().dv() = 0;
         }
-        cerr << "TOTAL VOID VOLUME: "<<totV<<endl;
+        if(DEBUG_OUT) cerr << "TOTAL VOID VOLUME: "<<totV<<endl;
 
         clock.top("initializing delta_volumes");
 
@@ -213,8 +213,8 @@
         Dessine_Short_Tesselation(Vue1, Tes);
         Vue1.Affiche();
 #endif
-	if (SLIP_ON_LATERALS) cout << "SLIP CONDITION IS ACTIVATED" << endl;
-	else cout << "NOSLIP CONDITION IS ACTIVATED" << endl;
+	if (SLIP_ON_LATERALS && DEBUG_OUT) cout << "SLIP CONDITION IS ACTIVATED" << endl;
+	else if (DEBUG_OUT) cout << "NOSLIP CONDITION IS ACTIVATED" << endl;
 // }
   return Tes;
 }
@@ -402,9 +402,8 @@
          Vecteur TotalForce = nullVect;
          for (Finite_vertices_iterator v = Tri.finite_vertices_begin(); v != Tri.finite_vertices_end(); ++v) {
                  if (!v->info().isFictious) {
-// 			 if (DEBUG_OUT) cout << "id = " << v->info().id() << " force = " << v->info().forces << endl;
                          TotalForce = TotalForce + v->info().forces;
-//                          if (DEBUG_OUT) cout << "real_id = " << v->info().id() << " force = " << v->info().forces << endl;
+                         if (DEBUG_OUT) cout << "real_id = " << v->info().id() << " force = " << v->info().forces << endl;
                  } else {
                          if (boundary(v->info().id()).flowCondition==1) TotalForce = TotalForce + v->info().forces;
                          if (DEBUG_OUT) cout << "fictious_id = " << v->info().id() << " force = " << v->info().forces << endl;
@@ -469,13 +468,13 @@
 			for (int yy=0;yy<4;yy++) cell->vertex(yy)->info().forces = cell->vertex(yy)->info().forces + cell->info().unitForceVectors[yy]*cell->info().p();
 	noCache=false;//cache should always be defined after execution of this function
 	
-	cout << "Facet cached scheme" <<endl;
+	if(DEBUG_OUT) cout << "Facet cached scheme" <<endl;
 	Vecteur TotalForce = nullVect;
 	for (Finite_vertices_iterator v = Tri.finite_vertices_begin(); v != Tri.finite_vertices_end(); ++v)
 	{
 		if (!v->info().isFictious) {
 			TotalForce = TotalForce + v->info().forces;
-// 			if (DEBUG_OUT) cout << "real_id = " << v->info().id() << " force = " << v->info().forces << endl;
+			if (DEBUG_OUT) cout << "real_id = " << v->info().id() << " force = " << v->info().forces << endl;
 		} else {
 			if (boundary(v->info().id()).flowCondition==1) TotalForce = TotalForce + v->info().forces;
 			if (DEBUG_OUT) cout << "fictious_id = " << v->info().id() << " force = " << v->info().forces << endl;
@@ -756,10 +755,10 @@
                 cout << "Vtotalissimo = " << Vtotalissimo << " Vsolid_tot = " << Vsolid_tot << " Vporale2 = " << Vporale  << " Ssolid_tot = " << Ssolid_tot << endl<< endl;
         
         
-        if (!RAVERAGE) cout << "------Hydraulic Radius is used for permeability computation------" << endl << endl;
-        else cout << "------Average Radius is used for permeability computation------" << endl << endl;
+        if (!RAVERAGE && DEBUG_OUT) cout << "------Hydraulic Radius is used for permeability computation------" << endl << endl;
+        else if (DEBUG_OUT) cout << "------Average Radius is used for permeability computation------" << endl << endl;
 
-	cout << "-----Computed_Permeability-----" << endl;}
+	if (DEBUG_OUT) cout << "-----Computed_Permeability-----" << endl;}
 }
 
 double FlowBoundingSphere::Compute_EffectiveRadius(Cell_handle cell, int j)
@@ -910,8 +909,8 @@
                         //     save_vtk_file ( Tri );
                 }
         } while (((dp_max/p_max) > tolerance) /*&& ( dp_max > tolerance )*//* &&*/ /*( j<50 )*/);
-        cout << "pmax " << p_max << "; pmoy : " << p_moy << endl;
-        cout << "iteration " << j <<"; erreur : " << dp_max/p_max << endl;
+        if (DEBUG_OUT) {cout << "pmax " << p_max << "; pmoy : " << p_moy << endl;
+        cout << "iteration " << j <<"; erreur : " << dp_max/p_max << endl;}
 // 	iter << j << " " << dp_max/p_max << endl;
 	
 	int cel=0;
@@ -992,8 +991,8 @@
         cout << "The outgoing average flow rate is = " << Q1 << " m^3/s " << endl;
         cout << "The gradient of charge is = " << GradH << " [-]" << endl;
         cout << "Darcy's velocity is = " << Vdarcy << " m/s" <<endl;
-        cout << "The hydraulic conductivity of the sample is = " << Ks << " m/s" <<endl;
-        cout << "The permeability of the sample is = " << k << " m^2" <<endl;
+        
+        cout << "The permeability of the sample is = " << k << " m^2" <<endl;}
         
 	kFile << "the maximum superior pressure is = " << p_in_max << " the min is = " << p_in_min << endl;
         kFile << "the maximum inferior pressure is = " << p_out_max << " the min is = " << p_out_min << endl;
@@ -1006,12 +1005,54 @@
         kFile << "The gradient of charge is = " << GradH << " [-]" << endl;
         kFile << "Darcy's velocity is = " << Vdarcy << " m/s" <<endl;
         kFile << "The hydraulic conductivity of the sample is = " << Ks << " m/s" <<endl;
-        kFile << "The permeability of the sample is = " << k << " m^2" <<endl;}
+        kFile << "The permeability of the sample is = " << k << " m^2" <<endl;
         //   cout << "The Darcy permeability of the sample is = " << k_darcy/0.987e-12 << " darcys" << endl;
-	
+	cout << endl << "The hydraulic conductivity of the sample is = " << Ks << " m/s" << endl << endl;
 	return Ks;
 }
 
+void FlowBoundingSphere::DisplayStatistics()
+{
+	RTriangulation& Tri = T[currentTes].Triangulation();
+        int Zero =0, Inside=0, Fictious=0;
+        Finite_cells_iterator cell_end = Tri.finite_cells_end();
+        for (Finite_cells_iterator cell = Tri.finite_cells_begin(); cell != cell_end; cell++) {
+                int zeros =0;
+                for (int j=0; j!=4; j++) {
+                        if ((cell->info().k_norm())[j]==0) {
+                                zeros+=1;
+                        }
+                }
+                if (zeros==4) {
+                        Zero+=1;
+                }
+                if (!cell->info().fictious()) {
+                        Inside+=1;
+                } else {
+                        Fictious+=1;
+                }
+        }
+        cout << "zeros = " << Zero << endl;
+        int fict=0, real=0;
+        for (Finite_vertices_iterator v = Tri.finite_vertices_begin(); v != Tri.finite_vertices_end(); ++v) {
+                if (v->info().isFictious) fict+=1;
+                else real+=1;
+        }
+        long Vertices = Tri.number_of_vertices();
+	long Cells = Tri.number_of_finite_cells();
+	long Facets = Tri.number_of_finite_facets();
+        if(DEBUG_OUT) {cout << "zeros = " << Zero << endl;
+	cout << "There are " << Vertices << " vertices, dont " << fict << " fictious et " << real << " reeeeeel" << std::endl;
+        cout << "There are " << Cells << " cells " << std::endl;
+        cout << "There are " << Facets << " facets " << std::endl;
+        cout << "There are " << Inside << " cells INSIDE." << endl;
+        cout << "There are " << Fictious << " cells FICTIOUS." << endl;}
+	
+	vtk_infinite_vertices = fict;
+	vtk_infinite_cells = Fictious;
+	num_particles = real;
+}
+
 void FlowBoundingSphere::save_vtk_file()
 {
   RTriangulation& Tri = T[currentTes].Triangulation();

=== modified file 'lib/triangulation/FlowBoundingSphere.h'
--- lib/triangulation/FlowBoundingSphere.h	2010-11-16 13:10:35 +0000
+++ lib/triangulation/FlowBoundingSphere.h	2010-11-17 10:44:05 +0000
@@ -87,7 +87,7 @@
 // 		Vecteur external_force_single_fictious ( Cell_handle cell );
 		void SpheresFileCreator ();
 // 		void Analytical_Consolidation ( );
-		
+		void DisplayStatistics();
 // 		void Boundary_Conditions ( RTriangulation& Tri );
 		void Initialize_pressures ( double P_zero );
 		/// Define forces using the same averaging volumes as for permeability

=== modified file 'lib/triangulation/Network.cpp'
--- lib/triangulation/Network.cpp	2010-11-16 13:10:35 +0000
+++ lib/triangulation/Network.cpp	2010-11-17 10:44:05 +0000
@@ -495,7 +495,7 @@
         boundaries[z_min_id-id_offset].coordinate = 2;
         if(DEBUG_OUT) cout << "Front boundary has been created. ID = " << z_min_id << endl;
 
-        Tes.insert(0.5*(Corner_min.x() +Corner_max.x()), 0.5*(Corner_max.y()-Corner_min.y()), Corner_max.z() +FAR*(Corner_max.y()-Corner_min.y()), FAR*(Corner_max.y()-Corner_min.y()), z_max_id, true);
+        Tes.insert(0.5*(Corner_min.x() +Corner_max.x()), 0.5*(Corner_max.y()+Corner_min.y()), Corner_max.z() +FAR*(Corner_max.y()-Corner_min.y()), FAR*(Corner_max.y()-Corner_min.y()), z_max_id, true);
         boundaries[z_max_id-id_offset].p = Corner_max;
         boundaries[z_max_id-id_offset].normal = Vecteur(0,0,-1);
         boundaries[z_max_id-id_offset].coordinate = 2;
@@ -529,47 +529,6 @@
 	}
 }
 
-void Network::DisplayStatistics()
-{
-	RTriangulation& Tri = T[currentTes].Triangulation();
-        int Zero =0, Inside=0, Fictious=0;
-        Finite_cells_iterator cell_end = Tri.finite_cells_end();
-        for (Finite_cells_iterator cell = Tri.finite_cells_begin(); cell != cell_end; cell++) {
-                int zeros =0;
-                for (int j=0; j!=4; j++) {
-                        if ((cell->info().k_norm())[j]==0) {
-                                zeros+=1;
-                        }
-                }
-                if (zeros==4) {
-                        Zero+=1;
-                }
-                if (!cell->info().fictious()) {
-                        Inside+=1;
-                } else {
-                        Fictious+=1;
-                }
-        }
-        cout << "zeros = " << Zero << endl;
-        int fict=0, real=0;
-        for (Finite_vertices_iterator v = Tri.finite_vertices_begin(); v != Tri.finite_vertices_end(); ++v) {
-                if (v->info().isFictious) fict+=1;
-                else real+=1;
-        }
-        long Vertices = Tri.number_of_vertices();
-        cout << "There are " << Vertices << " vertices, dont " << fict << " fictious et " << real << " reeeeeel" << std::endl;
-        long Cells = Tri.number_of_finite_cells();
-        cout << "There are " << Cells << " cells " << std::endl;
-        long Facets = Tri.number_of_finite_facets();
-        cout << "There are " << Facets << " facets " << std::endl;
-        cout << "There are " << Inside << " cells INSIDE." << endl;
-        cout << "There are " << Fictious << " cells FICTIOUS." << endl;
-	
-	vtk_infinite_vertices = fict;
-	vtk_infinite_cells = Fictious;
-	num_particles = real;
-}
-
 // double Network::spherical_triangle_area ( Sphere STA1, Sphere STA2, Sphere STA3, Point PTA1 )
 // {
 //  double rayon = STA1.weight();

=== modified file 'lib/triangulation/Network.h'
--- lib/triangulation/Network.h	2010-11-16 13:10:35 +0000
+++ lib/triangulation/Network.h	2010-11-17 10:44:05 +0000
@@ -56,7 +56,7 @@
 		int fictious_vertex;
 // 		bool facet_detected;
 		
-		void DisplayStatistics();
+// 		void DisplayStatistics();
 		void AddBoundingPlanes(bool yade);
 		void AddBoundingPlanes();
 		void Define_fictious_cells( );

=== modified file 'pkg/dem/FlowEngine.cpp'
--- pkg/dem/FlowEngine.cpp	2010-11-16 13:10:35 +0000
+++ pkg/dem/FlowEngine.cpp	2010-11-17 10:44:05 +0000
@@ -52,10 +52,8 @@
       
 			timingDeltas->checkpoint("Triangulating");
 			
-			eps_vol_max=0.f;
-			std::ofstream eps_vol ("Epsilon_volume.txt", std::ios::app);		
+			eps_vol_max=0.f;	
 			UpdateVolumes ( );
-			eps_vol << eps_vol_max << endl;
 			Eps_Vol_Cumulative += eps_vol_max;
 			if (Eps_Vol_Cumulative > ReTrg*EpsVolPercent_RTRG) {Update_Triangulation = true; ReTrg++;}
 			

=== modified file 'pkg/dem/FlowEngine.hpp'
--- pkg/dem/FlowEngine.hpp	2010-11-16 13:10:35 +0000
+++ pkg/dem/FlowEngine.hpp	2010-11-17 10:44:05 +0000
@@ -28,7 +28,6 @@
 		bool currentTes;
 		int id_offset;
 	//	double IS;
-		double eps_vol_max;
 		double Eps_Vol_Cumulative;
 		int ReTrg;
 			
@@ -68,7 +67,8 @@
 					((double,Tolerance,1e-06,,"Gauss-Seidel Tolerance"))
 					((double,Relax,1.9,,"Gauss-Seidel relaxation"))
 					((int,PermuteInterval,100000,,"Pore space re-triangulation period"))
-					((double,EpsVolPercent_RTRG,0.01,,"Percentuage of cumulate eps_vol at which retriangulation of pore space is performed"))
+					((double, eps_vol_max, 0,,"Maximal absolute volumetric strain computed at each iteration"))
+					((double, EpsVolPercent_RTRG,0.01,,"Percentuage of cumulate eps_vol at which retriangulation of pore space is performed"))
 					((bool,compute_K,true,,"Activates permeability measure within a granular sample"))
 					((bool,meanK_correction,true,,"Local permeabilities' correction through meanK threshold"))
 					((bool,meanK_opt,false,,"Local permeabilities' correction through an optimized threshold"))