Merge branch 'morphLBM' of github.com:JamesEMcClure/LBPM-WIA into morphLBM

This commit is contained in:
JamesEMcclure 2019-09-20 15:04:01 -04:00
commit c7d014b500
4 changed files with 18 additions and 11 deletions

View File

@ -167,8 +167,8 @@ void SubPhase::Basic(){
// If inlet/outlet layers exist use these as default // If inlet/outlet layers exist use these as default
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x; if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y; if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z; if (Dm->inlet_layers_z > 0 && Dm->kproc() == 0) kmin += Dm->inlet_layers_z;
if (Dm->outlet_layers_z > 0) kmax = Dm->outlet_layers_z; if (Dm->outlet_layers_z > 0 && Dm->kproc() == Dm->nprocz()-1) kmax -= Dm->outlet_layers_z;
nb.reset(); wb.reset(); nb.reset(); wb.reset();
@ -370,7 +370,8 @@ void SubPhase::Full(){
// If inlet layers exist use these as default // If inlet layers exist use these as default
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x; if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y; if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z; if (Dm->inlet_layers_z > 0 && Dm->kproc() == 0) kmin += Dm->inlet_layers_z;
if (Dm->outlet_layers_z > 0 && Dm->kproc() == Dm->nprocz()-1) kmax -= Dm->outlet_layers_z;
nd.reset(); nc.reset(); wd.reset(); wc.reset(); iwn.reset(); iwnc.reset(); nd.reset(); nc.reset(); wd.reset(); wc.reset(); iwn.reset(); iwnc.reset();

View File

@ -230,10 +230,9 @@ public:
} }
~IOWorkItem() { } ~IOWorkItem() { }
virtual void run() { virtual void run() {
auto color_db = input_db->getDatabase( "Color" );
auto vis_db = input_db->getDatabase( "Visualization" ); auto vis_db = input_db->getDatabase( "Visualization" );
auto db = input_db->getDatabase( "Colr" ); int timestep = color_db->getWithDefault<int>( "timestep", 0 );
int timestep = db->getWithDefault<int>( "timestep", 0 );
PROFILE_START("Save Vis",1); PROFILE_START("Save Vis",1);
@ -1057,8 +1056,9 @@ void runAnalysis::basic( std::shared_ptr<Database> input_db, SubPhase &Averages,
void runAnalysis::WriteVisData( std::shared_ptr<Database> input_db, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den) void runAnalysis::WriteVisData( std::shared_ptr<Database> input_db, SubPhase &Averages, const double *Phi, double *Pressure, double *Velocity, double *fq, double *Den)
{ {
int N = d_N[0]*d_N[1]*d_N[2]; int N = d_N[0]*d_N[1]*d_N[2];
auto db = input_db->getDatabase( "Color" ); auto color_db = input_db->getDatabase( "Color" );
int timestep = db->getWithDefault<int>( "timestep", 0 ); auto vis_db = input_db->getDatabase( "Visualization" );
int timestep = color_db->getWithDefault<int>( "timestep", 0 );
// Check which analysis steps we need to perform // Check which analysis steps we need to perform
auto type = computeAnalysisType( timestep ); auto type = computeAnalysisType( timestep );

View File

@ -657,6 +657,7 @@ void ScaLBL_ColorModel::Run(){
ScaLBL_D3Q7_AAodd_PhaseField(NeighborList, dvcMap, Aq, Bq, Den, Phi, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np); ScaLBL_D3Q7_AAodd_PhaseField(NeighborList, dvcMap, Aq, Bq, Den, Phi, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np);
ScaLBL_Comm->BiRecvD3Q7AA(Aq,Bq); //WRITE INTO OPPOSITE ScaLBL_Comm->BiRecvD3Q7AA(Aq,Bq); //WRITE INTO OPPOSITE
ScaLBL_DeviceBarrier(); ScaLBL_DeviceBarrier();
ScaLBL_D3Q7_AAodd_PhaseField(NeighborList, dvcMap, Aq, Bq, Den, Phi, 0, ScaLBL_Comm->LastExterior(), Np);
// Perform the collision operation // Perform the collision operation
ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL
@ -783,7 +784,7 @@ void ScaLBL_ColorModel::Run(){
delta_volume_target = Dm->Volume*volA *morph_delta; // set target volume change delta_volume_target = Dm->Volume*volA *morph_delta; // set target volume change
Averages->Full(); Averages->Full();
Averages->Write(timestep); Averages->Write(timestep);
analysis.WriteVisData( vis_db, *Averages, Phi, Pressure, Velocity, fq, Den ); analysis.WriteVisData( current_db, *Averages, Phi, Pressure, Velocity, fq, Den );
analysis.finish(); analysis.finish();
if (rank==0){ if (rank==0){

View File

@ -50,6 +50,11 @@ int main(int argc, char **argv)
printf("TestDatbase: writing test file\n"); printf("TestDatbase: writing test file\n");
OutStream.close(); OutStream.close();
std::string protocol="steady state";
if (protocol == "steady state"){
printf("Run steady state \n");
}
auto new_db = std::make_shared<Database>( "test.db" ); auto new_db = std::make_shared<Database>( "test.db" );
auto domain_db = new_db->getDatabase( "Domain" ); auto domain_db = new_db->getDatabase( "Domain" );
if (domain_db->keyExists( "BC" )){ if (domain_db->keyExists( "BC" )){