Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
TimeIntegrator.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Maikel Nadolski
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef FUB_AMREX_HYPERBOLIC_SPLIT_TIME_INTEGRATOR_HPP
22 #define FUB_AMREX_HYPERBOLIC_SPLIT_TIME_INTEGRATOR_HPP
23 
25 #include "fub/Direction.hpp"
26 #include "fub/Duration.hpp"
27 #include "fub/State.hpp"
28 
29 #include <AMReX.H>
30 #include <AMReX_Geometry.H>
31 #include <AMReX_MultiFab.H>
32 
33 #include <memory>
34 
35 namespace fub::amrex {
36 
37 template <typename Tag> struct ForwardIntegrator {
38  ForwardIntegrator() = default;
39  explicit ForwardIntegrator(Tag) {}
40 
41  void UpdateConservatively(::amrex::MultiFab& dest,
42  const ::amrex::MultiFab& src,
43  const ::amrex::MultiFab& fluxes,
44  const ::amrex::Geometry& geom, Duration dt,
45  Direction dir);
46 
47  void UpdateConservatively(IntegratorContext& context, int level, Duration dt,
48  Direction dir);
49 };
50 
52 
53 extern template struct ForwardIntegrator<execution::SequentialTag>;
54 extern template struct ForwardIntegrator<execution::OpenMpTag>;
55 extern template struct ForwardIntegrator<execution::SimdTag>;
56 extern template struct ForwardIntegrator<execution::OpenMpSimdTag>;
57 
60  return {};
61 }
62 
63 template <typename Tag> ForwardIntegrator<Tag> EulerForwardTimeIntegrator(Tag) {
64  return {};
65 }
66 
67 } // namespace fub::amrex
68 
69 #endif
This class is used by the HypebrolicSplitLevelIntegrator and delegates AMR related tasks to the AMReX...
Definition: AMReX/IntegratorContext.hpp:49
The amrex namespace.
Definition: AverageState.hpp:33
ForwardIntegrator< Tag > EulerForwardTimeIntegrator(Tag)
Definition: TimeIntegrator.hpp:63
ForwardIntegrator() -> ForwardIntegrator< execution::OpenMpSimdTag >
std::chrono::duration< double > Duration
Definition: Duration.hpp:31
Direction
This is a type safe type to denote a dimensional split direction.
Definition: Direction.hpp:30
Definition: TimeIntegrator.hpp:37
ForwardIntegrator(Tag)
Definition: TimeIntegrator.hpp:39
void UpdateConservatively(::amrex::MultiFab &dest, const ::amrex::MultiFab &src, const ::amrex::MultiFab &fluxes, const ::amrex::Geometry &geom, Duration dt, Direction dir)
void UpdateConservatively(IntegratorContext &context, int level, Duration dt, Direction dir)
Definition: Execution.hpp:39