Skip to content

Commit

Permalink
SoA: Public Getter for Names (#4187)
Browse files Browse the repository at this point in the history
## Summary

Expose the names to public member functions.

## Additional background

Needed for Python bindings. Follow-up to #4163 

## Checklist

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
  • Loading branch information
ax3l authored Oct 10, 2024
1 parent 8df11b6 commit fcc5bd2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Src/Particle/AMReX_StructOfArrays.H
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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

0 comments on commit fcc5bd2

Please sign in to comment.