-
Notifications
You must be signed in to change notification settings - Fork 342
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
Named SoA Support #4163
base: development
Are you sure you want to change the base?
Named SoA Support #4163
Conversation
15145a6
to
57ee5c2
Compare
{ | ||
m_defined = true; | ||
m_runtime_rdata.resize(a_num_runtime_real); | ||
m_runtime_idata.resize(a_num_runtime_int ); | ||
m_rdata_names = soa_rdata_names; |
Check warning
Code scanning / CodeQL
Local variable address stored in non-local memory Warning
parameter
{ | ||
m_defined = true; | ||
m_runtime_rdata.resize(a_num_runtime_real); | ||
m_runtime_idata.resize(a_num_runtime_int ); | ||
m_rdata_names = soa_rdata_names; | ||
m_idata_names = soa_idata_names; |
Check warning
Code scanning / CodeQL
Local variable address stored in non-local memory Warning
parameter
Add support to optionally name SoA Real and Int components, both for compile-time and runtime components.
57ee5c2
to
9986eef
Compare
int first_r_name = 0; | ||
// push back x,y,z | ||
if constexpr (ParticleType::is_soa_particle) { | ||
constexpr int x_in_ascii = 120; | ||
for (int i=0; i<AMREX_SPACEDIM; ++i) | ||
{ | ||
std::string const name{char(x_in_ascii+i)}; | ||
m_soa_rdata_names.push_back(name); | ||
} | ||
first_r_name = AMREX_SPACEDIM; | ||
} | ||
for (int i=first_r_name; i<NArrayReal; ++i) | ||
{ | ||
m_soa_rdata_names.push_back("real_comp" + std::to_string(i-first_r_name)); | ||
} | ||
for (int i=0; i<NArrayInt; ++i) | ||
{ | ||
m_soa_idata_names.push_back("int_comp" + std::to_string(i)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that we want to make this two functions (one for real, one for int) that take the ParticleType and index to return a default name on the current index.
This way, we can reuse this in the:
- current I/O logic (existing naming scheme we took over here)
- here
- in
AddRealComp
/AddIntComp
withoutname
argument
Summary
Add support to optionally name SoA Real and Int components, both for compile-time and runtime components.
Get*Data(std::string)
GetData()
with named indicesAddReal/IntComp
Additional background
Close #3614
Checklist
The proposed changes: