yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10236
[Branch ~yade-pkg/yade/git-trunk] Rev 3760: give unique identifiers to trangulation's cells
------------------------------------------------------------
revno: 3760
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
timestamp: Thu 2013-11-21 02:28:17 +0100
message:
give unique identifiers to trangulation's cells
modified:
lib/triangulation/FlowBoundingSphere.ipp
lib/triangulation/PeriodicFlow.cpp
lib/triangulation/def_types.h
pkg/dem/FlowEngine.cpp
--
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 'lib/triangulation/FlowBoundingSphere.ipp'
--- lib/triangulation/FlowBoundingSphere.ipp 2013-07-26 18:16:04 +0000
+++ lib/triangulation/FlowBoundingSphere.ipp 2013-11-21 01:28:17 +0000
@@ -416,7 +416,7 @@
if (noCache) {cerr<<"Triangulation does not exist. Waht did you do?!"<<endl; return -1;}
RTriangulation& Tri = T[noCache?(!currentTes):currentTes].Triangulation();
Cell_handle cell = Tri.locate(Point(X,Y,Z));
- return cell->info().index;
+ return cell->info().id;
}
template <class Tesselation>
@@ -485,7 +485,6 @@
void FlowBoundingSphere<Tesselation>::ComputeFacetForcesWithCache(bool onlyCache)
{
RTriangulation& Tri = T[currentTes].Triangulation();
- Finite_cells_iterator cell_end = Tri.finite_cells_end();
Vecteur nullVect(0,0,0);
//reset forces
if (!onlyCache) for (Finite_vertices_iterator v = Tri.finite_vertices_begin(); v != Tri.finite_vertices_end(); ++v) v->info().forces=nullVect;
=== modified file 'lib/triangulation/PeriodicFlow.cpp'
--- lib/triangulation/PeriodicFlow.cpp 2013-05-03 16:45:52 +0000
+++ lib/triangulation/PeriodicFlow.cpp 2013-11-21 01:28:17 +0000
@@ -47,7 +47,6 @@
void PeriodicFlow::ComputeFacetForcesWithCache(bool onlyCache)
{
RTriangulation& Tri = T[currentTes].Triangulation();
- Finite_cells_iterator cell_end = Tri.finite_cells_end();
Vecteur nullVect(0,0,0);
static vector<Vecteur> oldForces;
if (oldForces.size()<=Tri.number_of_vertices()) oldForces.resize(Tri.number_of_vertices()+1);
=== modified file 'lib/triangulation/def_types.h'
--- lib/triangulation/def_types.h 2013-08-22 14:32:01 +0000
+++ lib/triangulation/def_types.h 2013-11-21 01:28:17 +0000
@@ -44,6 +44,9 @@
class SimpleCellInfo : public Point {
public:
+ //"id": unique identifier of each cell, independant of other numberings used in the fluid types.
+ // Care to initialize it, there is no magic numbering to rely on
+ unsigned int id;
Real s;
bool isFictious;
SimpleCellInfo (void) {isFictious=false; s=0;}
=== modified file 'pkg/dem/FlowEngine.cpp'
--- pkg/dem/FlowEngine.cpp 2013-10-25 07:27:55 +0000
+++ pkg/dem/FlowEngine.cpp 2013-11-21 01:28:17 +0000
@@ -265,8 +265,10 @@
flow->T[flow->currentTes].cellHandles.clear();
flow->T[flow->currentTes].cellHandles.reserve(flow->T[flow->currentTes].Triangulation().number_of_finite_cells());
Finite_cells_iterator cell_end = flow->T[flow->currentTes].Triangulation().finite_cells_end();
- for ( Finite_cells_iterator cell = flow->T[flow->currentTes].Triangulation().finite_cells_begin(); cell != cell_end; cell++ )
+ int k=0;
+ for ( Finite_cells_iterator cell = flow->T[flow->currentTes].Triangulation().finite_cells_begin(); cell != cell_end; cell++ ){
flow->T[flow->currentTes].cellHandles.push_back(cell);
+ cell->info().id=k++;}//define unique numbering now, corresponds to position in cellHandles
flow->DisplayStatistics ();
flow->Compute_Permeability();
porosity = flow->V_porale_porosity/flow->V_totale_porosity;