yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07358
[Branch ~yade-dev/yade/trunk] Rev 2793: - Add functions for constrictions sizes statistics.
------------------------------------------------------------
revno: 2793
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: yade
timestamp: Tue 2011-03-22 19:32:04 +0100
message:
- Add functions for constrictions sizes statistics.
- Remove a few compile warnings.
modified:
lib/triangulation/FlowBoundingSphere.cpp
lib/triangulation/FlowBoundingSphere.hpp
lib/triangulation/Network.cpp
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 2011-02-25 19:11:02 +0000
+++ lib/triangulation/FlowBoundingSphere.cpp 2011-03-22 18:32:04 +0000
@@ -210,7 +210,7 @@
clock.top("GaussSeidel");
/** END GAUSS SEIDEL */
- char* file ("Permeability");
+ char* file ="Permeability";
ks = Permeameter(boundary(y_min_id).value, boundary(y_max_id).value, SectionArea, Height, file);
// K_sigma << K_opt_factor << " " << ks << " "<< Iterations << endl;
clock.top("Permeameter");
@@ -809,6 +809,15 @@
cout << "-----Computed_Permeability-----" << endl;}
}
+vector<double> FlowBoundingSphere::getConstrictions()
+{
+ RTriangulation& Tri = T[currentTes].Triangulation();
+ vector<double> constrictions;
+ for (Finite_facets_iterator f_it=Tri.finite_facets_begin(); f_it != Tri.finite_facets_end();f_it++)
+ constrictions.push_back(Compute_EffectiveRadius(f_it->first, f_it->second));
+ return constrictions;
+}
+
double FlowBoundingSphere::Compute_EffectiveRadius(Cell_handle cell, int j)
{
RTriangulation& Tri = T[currentTes].Triangulation();
=== modified file 'lib/triangulation/FlowBoundingSphere.hpp'
--- lib/triangulation/FlowBoundingSphere.hpp 2011-02-25 19:11:02 +0000
+++ lib/triangulation/FlowBoundingSphere.hpp 2011-03-22 18:32:04 +0000
@@ -96,6 +96,8 @@
double dotProduct ( Vecteur x, Vecteur y );
double Compute_EffectiveRadius(Cell_handle cell, int j);
double Compute_EquivalentRadius(Cell_handle cell, int j);
+ //return the list of constriction values
+ vector<double> getConstrictions();
void GenerateVoxelFile ( );
=== modified file 'lib/triangulation/Network.cpp'
--- lib/triangulation/Network.cpp 2010-11-25 14:22:43 +0000
+++ lib/triangulation/Network.cpp 2011-03-22 18:32:04 +0000
@@ -93,7 +93,8 @@
/**Vpore**/ return Vtot - (Vsolid1 + Vsolid2);
}; break;
case (1) : {return volume_single_fictious_pore(cell->vertex(facetVertices[j][facetF1]), cell->vertex(facetVertices[j][facetRe1]), cell->vertex(facetVertices[j][facetRe2]), p1,p2, cell->info().facetSurfaces[j]);}; break;
- case (2) : {return volume_double_fictious_pore(cell->vertex(facetVertices[j][facetF1]), cell->vertex(facetVertices[j][facetF2]), cell->vertex(facetVertices[j][facetRe1]), p1,p2, cell->info().facetSurfaces[j]);}; break;}
+ case (2) : {return volume_double_fictious_pore(cell->vertex(facetVertices[j][facetF1]), cell->vertex(facetVertices[j][facetF2]), cell->vertex(facetVertices[j][facetRe1]), p1,p2, cell->info().facetSurfaces[j]);}; break;
+ default : return 0;}
}
double Network::volume_single_fictious_pore(const Vertex_handle& SV1, const Vertex_handle& SV2, const Vertex_handle& SV3, const Point& PV1, const Point& PV2, Vecteur& facetSurface)
=== modified file 'pkg/dem/FlowEngine.cpp'
--- pkg/dem/FlowEngine.cpp 2011-02-25 20:42:33 +0000
+++ pkg/dem/FlowEngine.cpp 2011-03-22 18:32:04 +0000
@@ -120,7 +120,7 @@
char *f = "slifile";
flow->SliceField(f);
}
- if (save_vtk) {flow->save_vtk_file();}
+// if (save_vtk) {flow->save_vtk_file();}
}
// if ( scene->iter % PermuteInterval == 0 )
// { Update_Triangulation = true; }
=== modified file 'pkg/dem/FlowEngine.hpp'
--- pkg/dem/FlowEngine.hpp 2011-02-25 20:42:33 +0000
+++ pkg/dem/FlowEngine.hpp 2011-03-22 18:32:04 +0000
@@ -52,6 +52,9 @@
void clearImposedPressure();
Real getFlux(int cond);
void saveVtk() {flow->save_vtk_file();}
+ python::list getConstrictions() {
+ vector<Real> csd=flow->getConstrictions(); python::list pycsd;
+ for (unsigned int k=0;k<csd.size();k++) pycsd.append(csd[k]); return pycsd;}
virtual ~FlowEngine();
@@ -60,7 +63,7 @@
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(FlowEngine,PartialEngine,"An engine to solve flow problem in saturated granular media",
((bool,isActivated,true,,"Activates Flow Engine"))
((bool,first,true,,"Controls the initialization/update phases"))
- ((bool,save_vtk,false,,"Enable/disable vtk files creation for visualization"))
+// ((bool,save_vtk,false,,"Enable/disable vtk files creation for visualization"))
((bool,save_mplot,false,,"Enable/disable mplot files creation"))
((bool, save_mgpost, false,,"Enable/disable mgpost file creation"))
((bool, slice_pressures, false, ,"Enable/Disable slice pressure measurement"))
@@ -121,6 +124,7 @@
.def("imposePressure",&FlowEngine::imposePressure,(python::arg("pos"),python::arg("p")),"Impose pressure in cell of location 'pos'.")
.def("clearImposedPressure",&FlowEngine::clearImposedPressure,"Clear the list of points with pressure imposed.")
.def("getFlux",&FlowEngine::getFlux,(python::arg("cond")),"Get influx in cell associated to an imposed P (indexed using 'cond').")
+ .def("getConstrictions",&FlowEngine::getConstrictions,"Get the list of constrictions (inscribed circle) for all finite facets.")
.def("saveVtk",&FlowEngine::saveVtk,"Save pressure field in vtk format.")
)
DECLARE_LOGGER;