Skip to content

Commit c7d6ac9

Browse files
authored
Fix: set_rdata/idata Vectors (#274)
The overloads of `RealVect`/`IntVect` make no sense, since they are N-dimensional and the number of arguments in `ParticleReal`/`int` attributes is independent of that. This led to memory violations and `-Warray-bounds` warnings at compile time.
1 parent 084679a commit c7d6ac9

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/Particle/Particle.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ void make_Particle(py::module &m)
212212
}
213213
}
214214
)
215-
.def("set_rdata", [](ParticleType &p, const RealVect & vals) {
216-
if constexpr (T_NReal > 0) {
217-
for (int ii=0; ii < T_NReal; ii++) {
218-
p.m_rdata[ii] = vals[ii];
219-
}
220-
} else {
221-
amrex::ignore_unused(vals);
222-
}
223-
}
224-
)
225215
.def("set_rdata", [](ParticleType &p, const std::array<Real, T_NReal>& vals) {
226216
if constexpr (T_NReal > 0) {
227217
for (int ii=0; ii < T_NReal; ii++) {
@@ -268,16 +258,6 @@ void make_Particle(py::module &m)
268258
}
269259
}
270260
)
271-
.def("set_idata", [](ParticleType &p, const IntVect & vals) {
272-
if constexpr (T_NInt > 0) {
273-
for (int ii=0; ii < T_NInt; ii++) {
274-
p.m_idata[ii] = vals[ii];
275-
}
276-
} else {
277-
amrex::ignore_unused(vals);
278-
}
279-
}
280-
)
281261
.def("set_idata", [](ParticleType &p, const std::array<int, T_NInt>& vals) {
282262
if constexpr (T_NInt > 0) {
283263
for (int ii=0; ii < T_NInt; ii++) {

0 commit comments

Comments
 (0)