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

SoA: Public Getter for Names #4187

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Src/Particle/AMReX_StructOfArrays.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <algorithm>
#include <array>
#include <stdexcept>
ax3l marked this conversation as resolved.
Show resolved Hide resolved
#include <string>
#include <vector>

Expand Down Expand Up @@ -52,6 +53,28 @@ struct StructOfArrays {
/** Get access to the particle Int Arrays (only compile-time components) */
[[nodiscard]] const std::array< IntVector, NInt>& GetIntData () const { return m_idata; }

/** Get the names for the real SoA components **/
[[nodiscard]] std::vector<std::string> GetRealNames () const
{
if (m_rdata_names) {
return *m_rdata_names;
}
else {
return std::vector<std::string>();
}
}

/** Get the names for the int SoA components **/
[[nodiscard]] std::vector<std::string> GetIntNames () const
{
if (m_idata_names) {
return *m_idata_names;
}
else {
return std::vector<std::string>();
}
}

/** Get access to a particle Real component Array (compile-time and runtime component)
*
* @param index component with 0...NReal-1 compile-time and NReal... runtime arguments
Expand Down
Loading