Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
CartesianPatchHierarchy.hpp
Go to the documentation of this file.
1 // Copyright (c) 2018 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_SAMRAI_CARTESIAN_PATCH_HIERARCHY_HPP
22 #define FUB_SAMRAI_CARTESIAN_PATCH_HIERARCHY_HPP
23 
25 
26 #include <SAMRAI/geom/CartesianPatchGeometry.h>
27 #include <SAMRAI/hier/PatchHierarchy.h>
28 
29 #include <array>
30 #include <memory>
31 
32 namespace SAMRAI {
33 namespace geom {
34 
35 class CartesianPatchGeometry;
36 
37 }
38 } // namespace SAMRAI
39 
40 namespace fub {
41 namespace samrai {
42 
44  std::array<double, 3> lower;
45  std::array<double, 3> upper;
46 };
47 
50  std::array<int, 3> periodic_dimensions{0, 0, 0};
51 };
52 
53 std::shared_ptr<SAMRAI::hier::PatchHierarchy>
55  const CoordinatesRange& x_up,
56  const HierarchyOptions& options);
57 
58 SAMRAI::geom::CartesianPatchGeometry*
59 GetCartesianPatchGeometry(const SAMRAI::hier::Patch& patch);
60 
61 CartesianCoordinates GetCartesianCoordinates(const SAMRAI::hier::Patch& patch);
62 
64  explicit CartesianPatchCoordinates(const SAMRAI::hier::Patch& patch);
65 
66  std::array<double, 3> operator()(const SAMRAI::hier::Index& index) const;
67 
68  SAMRAI::geom::CartesianPatchGeometry* geometry_;
70 };
71 
72 } // namespace samrai
73 } // namespace fub
74 
75 #endif
This class handles uniform cartesian cell coordinates.
Definition: CartesianCoordinates.hpp:33
SAMRAI::geom::CartesianPatchGeometry * GetCartesianPatchGeometry(const SAMRAI::hier::Patch &patch)
CartesianCoordinates GetCartesianCoordinates(const SAMRAI::hier::Patch &patch)
std::shared_ptr< SAMRAI::hier::PatchHierarchy > CartesianPatchHierarchy(const SAMRAI::hier::Box &box, const CoordinatesRange &x_up, const HierarchyOptions &options)
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
std::array< std::ptrdiff_t, static_cast< std::size_t >(Rank)> Index
Definition: PatchDataView.hpp:34
IndexBox< Rank > Box(const BasicView< State, Layout, Rank > &view)
Definition: State.hpp:486
std::ptrdiff_t index
Definition: type_traits.hpp:179
Definition: CartesianPatchHierarchy.hpp:63
std::array< double, 3 > operator()(const SAMRAI::hier::Index &index) const
SAMRAI::geom::CartesianPatchGeometry * geometry_
Definition: CartesianPatchHierarchy.hpp:68
CartesianPatchCoordinates(const SAMRAI::hier::Patch &patch)
SAMRAI::hier::Box box_
Definition: CartesianPatchHierarchy.hpp:69
Definition: CartesianPatchHierarchy.hpp:43
std::array< double, 3 > lower
Definition: CartesianPatchHierarchy.hpp:44
std::array< double, 3 > upper
Definition: CartesianPatchHierarchy.hpp:45
Definition: CartesianPatchHierarchy.hpp:48
int max_number_of_levels
Definition: CartesianPatchHierarchy.hpp:49
std::array< int, 3 > periodic_dimensions
Definition: CartesianPatchHierarchy.hpp:50