fix a few syntax bugs and build passed

This commit is contained in:
Zhe Li
2022-04-12 12:49:28 +10:00
parent e1ebbce812
commit cc693c93f5
2 changed files with 10 additions and 9 deletions

View File

@@ -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