Calculate distance instead of reading in color model
This commit is contained in:
parent
555b2992b9
commit
87b32dd0b4
@ -4,5 +4,4 @@ LBPM_DIR=../../tests
|
|||||||
|
|
||||||
python ParallelPlates.py
|
python ParallelPlates.py
|
||||||
mpirun -np 1 $LBPM_DIR/lbpm_serial_decomp input.db
|
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
|
mpirun -np 4 $LBPM_DIR/lbpm_color_simulator input.db
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
color lattice boltzmann model
|
color lattice boltzmann model
|
||||||
*/
|
*/
|
||||||
#include "models/ColorModel.h"
|
#include "models/ColorModel.h"
|
||||||
|
#include "analysis/distance.h"
|
||||||
|
|
||||||
ScaLBL_ColorModel::ScaLBL_ColorModel(int RANK, int NP, MPI_Comm COMM):
|
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),
|
rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tauA(0),tauB(0),rhoA(0),rhoB(0),alpha(0),beta(0),
|
||||||
@ -123,14 +124,35 @@ void ScaLBL_ColorModel::ReadInput(){
|
|||||||
sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString);
|
sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString);
|
||||||
sprintf(LocalRestartFile,"%s%s","Restart.",LocalRankString);
|
sprintf(LocalRestartFile,"%s%s","Restart.",LocalRankString);
|
||||||
|
|
||||||
// .......... READ THE INPUT FILE .......................................
|
// Generate the signed distance map
|
||||||
//...........................................................................
|
// Initialize the domain and communication
|
||||||
if (rank == 0) cout << "Reading in signed distance function..." << endl;
|
Array<char> id_solid(Nx,Ny,Nz);
|
||||||
//.......................................................................
|
int count = 0;
|
||||||
sprintf(LocalRankString,"%05d",rank);
|
// Solve for the position of the solid phase
|
||||||
sprintf(LocalRankFilename,"%s%s","SignDist.",LocalRankString);
|
for (int k=0;k<Nz;k++){
|
||||||
ReadBinaryFile(LocalRankFilename, Averages->SDs.data(), N);
|
for (int j=0;j<Ny;j++){
|
||||||
MPI_Barrier(comm);
|
for (int i=0;i<Nx;i++){
|
||||||
|
int n = k*Nx*Ny+j*Nx+i;
|
||||||
|
// Initialize the solid phase
|
||||||
|
if (Mask->id[n] > 0) id_solid(i,j,k) = 1;
|
||||||
|
else id_solid(i,j,k) = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Initialize the signed distance function
|
||||||
|
for (int k=0;k<Nz;k++){
|
||||||
|
for (int j=0;j<Ny;j++){
|
||||||
|
for (int i=0;i<Nx;i++){
|
||||||
|
int n=k*Nx*Ny+j*Nx+i;
|
||||||
|
// Initialize distance to +/- 1
|
||||||
|
Averages->SDs(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;
|
if (rank == 0) cout << "Domain set." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user