← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3402: add temp test func.

 

------------------------------------------------------------
revno: 3402
committer: Chao Yuan <chaoyuan2012@xxxxxxxxx>
timestamp: Wed 2014-02-05 20:13:23 +0100
message:
  add temp test func.
modified:
  pkg/dem/UnsaturatedEngine.cpp
  pkg/dem/UnsaturatedEngine.hpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/dem/UnsaturatedEngine.cpp'
--- pkg/dem/UnsaturatedEngine.cpp	2014-02-05 18:32:13 +0000
+++ pkg/dem/UnsaturatedEngine.cpp	2014-02-05 19:13:23 +0000
@@ -51,7 +51,7 @@
 		updateVolumeCapillaryCell(solver);//save capillary volume of all cells, for calculating saturation
 		computeSolidLine(solver);//save cell->info().solidLine[j][y]
 	}
-	solver->noCache = false;
+	solver->noCache = true;
 }
 
 void UnsaturatedEngine::action()
@@ -147,16 +147,8 @@
 template<class Solver>
 void UnsaturatedEngine::invade2 (Solver& flow)
 {
-//     BoundaryConditions(flow);
-//     flow->pressureChanged=true;
-//     flow->reApplyBoundaryConditions();
     updateReservoir(flow);
     RTriangulation& tri = flow->T[flow->currentTes].Triangulation();
-//     Finite_cells_iterator cell_end = tri.finite_cells_end();
-//     for ( Finite_cells_iterator cell = tri.finite_cells_begin(); cell != cell_end; cell++ ) {
-//         if (cell->info().isAirReservoir == true)
-//             cell->info().p() = bndCondValue[2];
-//     }
     Finite_cells_iterator _cell_end = tri.finite_cells_end();
     for ( Finite_cells_iterator _cell = tri.finite_cells_begin(); _cell != _cell_end; _cell++ ) {
         if(_cell->info().isAirReservoir == true)
@@ -1367,6 +1359,20 @@
     file.close();
 }
 
+template<class Solver>
+void UnsaturatedEngine::testReservoirAttr(Solver& flow)
+{
+    ofstream file;
+    file.open("reservoir.txt");
+    file << "cellID	isWaterReservoir	isAirReservoir \n";
+    RTriangulation& Tri = flow->T[solver->currentTes].Triangulation();
+    Finite_cells_iterator cell_end = Tri.finite_cells_end();
+    for (Finite_cells_iterator cell = Tri.finite_cells_begin(); cell != cell_end; cell++) {
+      file<<cell->info().index<<"	"<<cell->info().isWaterReservoir<<"	"<<cell->info().isAirReservoir<<endl;
+    }
+    file.close();  
+}
+
 YADE_PLUGIN ( ( UnsaturatedEngine ) );
 
 #endif //FLOW_ENGINE

=== modified file 'pkg/dem/UnsaturatedEngine.hpp'
--- pkg/dem/UnsaturatedEngine.hpp	2014-02-05 18:23:19 +0000
+++ pkg/dem/UnsaturatedEngine.hpp	2014-02-05 19:13:23 +0000
@@ -94,6 +94,7 @@
 		TPL void testSolidLine(Solver& flow);
 		TPL void computeSolidLine(Solver& flow);
 		TPL void computeFacetPoreForcesWithCache(Solver& flow, bool onlyCache=false);
+		TPL void testReservoirAttr(Solver& flow);
 		
 		TPL Vector3r fluidForce(unsigned int id_sph, Solver& flow) {
 			const CGT::Vecteur& f=flow->T[flow->currentTes].vertex(id_sph)->info().forces; return Vector3r(f[0],f[1],f[2]);}
@@ -158,6 +159,7 @@
  		void		_testSolidLine(){testSolidLine(solver);}
 		Vector3r 	_fluidForce(unsigned int id_sph) {return fluidForce(id_sph,solver);}
 		bool		_testNoCache() {return testNoCache(solver);}
+		void		_testReservoir() {return testReservoirAttr(solver);}
 		
 		virtual ~UnsaturatedEngine();
 
@@ -232,6 +234,7 @@
 					.def("testSolidLine",&UnsaturatedEngine::_testSolidLine,"For checking solidLine.")
 					.def("fluidForce",&UnsaturatedEngine::_fluidForce,(python::arg("Id_sph")),"Return the fluid force on sphere Id_sph.")
 					.def("testNoCache",&UnsaturatedEngine::_testNoCache, "test noCache.")
+					.def("testReservoirAttr",&UnsaturatedEngine::_testReservoir, "test reservoir attributes.")
 					)
 		DECLARE_LOGGER;
 };