Merge branch 'master' of github.com:JamesEMcClure/LBPM-WIA
This commit is contained in:
commit
ccae11e6ae
|
@ -17,6 +17,7 @@
|
|||
* Multi-relaxation time LBM Model
|
||||
*/
|
||||
#include "models/MRTModel.h"
|
||||
#include "analysis/distance.h"
|
||||
|
||||
ScaLBL_MRTModel::ScaLBL_MRTModel(int RANK, int NP, MPI_Comm COMM):
|
||||
rank(RANK), nprocs(NP), Restart(0),timestep(0),timestepMax(0),tau(0),
|
||||
|
@ -83,7 +84,6 @@ void ScaLBL_MRTModel::ReadInput(){
|
|||
int rank=Dm->rank();
|
||||
size_t readID;
|
||||
//.......................................................................
|
||||
if (rank == 0) printf("Read input media... \n");
|
||||
//.......................................................................
|
||||
Mask->ReadIDs();
|
||||
|
||||
|
@ -91,14 +91,34 @@ void ScaLBL_MRTModel::ReadInput(){
|
|||
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, Distance.data(), N);
|
||||
MPI_Barrier(comm);
|
||||
// Generate the signed distance map
|
||||
// Initialize the domain and communication
|
||||
Array<char> id_solid(Nx,Ny,Nz);
|
||||
int count = 0;
|
||||
// Solve for the position of the solid phase
|
||||
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 the solid phase
|
||||
if (Dm->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
|
||||
Distance(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(Distance,id_solid,*Dm);
|
||||
if (rank == 0) cout << "Domain set." << endl;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user