From c76e549cabd361900b8b41f83e515c6cd968194a Mon Sep 17 00:00:00 2001 From: James E McClure Date: Fri, 30 Nov 2018 15:53:28 -0500 Subject: [PATCH] compute volume fractions for components --- models/ColorModel.cpp | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/models/ColorModel.cpp b/models/ColorModel.cpp index 85d60891..a72cd266 100644 --- a/models/ColorModel.cpp +++ b/models/ColorModel.cpp @@ -169,15 +169,12 @@ void ScaLBL_ColorModel::AssignComponentLabels(double *phase) ERROR("Error: ComponentLabels and ComponentAffinity must be the same length! \n"); } - if (rank==0){ - printf("Components labels: %lu \n",NLABELS); - for (unsigned int idx=0; idxid[n] = 0; // set mask to zero since this is an immobile component } @@ -201,6 +199,19 @@ void ScaLBL_ColorModel::AssignComponentLabels(double *phase) } // Set Dm to match Mask for (int i=0; iid[i] = Mask->id[i]; + + MPI_Allreduce(&label_count[0],&label_count_global[0],NLABELS,MPI_INT,MPI_SUM,Dm->Comm); + + if (rank==0){ + printf("Components labels: %lu \n",NLABELS); + for (unsigned int idx=0; idx