fix a few syntax bugs and build passed
This commit is contained in:
@@ -154,20 +154,21 @@ vector<int> ScaLBL_Multiphys_Controller::getIonNumIter_PNP_coupling(
|
||||
vector<int> ScaLBL_Multiphys_Controller::getIonNumIter_NernstPlanck_coupling(
|
||||
const vector<double> &IonTimeConv) {
|
||||
//Return number of internal iterations for the Ion transport solver
|
||||
vector<double> TimeConv;
|
||||
TimeConv.assign(IonTimeConv.begin(), IonTimeConv.end());
|
||||
vector<int> num_iter_ion;
|
||||
vector<double>::iterator it_max =
|
||||
max_element(IonTimeConv.begin(), IonTimeConv.end());
|
||||
unsigned int idx_max = distance(IonTimeConv.begin(), it_max);
|
||||
vector<double>::iterator it_max = max_element(TimeConv.begin(), TimeConv.end());
|
||||
unsigned int idx_max = distance(TimeConv.begin(), it_max);
|
||||
if (idx_max == 0) {
|
||||
num_iter_ion.push_back(2);
|
||||
for (unsigned int idx = 1; idx < IonTimeConv.size(); idx++) {
|
||||
for (unsigned int idx = 1; idx < TimeConv.size(); idx++) {
|
||||
double temp =
|
||||
2 * TimeConv[idx_max] /
|
||||
TimeConv
|
||||
[idx]; //the factor 2 is the number of iterations for the element has max time_conv
|
||||
num_iter_ion.push_back(int(round(temp / 2) * 2));
|
||||
}
|
||||
} else if (idx_max == IonTimeConv.size() - 1) {
|
||||
} else if (idx_max == TimeConv.size() - 1) {
|
||||
for (unsigned int idx = 0; idx < TimeConv.size() - 1; idx++) {
|
||||
double temp =
|
||||
2 * TimeConv[idx_max] /
|
||||
@@ -185,7 +186,7 @@ vector<int> ScaLBL_Multiphys_Controller::getIonNumIter_NernstPlanck_coupling(
|
||||
num_iter_ion.push_back(int(round(temp / 2) * 2));
|
||||
}
|
||||
num_iter_ion.push_back(2);
|
||||
for (unsigned int idx = idx_max + 1; idx < IonTimeConv.size(); idx++) {
|
||||
for (unsigned int idx = idx_max + 1; idx < TimeConv.size(); idx++) {
|
||||
double temp =
|
||||
2 * TimeConv[idx_max] /
|
||||
TimeConv
|
||||
|
||||
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
|
||||
|
||||
//----------------------------------- print out for debugging ------------------------------------------//
|
||||
if (rank==0){
|
||||
for (size_t i=0;i<IonModel.timestepMax.size(),i++){
|
||||
printf("Main loop time_conv computed from %ith ion: %.5g[s/lt]"%(IonModel.timestepMax[i]*IonModel.time_conv[i]));
|
||||
for (size_t i=0;i<IonModel.timestepMax.size();i++){
|
||||
printf("Main loop time_conv computed from ion %i: %.5g[s/lt]\n",i+1,IonModel.timestepMax[i]*IonModel.time_conv[i]);
|
||||
}
|
||||
}
|
||||
//----------------------------------- print out for debugging ------------------------------------------//
|
||||
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
|
||||
while (timestep < Study.timestepMax){
|
||||
|
||||
timestep++;
|
||||
PoissonSolver.Run(IonModel.ChargeDensity,StokesModel.UseSlippingVelBC,timestep);//solve Poisson equtaion to get steady-state electrical potental
|
||||
PoissonSolver.Run(IonModel.ChargeDensity,false,timestep);//solve Poisson equtaion to get steady-state electrical potental
|
||||
//StokesModel.Run_Lite(IonModel.ChargeDensity, PoissonSolver.ElectricField);// Solve the N-S equations to get velocity
|
||||
IonModel.Run(IonModel.FluidVelocityDummy,PoissonSolver.ElectricField); //solve for ion transport and electric potential
|
||||
|
||||
|
||||
Reference in New Issue
Block a user