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

Better Problem Specific Function capability #743

Merged
merged 27 commits into from
Mar 15, 2024

Conversation

baperry2
Copy link
Contributor

Consolidate problem-specific functions into a single class, which makes adding more problem-specific capability easier. This is a breaking change, only requires a one-line fix for case that don't use the existing problem-specific capability, and makes it so future additions of problem-specific capability aren't breaking.

Also adds some improvements for passive scalar advection.

Draft right now, will need to go through and make a change to all cases once the methodology is finalized.

@marchdf - There are two potential approaches that I'm considering. The first is to make all problem-specific functions (whether they run on CPU or GPU) into static functions of a single class. The second is to make all CPU problem-specific functions be members of that class, but have the problem-specific GPU kernels be stand alone functions that use templating based on that class. See Source/ProblemSpecificFunctions.H and MassCons/prob.H for examples (set_problem_tags is the former, set_isothermal_wall_temperature is the latter). Let me know which approach you prefer.

@baperry2 baperry2 force-pushed the prob-specific-template branch from 77ef7a4 to 9e8b09e Compare March 14, 2024 00:30
@baperry2 baperry2 requested a review from marchdf March 14, 2024 03:50
@baperry2
Copy link
Contributor Author

This should be ready to go now. The first approach described above was chosen.

@baperry2 baperry2 marked this pull request as ready for review March 14, 2024 05:40
amrex::RealVect x = pc_cmp_loc({AMREX_D_DECL(i, j, k)}, geomdata);
pc_transcoeff(
get_xi, get_mu, get_lam, get_Ddiag, get_chi, T, rho, Y, Ddiag,
chi_mix, muloc, xiloc, lamloc, ltransparm, *lprobparm, x);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I get the trickiness you had to figure out... I guess the only bummer is the extra stuff that needs to be initialized/used here. Duplicate stuff from pelephysics. But there's probably no other good way.

@marchdf
Copy link
Contributor

marchdf commented Mar 14, 2024

Great work! Well done. I had some minor comments.

@baperry2 baperry2 enabled auto-merge (squash) March 14, 2024 22:50
@baperry2 baperry2 merged commit f08c8a7 into AMReX-Combustion:development Mar 15, 2024
14 checks passed
@baperry2 baperry2 deleted the prob-specific-template branch April 18, 2024 21:57
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

Successfully merging this pull request may close these issues.

2 participants