Merge branch 'FOM'
This commit is contained in:
commit
7c1167b981
@ -329,7 +329,6 @@ void Domain::Decomp(std::string Filename)
|
|||||||
char *SegData = NULL;
|
char *SegData = NULL;
|
||||||
|
|
||||||
if (RANK==0){
|
if (RANK==0){
|
||||||
|
|
||||||
printf("Input media: %s\n",Filename.c_str());
|
printf("Input media: %s\n",Filename.c_str());
|
||||||
printf("Relabeling %lu values\n",ReadValues.size());
|
printf("Relabeling %lu values\n",ReadValues.size());
|
||||||
for (int idx=0; idx<ReadValues.size(); idx++){
|
for (int idx=0; idx<ReadValues.size(); idx++){
|
||||||
@ -485,6 +484,7 @@ void Domain::Decomp(std::string Filename)
|
|||||||
else{
|
else{
|
||||||
// solid checkers
|
// solid checkers
|
||||||
SegData[k*global_Nx*global_Ny+j*global_Nx+i] = 0;
|
SegData[k*global_Nx*global_Ny+j*global_Nx+i] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "common/Communication.h"
|
#include "common/Communication.h"
|
||||||
#include "common/Database.h"
|
#include "common/Database.h"
|
||||||
|
|
||||||
|
|
||||||
class Domain;
|
class Domain;
|
||||||
template<class TYPE> class PatchData;
|
template<class TYPE> class PatchData;
|
||||||
|
|
||||||
|
@ -70,6 +70,8 @@ Array<uint8_t> readMicroCT( const Database& domain, MPI_Comm comm )
|
|||||||
auto n = domain.getVector<int>( "n" );
|
auto n = domain.getVector<int>( "n" );
|
||||||
int rank = comm_rank(MPI_COMM_WORLD);
|
int rank = comm_rank(MPI_COMM_WORLD);
|
||||||
auto nproc = domain.getVector<int>( "nproc" );
|
auto nproc = domain.getVector<int>( "nproc" );
|
||||||
|
auto ReadValues = domain.getVector<int>( "ReadValues" );
|
||||||
|
auto WriteValues = domain.getVector<int>( "WriteValues" );
|
||||||
RankInfoStruct rankInfo( rank, nproc[0], nproc[1], nproc[2] );
|
RankInfoStruct rankInfo( rank, nproc[0], nproc[1], nproc[2] );
|
||||||
|
|
||||||
// Determine the largest file number to get
|
// Determine the largest file number to get
|
||||||
@ -93,6 +95,25 @@ Array<uint8_t> readMicroCT( const Database& domain, MPI_Comm comm )
|
|||||||
ERROR( "Invalid name for first file" );
|
ERROR( "Invalid name for first file" );
|
||||||
}
|
}
|
||||||
data = readMicroCT( filename );
|
data = readMicroCT( filename );
|
||||||
|
|
||||||
|
// Relabel the data
|
||||||
|
for (int k = 0; k<1024; k++){
|
||||||
|
for (int j = 0; j<1024; j++){
|
||||||
|
for (int i = 0; i<1024; i++){
|
||||||
|
//n = k*Nfx*Nfy + j*Nfx + i;
|
||||||
|
//char locval = loc_id[n];
|
||||||
|
char locval = data(i,j,k);
|
||||||
|
for (int idx=0; idx<ReadValues.size(); idx++){
|
||||||
|
signed char oldvalue=ReadValues[idx];
|
||||||
|
signed char newvalue=WriteValues[idx];
|
||||||
|
if (locval == oldvalue){
|
||||||
|
data(i,j,k) = newvalue;
|
||||||
|
idx = ReadValues.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redistribute the data
|
// Redistribute the data
|
||||||
|
@ -4,6 +4,7 @@ color lattice boltzmann model
|
|||||||
#include "models/ColorModel.h"
|
#include "models/ColorModel.h"
|
||||||
#include "analysis/distance.h"
|
#include "analysis/distance.h"
|
||||||
#include "analysis/morphology.h"
|
#include "analysis/morphology.h"
|
||||||
|
#include "common/ReadMicroCT.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
@ -189,6 +190,10 @@ void ScaLBL_ColorModel::ReadInput(){
|
|||||||
Mask->Decomp(first_image);
|
Mask->Decomp(first_image);
|
||||||
IMAGE_INDEX++;
|
IMAGE_INDEX++;
|
||||||
}
|
}
|
||||||
|
else if (domain_db->keyExists( "GridFile" )){
|
||||||
|
auto input_id = readMicroCT( *domain_db, MPI_COMM_WORLD );
|
||||||
|
for (int i=0; i<Nx*Ny*Nz; i++) Mask->id[i] = input_id(i);
|
||||||
|
}
|
||||||
else if (domain_db->keyExists( "Filename" )){
|
else if (domain_db->keyExists( "Filename" )){
|
||||||
auto Filename = domain_db->getScalar<std::string>( "Filename" );
|
auto Filename = domain_db->getScalar<std::string>( "Filename" );
|
||||||
Mask->Decomp(Filename);
|
Mask->Decomp(Filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user