diff --git a/example/Plates/MixedWet.sh b/example/Plates/MixedWet.sh index 9a08a432..97884c67 100644 --- a/example/Plates/MixedWet.sh +++ b/example/Plates/MixedWet.sh @@ -4,5 +4,4 @@ LBPM_DIR=../../tests python ParallelPlates.py mpirun -np 1 $LBPM_DIR/lbpm_serial_decomp input.db -mpirun -np 4 $LBPM_DIR/lbpm_segmented_pp input.db mpirun -np 4 $LBPM_DIR/lbpm_color_simulator input.db diff --git a/models/ColorModel.cpp b/models/ColorModel.cpp index c5d7893d..a662b478 100644 --- a/models/ColorModel.cpp +++ b/models/ColorModel.cpp @@ -2,6 +2,7 @@ color lattice boltzmann model */ #include "models/ColorModel.h" +#include "analysis/distance.h" ScaLBL_ColorModel::ScaLBL_ColorModel(int RANK, int NP, MPI_Comm COMM): rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tauA(0),tauB(0),rhoA(0),rhoB(0),alpha(0),beta(0), @@ -122,15 +123,36 @@ void ScaLBL_ColorModel::ReadInput(){ sprintf(LocalRankString,"%05d",rank); sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString); sprintf(LocalRestartFile,"%s%s","Restart.",LocalRankString); - - // .......... READ THE INPUT FILE ....................................... - //........................................................................... - if (rank == 0) cout << "Reading in signed distance function..." << endl; - //....................................................................... - sprintf(LocalRankString,"%05d",rank); - sprintf(LocalRankFilename,"%s%s","SignDist.",LocalRankString); - ReadBinaryFile(LocalRankFilename, Averages->SDs.data(), N); - MPI_Barrier(comm); + + // Generate the signed distance map + // Initialize the domain and communication + Array id_solid(Nx,Ny,Nz); + int count = 0; + // Solve for the position of the solid phase + for (int k=0;kid[n] > 0) id_solid(i,j,k) = 1; + else id_solid(i,j,k) = 0; + } + } + } + // Initialize the signed distance function + for (int k=0;kSDs(i,j,k) = 2.0*double(id_solid(i,j,k))-1.0; + } + } + } +// MeanFilter(Averages->SDs); + if (rank==0) printf("Initialized solid phase -- Converting to Signed Distance function \n"); + CalcDist(Averages->SDs,id_solid,*Mask); + if (rank == 0) cout << "Domain set." << endl; }