Skip to content

Commit dd62c41

Browse files
committed
Run clang-format on nekrs_driver.cpp
1 parent 5bf6ab0 commit dd62c41

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/nekrs_driver.cpp

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "enrico/nekrs_driver.h"
22
#include "enrico/error.h"
3-
#include "iapws/iapws.h"
43
#include "fldFile.hpp"
5-
#include "nekrs.hpp"
4+
#include "iapws/iapws.h"
65
#include "nekInterfaceAdapter.hpp"
6+
#include "nekrs.hpp"
77

88
#include <gsl-lite/gsl-lite.hpp>
99

@@ -30,9 +30,7 @@ NekRSDriver::NekRSDriver(MPI_Comm comm, pugi::xml_node node)
3030
output_heat_source_ = node.child("output_heat_source").text().as_bool();
3131
}
3232

33-
host_.setup({
34-
{"mode", "Serial"}
35-
});
33+
host_.setup({{"mode", "Serial"}});
3634

3735
// commg_in and comm_in should be the same when there is only a single nekRS session.
3836
setup_file_ = node.child_value("casename");
@@ -44,8 +42,8 @@ NekRSDriver::NekRSDriver(MPI_Comm comm, pugi::xml_node node)
4442
setup_file_ /* _setupFile */,
4543
"" /* backend_ */,
4644
"" /* _deviceId */,
47-
1 /* nSessions */,
48-
0 /* sessionID */,
45+
1 /* nSessions */,
46+
0 /* sessionID */,
4947
0 /* debug */);
5048

5149
nrs_ptr_ = reinterpret_cast<nrs_t*>(nekrs::nrsPtr());
@@ -56,7 +54,7 @@ NekRSDriver::NekRSDriver(MPI_Comm comm, pugi::xml_node node)
5654
"NekRS simulation is not setup for conjugate-heat transfer (CHT). "
5755
"ENRICO must be run with a CHT simulation.");
5856

59-
mesh_t *mesh = nrs_ptr_->cds->mesh[0];
57+
mesh_t* mesh = nrs_ptr_->cds->mesh[0];
6058
n_local_elem_ = mesh->Nelements;
6159
poly_deg_ = mesh->N;
6260
n_gll_ = mesh->Np;
@@ -68,15 +66,15 @@ NekRSDriver::NekRSDriver(MPI_Comm comm, pugi::xml_node node)
6866
x_ = mesh->x;
6967
y_ = mesh->y;
7068
z_ = mesh->z;
71-
69+
7270
element_info_ = mesh->elementInfo;
7371

7472
auto cds = nrs_ptr_->cds;
7573

7674
// Copy rho_cp_ from the device to host
7775
rho_cp_.resize(mesh->Nelements * mesh->Np);
7876
occa::memory o_rho = cds->o_rho;
79-
o_rho.copyTo(rho_cp_.data(), mesh->Nlocal * sizeof(dfloat));
77+
o_rho.copyTo(rho_cp_.data(), mesh->Nlocal * sizeof(dfloat));
8078

8179
temperature_ = cds->S;
8280

@@ -141,10 +139,13 @@ void NekRSDriver::solve_step()
141139
dt = nekrs::dt(tstep_);
142140

143141
int outputStep = nekrs::outputStep(time_ + dt, tstep_);
144-
if (nekrs::writeInterval() == 0) outputStep = 0;
145-
if (last_step) outputStep = 1;
146-
if (nekrs::writeInterval() < 0) outputStep = 0;
147-
nekrs::outputStep(outputStep);
142+
if (nekrs::writeInterval() == 0)
143+
outputStep = 0;
144+
if (last_step)
145+
outputStep = 1;
146+
if (nekrs::writeInterval() < 0)
147+
outputStep = 0;
148+
nekrs::outputStep(outputStep);
148149

149150
nekrs::initStep(time_, dt, tstep_);
150151

@@ -161,13 +162,13 @@ void NekRSDriver::solve_step()
161162
elapsedStepSum += elapsedStep;
162163
nekrs::updateTimer("elapsedStep", elapsedStep);
163164
nekrs::updateTimer("elapsedStepSum", elapsedStepSum);
164-
nekrs::updateTimer("elapsed", elapsedStepSum);
165+
nekrs::updateTimer("elapsed", elapsedStepSum);
165166

166167
if (nekrs::printInfoFreq()) {
167168
if (tstep_ % nekrs::printInfoFreq() == 0)
168169
nekrs::printInfo(time_, tstep_, true, false);
169170
}
170-
171+
171172
if (tstep_ % runtime_stat_freq == 0 || last_step)
172173
nekrs::printRuntimeStatistics(tstep_);
173174
}
@@ -178,11 +179,10 @@ void NekRSDriver::write_step(int timestep, int iteration)
178179
{
179180
timer_write_step.start();
180181
nekrs::outfld(time_, timestep);
181-
int FP64 = 1;
182+
int FP64 = 1;
182183
if (output_heat_source_) {
183184
comm_.message("Writing heat source to .fld file");
184-
occa::memory o_localq =
185-
host_.wrapMemory<double>(localq_->data(), localq_->size());
185+
occa::memory o_localq = host_.wrapMemory<double>(localq_->data(), localq_->size());
186186
writeFld("qsc", time_, 1, 0, FP64, &nrs_ptr_->o_U, &nrs_ptr_->o_P, &o_localq, 1);
187187
}
188188
timer_write_step.stop();
@@ -236,7 +236,6 @@ std::vector<double> NekRSDriver::volume() const
236236

237237
double NekRSDriver::temperature_at(int32_t local_elem) const
238238
{
239-
// comm_.message("at the beginning of function temperature_at()");
240239
Expects(local_elem < n_local_elem());
241240

242241
double sum0 = 0.;
@@ -255,7 +254,7 @@ std::vector<double> NekRSDriver::temperature() const
255254
for (int32_t i = 0; i < n_local_elem(); ++i) {
256255
t[i] = this->temperature_at(i);
257256
}
258-
257+
259258
return t;
260259
}
261260

0 commit comments

Comments
 (0)