diff --git a/analysis/morphology.cpp b/analysis/morphology.cpp index 7bcedfce..9940c402 100644 --- a/analysis/morphology.cpp +++ b/analysis/morphology.cpp @@ -139,11 +139,13 @@ double MorphOpen(DoubleArray &SignDist, signed char *id, std::shared_ptr double GlobalNumber = 1.f; int imin,jmin,kmin,imax,jmax,kmax; + if (ErodeLabel == 1){ + VoidFraction = 1.0 - VoidFraction; + void_fraction_new = 1.0 - void_fraction_new; + } + double Rcrit_new = maxdistGlobal; - //if (argc>2){ - // Rcrit_new = strtod(argv[2],NULL); - // if (rank==0) printf("Max. distance =%f, Initial critical radius = %f \n",maxdistGlobal,Rcrit_new); - //} + while (void_fraction_new > VoidFraction) { void_fraction_diff_old = void_fraction_diff_new; @@ -268,7 +270,7 @@ double MorphOpen(DoubleArray &SignDist, signed char *id, std::shared_ptr for (int j=1; jComm); - if (ErodeLabel == 1) VoidFraction = 1-VoidFraction; - while (void_fraction_new > VoidFraction && Rcrit_new > 0.5) { void_fraction_diff_old = void_fraction_diff_new; @@ -643,7 +643,7 @@ double MorphDrain(DoubleArray &SignDist, signed char *id, std::shared_ptr 1){ count+=1.0; } }