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

Arbitrary components for the ReduceToPlane function? #4261

Open
pkufourier opened this issue Dec 13, 2024 · 1 comment
Open

Arbitrary components for the ReduceToPlane function? #4261

pkufourier opened this issue Dec 13, 2024 · 1 comment

Comments

@pkufourier
Copy link

In the MultiFabUtil.H I have see the ReduceToPlane function, and the following example:

int dir = 0; // x-direction
auto const& domain_box = geom.Domain().surroundingNodes(); // nodal data
auto const& ma = mf.const_arrays();
auto rr = ReduceToPlane<ReduceOpMax,KeyValuePair<Real,int>>
(dir, domain_box, mf,
[=] AMREX_GPU_DEVICE (int box_no, int i, int j, int k)
-> KeyValuePair<Real,int>
{
return {mabox_no, i};
});

However this is only for two components ,which is limited by the ,KeyValuePair. Is there any way to reduce to Plane for more than 2 components by one call, like the ParReduce operation, which can use TypeList and GpuTuple to list arbitrary components?

@WeiqunZhang
Copy link
Member

Unfortunately, no. You will have to call the function multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants