Merge branch 'morphLBM' of github.com:JamesEMcClure/LBPM-WIA into morphLBM
This commit is contained in:
		| @@ -167,8 +167,8 @@ void SubPhase::Basic(){ | ||||
| 	// If inlet/outlet layers exist use these as default | ||||
| 	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_z > 0) kmin = Dm->inlet_layers_z; | ||||
| 	if (Dm->outlet_layers_z > 0) kmax = Dm->outlet_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;  | ||||
| 	 | ||||
| 	nb.reset(); wb.reset(); | ||||
|  | ||||
| @@ -370,7 +370,8 @@ void SubPhase::Full(){ | ||||
| 	// If inlet layers exist use these as default | ||||
| 	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_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(); | ||||
|  | ||||
|   | ||||
| @@ -230,11 +230,10 @@ public: | ||||
|         } | ||||
|     ~IOWorkItem() { } | ||||
|     virtual void run() { | ||||
|     	auto vis_db = input_db->getDatabase( "Visualization" ); | ||||
|     	auto db = input_db->getDatabase( "Colr" ); | ||||
|     	auto color_db =  input_db->getDatabase( "Color" ); | ||||
|     	auto vis_db =  input_db->getDatabase( "Visualization" ); | ||||
|         int timestep = color_db->getWithDefault<int>( "timestep", 0 ); | ||||
|  | ||||
|         int timestep = db->getWithDefault<int>( "timestep", 0 ); | ||||
|          | ||||
|         PROFILE_START("Save Vis",1); | ||||
|  | ||||
|         if (vis_db->getWithDefault<bool>( "save_phase_field", true )){ | ||||
| @@ -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) | ||||
| { | ||||
|     int N = d_N[0]*d_N[1]*d_N[2]; | ||||
| 	auto db = input_db->getDatabase( "Color" ); | ||||
|     int timestep = db->getWithDefault<int>( "timestep", 0 ); | ||||
| 	auto color_db =  input_db->getDatabase( "Color" ); | ||||
| 	auto vis_db =  input_db->getDatabase( "Visualization" ); | ||||
|     int timestep = color_db->getWithDefault<int>( "timestep", 0 ); | ||||
|  | ||||
|     // Check which analysis steps we need to perform | ||||
|     auto type = computeAnalysisType( timestep ); | ||||
|   | ||||
| @@ -657,7 +657,8 @@ void ScaLBL_ColorModel::Run(){ | ||||
| 		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_DeviceBarrier(); | ||||
| 		 | ||||
| 		ScaLBL_D3Q7_AAodd_PhaseField(NeighborList, dvcMap, Aq, Bq, Den, Phi, 0, ScaLBL_Comm->LastExterior(), Np); | ||||
|  | ||||
| 		// Perform the collision operation | ||||
| 		ScaLBL_Comm->SendD3Q19AA(fq); //READ FROM NORMAL | ||||
| 		if (BoundaryCondition > 0){ | ||||
| @@ -783,7 +784,7 @@ void ScaLBL_ColorModel::Run(){ | ||||
| 					delta_volume_target = Dm->Volume*volA *morph_delta; // set target volume change | ||||
| 					Averages->Full(); | ||||
| 					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(); | ||||
| 					 | ||||
| 					if (rank==0){ | ||||
|   | ||||
| @@ -49,6 +49,11 @@ int main(int argc, char **argv) | ||||
|     OutStream << "} \n"; | ||||
| 	printf("TestDatbase: writing test file\n"); | ||||
| 	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 domain_db = new_db->getDatabase( "Domain" ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user