make the WriteLog in PoissonSolver a bool type to facilitate input

This commit is contained in:
Rex Zhe Li 2020-12-04 00:37:02 -05:00
parent de60bae8fc
commit 7ef18bfea3
2 changed files with 4 additions and 10 deletions

View File

@ -36,7 +36,7 @@ void ScaLBL_Poisson::ReadParams(string filename){
Vin = 1.0; //Boundary-z (inlet) electric potential
Vout = 1.0; //Boundary-Z (outlet) electric potential
chargeDen_dummy = 1.0e-3;//For debugging;unit=[C/m^3]
WriteLog = 0;
WriteLog = false;
// LB-Poisson Model parameters
if (electric_db->keyExists( "timestepMax" )){
@ -55,13 +55,7 @@ void ScaLBL_Poisson::ReadParams(string filename){
chargeDen_dummy = electric_db->getScalar<double>( "DummyChargeDen" );
}
if (electric_db->keyExists( "WriteLog" )){
auto writelog = electric_db->getScalar<std::string>( "WriteLog" );
if (writelog !="True" && writelog !="False"){
ERROR("Error: LB-Poisson Solver: WriteLog cannot be identified! Uesage: WriteLog is either True or False.\n");
}
else if (writelog =="True"){
WriteLog = 1;
}
WriteLog = electric_db->getScalar<bool>( "WriteLog" );
}
// Read solid boundary condition specific to Poisson equation
@ -466,7 +460,7 @@ void ScaLBL_Poisson::Run(double *ChargeDensity){
psi_avg_previous = psi_avg;
}
}
if(WriteLog==1){
if(WriteLog==true){
getConvergenceLog(timestep,error);
}

View File

@ -46,7 +46,7 @@ public:
double epsilon0,epsilon0_LB,epsilonR,epsilon_LB;
double Vin, Vout;
double chargeDen_dummy;//for debugging
short WriteLog;
bool WriteLog;
int Nx,Ny,Nz,N,Np;
int rank,nprocx,nprocy,nprocz,nprocs;