Skip to content

Better Problem Specific Function capability#743

Merged
baperry2 merged 27 commits intoAMReX-Combustion:developmentfrom
baperry2:prob-specific-template
Mar 15, 2024
Merged

Better Problem Specific Function capability#743
baperry2 merged 27 commits intoAMReX-Combustion:developmentfrom
baperry2:prob-specific-template

Conversation

@baperry2
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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.

3 participants