Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace &foo[0] with foo.data() #420

Merged
merged 10 commits into from
Mar 26, 2024
12 changes: 6 additions & 6 deletions Source/MaestroDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ void Maestro::DiagFile(const int step, const Real t_in,
if (nprocs == 1) {
T_max_data[0] = T_max_local;
} else {
ParallelDescriptor::Gather(&T_max_local, 1, &T_max_data[0], 1,
ParallelDescriptor::Gather(&T_max_local, 1, T_max_data.data(), 1,
ioproc);
}

Expand Down Expand Up @@ -434,8 +434,8 @@ void Maestro::DiagFile(const int step, const Real t_in,
T_max_coords_level[i] = T_max_coords[i];
}
} else {
ParallelDescriptor::Gather(&T_max_coords[0], 2 * AMREX_SPACEDIM,
&T_max_coords_level[0],
ParallelDescriptor::Gather(T_max_coords.data(), 2 * AMREX_SPACEDIM,
T_max_coords_level.data(),
2 * AMREX_SPACEDIM, ioproc);
}

Expand All @@ -458,7 +458,7 @@ void Maestro::DiagFile(const int step, const Real t_in,
if (nprocs == 1) {
enuc_max_data[0] = enuc_max_local;
} else {
ParallelDescriptor::Gather(&enuc_max_local, 1, &enuc_max_data[0], 1,
ParallelDescriptor::Gather(&enuc_max_local, 1, enuc_max_data.data(), 1,
ioproc);
}

Expand All @@ -484,8 +484,8 @@ void Maestro::DiagFile(const int step, const Real t_in,
enuc_max_coords_level[i] = enuc_max_coords[i];
}
} else {
ParallelDescriptor::Gather(&enuc_max_coords[0], 2 * AMREX_SPACEDIM,
&enuc_max_coords_level[0],
ParallelDescriptor::Gather(enuc_max_coords.data(), 2 * AMREX_SPACEDIM,
enuc_max_coords_level.data(),
2 * AMREX_SPACEDIM, ioproc);
}

Expand Down