← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4009: Fix https://bugs.launchpad.net/yade/+bug/1666339 (thx Robert)

 

------------------------------------------------------------
revno: 4009
author: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
committer: GitHub <noreply@xxxxxxxxxx>
timestamp: Tue 2017-03-07 18:06:18 +0100
message:
  Fix https://bugs.launchpad.net/yade/+bug/1666339 (thx Robert)
modified:
  pkg/pfv/DFNFlow.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 'pkg/pfv/DFNFlow.cpp'
--- pkg/pfv/DFNFlow.cpp	2014-11-17 14:04:32 +0000
+++ pkg/pfv/DFNFlow.cpp	2017-03-07 17:06:18 +0000
@@ -170,11 +170,12 @@
 
 void DFNFlowEngine::trickPermeability(RTriangulation::Facet_circulator& facet, Real aperture, Real residualAperture)
 {
+	const RTriangulation::Facet& currentFacet = *facet; // seems verbose but facet->first was declaring a junk cell and crashing program (https://bugs.launchpad.net/yade/+bug/1666339)
 	const RTriangulation& Tri = solver->T[solver->currentTes].Triangulation();
-	const CellHandle& cell1 = facet->first;
-	const CellHandle& cell2 = facet->first->neighbor(facet->second);
+	const CellHandle& cell1 = currentFacet.first;
+	const CellHandle& cell2 = currentFacet.first->neighbor(facet->second);
 	if ( Tri.is_infinite(cell1) || Tri.is_infinite(cell2)) cerr<<"Infinite cell found in trickPermeability, should be handled somehow, maybe"<<endl;
-	cell1->info().kNorm()[facet->second]=cell2->info().kNorm()[Tri.mirror_index(cell1, facet->second)] = pow((aperture+residualAperture),3)/(12*viscosity);
+	cell1->info().kNorm()[currentFacet.second]=cell2->info().kNorm()[Tri.mirror_index(cell1, currentFacet.second)] = pow((aperture+residualAperture),3)/(12*viscosity);
 	//For vtk recorder:
 	cell1->info().crack= 1;
 	cell2->info().crack= 1;