Skip to content

Commit

Permalink
Merge branch 'development' into update-setonix-config-new
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking authored Sep 9, 2023
2 parents f52c66c + 7ffd65f commit 37aa2d5
Show file tree
Hide file tree
Showing 3 changed files with 268 additions and 9 deletions.
9 changes: 9 additions & 0 deletions src/AdvectionSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ template <typename problem_t> class AdvectionSimulation : public AMRSimulation<p

// compute derived variables
void ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, int ncomp) const override;
// compute projected vars
[[nodiscard]] auto ComputeProjections(int dir) const -> std::unordered_map<std::string, amrex::BaseFab<amrex::Real>> override;

// compute statistics
auto ComputeStatistics() -> std::map<std::string, amrex::Real> override;
Expand Down Expand Up @@ -155,6 +157,13 @@ template <typename problem_t> void AdvectionSimulation<problem_t>::ComputeDerive
// user should implement
}

template <typename problem_t>
auto AdvectionSimulation<problem_t>::ComputeProjections(int /*dir*/) const -> std::unordered_map<std::string, amrex::BaseFab<amrex::Real>>
{
// user should implement
return std::unordered_map<std::string, amrex::BaseFab<amrex::Real>>{};
}

template <typename problem_t>
auto AdvectionSimulation<problem_t>::ComputeStatistics() -> std::map<std::string, amrex::Real>
{
Expand Down
15 changes: 13 additions & 2 deletions src/RadhydroSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <limits>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>

#include "AMReX.H"
Expand Down Expand Up @@ -191,8 +192,11 @@ template <typename problem_t> class RadhydroSimulation : public AMRSimulation<pr
// compute derived variables
void ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, int ncomp) const override;

// compute statistics
auto ComputeStatistics() -> std::map<std::string, amrex::Real> override;
// compute projected vars
[[nodiscard]] auto ComputeProjections(int dir) const -> std::unordered_map<std::string, amrex::BaseFab<amrex::Real>> override;

// compute statistics
auto ComputeStatistics() -> std::map<std::string, amrex::Real> override;

// fix-up states
void FixupState(int level) override;
Expand Down Expand Up @@ -497,6 +501,13 @@ void RadhydroSimulation<problem_t>::ComputeDerivedVar(int lev, std::string const
// compute derived variables and save in 'mf' -- user should implement
}

template <typename problem_t>
auto RadhydroSimulation<problem_t>::ComputeProjections(int /*dir*/) const -> std::unordered_map<std::string, amrex::BaseFab<amrex::Real>>
{
// compute projections and return as unordered_map -- user should implement
return std::unordered_map<std::string, amrex::BaseFab<amrex::Real>>{};
}

template <typename problem_t>
auto RadhydroSimulation<problem_t>::ComputeStatistics() -> std::map<std::string, amrex::Real>
{
Expand Down
Loading

0 comments on commit 37aa2d5

Please sign in to comment.