Skip to content

Commit fcc5bd2

Browse files
authored
SoA: Public Getter for Names (#4187)
## 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
1 parent 8df11b6 commit fcc5bd2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Src/Particle/AMReX_StructOfArrays.H

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ struct StructOfArrays {
5252
/** Get access to the particle Int Arrays (only compile-time components) */
5353
[[nodiscard]] const std::array< IntVector, NInt>& GetIntData () const { return m_idata; }
5454

55+
/** Get the names for the real SoA components **/
56+
[[nodiscard]] std::vector<std::string> GetRealNames () const
57+
{
58+
if (m_rdata_names) {
59+
return *m_rdata_names;
60+
}
61+
else {
62+
return std::vector<std::string>();
63+
}
64+
}
65+
66+
/** Get the names for the int SoA components **/
67+
[[nodiscard]] std::vector<std::string> GetIntNames () const
68+
{
69+
if (m_idata_names) {
70+
return *m_idata_names;
71+
}
72+
else {
73+
return std::vector<std::string>();
74+
}
75+
}
76+
5577
/** Get access to a particle Real component Array (compile-time and runtime component)
5678
*
5779
* @param index component with 0...NReal-1 compile-time and NReal... runtime arguments

0 commit comments

Comments
 (0)