Skip to content

Commit

Permalink
Write 2D plotfiles for projections (#791)
Browse files Browse the repository at this point in the history
### Description
Writes projections as 2D plotfiles, rather than as 3D plotfiles with one
cell in the 3rd dimension.

### Related issues
Fixes #685.

### Checklist
_Before this pull request can be reviewed, all of these tasks should be
completed. Denote completed tasks with an `x` inside the square brackets
`[ ]` in the Markdown source below:_
- [x] I have added a description (see above).
- [x] I have added a link to any related issues see (see above).
- [x] I have read the [Contributing
Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md).
- [ ] I have added tests for any new physics that this PR adds to the
code.
- [x] I have tested this PR on my local computer and all tests pass.
- [x] I have manually triggered the GPU tests with the magic comment
`/azp run`.
- [x] I have requested a reviewer for this PR.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
BenWibking and pre-commit-ci[bot] authored Nov 8, 2024
1 parent 89c5ad2 commit e470861
Show file tree
Hide file tree
Showing 8 changed files with 726 additions and 110 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ set (QuokkaSourcesNoEOS "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/io/DiagFilter.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/io/DiagFramePlane.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/io/DiagPDF.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/io/projection.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/cooling/GrackleLikeCooling.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/cooling/GrackleDataReader.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/cooling/TabulatedCooling.cpp"
Expand Down
4 changes: 2 additions & 2 deletions src/QuokkaSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ template <typename problem_t> class QuokkaSimulation : public AMRSimulation<prob
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;
[[nodiscard]] auto ComputeProjections(const amrex::Direction 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 @@ -600,7 +600,7 @@ template <typename problem_t> void QuokkaSimulation<problem_t>::ComputeDerivedVa
}

template <typename problem_t>
auto QuokkaSimulation<problem_t>::ComputeProjections(int /*dir*/) const -> std::unordered_map<std::string, amrex::BaseFab<amrex::Real>>
auto QuokkaSimulation<problem_t>::ComputeProjections(const amrex::Direction /*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>>{};
Expand Down
Loading

0 comments on commit e470861

Please sign in to comment.