changed: reduce scope of variables

This commit is contained in:
Arne Morten Kvarving
2018-08-09 14:31:27 +02:00
parent a5513e460b
commit d0174b6bec
2 changed files with 6 additions and 3 deletions

View File

@@ -46,9 +46,10 @@ public:
this->S1.getProcessAdm().cout <<"\n step="<< tp.step
<<" time="<< tp.time.t << std::endl;
SIM::ConvStatus status1 = SIM::OK, status2 = SIM::OK, conv = SIM::OK;
SIM::ConvStatus conv = SIM::OK;
for (tp.iter = 0; tp.iter <= maxIter && conv != SIM::CONVERGED; tp.iter++)
{
SIM::ConvStatus status1 = SIM::OK, status2 = SIM::OK;
if (firstS1 && (status1 = this->S1.solveIteration(tp)) <= SIM::DIVERGED)
return false;

View File

@@ -228,12 +228,14 @@ public:
for (size_t i=0;i<loc_planes;++i) {
m_planes.push_back(new PlaneSolver(props));
int pid = 0;
#ifdef HAVE_MPI
m_planes.back()->setCommunicator(&comm);
MPI_Comm_rank(comm, &pid);
#endif
if (!log_files.empty()) {
int pid = 0;
#ifdef HAVE_MPI
MPI_Comm_rank(comm, &pid);
#endif
if (plane_log_files.size() < loc_planes) {
std::stringstream str;
str << log_files <<"_plane"<< startCtx+i+1 <<".log";