Skip to content

Commit 51542c8

Browse files
Multi-materials and derived variable output (#2888)
## Summary Output small plots if only derived variables are specified. Also, make DeriveFuncFab a std::function<> instead of plain function-pointer. ## Additional background We have been implementing small-plots for outputing variables at gauges (e.g. pressure at specific gauge locations). We may want to output the derived variable pressure only, and not all state-variables. The if-condition was incorrect in this case. Further, multi-material simulations require a material index in order to compute derived variables, in addition to existing parameters. Making DeriveFuncFab a std::function is sufficient for our purposes.
1 parent ce0fb74 commit 51542c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Src/Amr/AMReX_Amr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ Amr::writeSmallPlotFile ()
910910

911911
// Don't continue if we have no variables to plot.
912912

913-
if (stateSmallPlotVars().size() == 0) {
913+
if (stateSmallPlotVars().size() == 0 && deriveSmallPlotVars().size() == 0) {
914914
return;
915915
}
916916

Src/Amr/AMReX_Derive.H

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ extern "C"
8484
const int* level, const int* grid_no) ;
8585
}
8686

87-
typedef void (*DeriveFuncFab) (const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int ncomp,
88-
const amrex::FArrayBox& datafab, const amrex::Geometry& geomdata,
89-
amrex::Real time, const int* bcrec, int level);
87+
typedef std::function<void(const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int ncomp,
88+
const amrex::FArrayBox& datafab, const amrex::Geometry& geomdata,
89+
amrex::Real time, const int* bcrec, int level)> DeriveFuncFab;
9090

9191
class DescriptorList;
9292

0 commit comments

Comments
 (0)