ABLATE Source Documentation  0.12.33
range.hpp
1 #ifndef ABLATELIBRARY_RANGE_HPP
2 #define ABLATELIBRARY_RANGE_HPP
3 #include "petsc.h"
4 #include "region.hpp"
5 
6 namespace ablate::domain {
7 
11 struct Range {
12  IS is = nullptr;
13  PetscInt start{};
14  PetscInt end{};
15  const PetscInt *points = nullptr;
16 
22  [[nodiscard]] inline PetscInt GetPoint(PetscInt i) const { return points ? points[i] : i; }
23 };
24 
32 void GetRange(DM dm, const std::shared_ptr<Region> &region, PetscInt depth, Range &range);
33 
40 void GetCellRange(DM dm, const std::shared_ptr<Region> &region, Range &cellRange);
41 
48 void GetFaceRange(DM dm, const std::shared_ptr<Region> &region, Range &faceRange);
49 
54 void RestoreRange(Range &range);
55 
56 } // namespace ablate::domain
57 #endif // ABLATELIBRARY_RANGE_HPP
Definition: range.hpp:11
PetscInt GetPoint(PetscInt i) const
Definition: range.hpp:22