update morphdrain with csv

This commit is contained in:
JamesEMcclure
2019-05-01 10:19:13 -04:00
parent a01d8cebf2
commit 0f9fea77ae
2 changed files with 7 additions and 1 deletions

View File

@@ -451,7 +451,11 @@ double MorphDrain(DoubleArray &SignDist, signed char *id, std::shared_ptr<Domain
// if (rank==0) printf("Max. distance =%f, Initial critical radius = %f \n",maxdistGlobal,Rcrit_new);
//}
MPI_Barrier(Dm->Comm);
FILE *DRAIN = fopen("morphdrain.csv","w");
fprintf(DRAIN,"sw radius\n");
while (void_fraction_new > VoidFraction && Rcrit_new > 0.5)
{
void_fraction_diff_old = void_fraction_diff_new;
@@ -653,6 +657,8 @@ double MorphDrain(DoubleArray &SignDist, signed char *id, std::shared_ptr<Domain
void_fraction_new = countGlobal/totalGlobal;
void_fraction_diff_new = abs(void_fraction_new-VoidFraction);
if (rank==0){
fprintf(DRAIN,"%f ",void_fraction_new);
fprintf(DRAIN,"%f\n",Rcrit_new);
printf(" %f ",void_fraction_new);
printf(" %f\n",Rcrit_new);
}

View File

@@ -135,7 +135,7 @@ int main(int argc, char **argv)
auto HistoryLabels = domain_db->getVector<int>( "HistoryLabels" );
size_t NLABELS=LabelList.size();
if (rank==0){
for (unsigned int idx=0; idx < NLABELS; idx++){
for (unsigned int idx=0; idx < NLABELS; idx++){
signed char VALUE = LabelList[idx];
signed char NEWVAL = HistoryLabels[idx];
printf(" Relabel component %hhd as %hhd \n", VALUE, NEWVAL);