ABLATE Source Documentation  0.12.34
dynamicRange.hpp
1 #ifndef ABLATELIBRARY_DYNAMICRANGE_HPP
2 #define ABLATELIBRARY_DYNAMICRANGE_HPP
3 #include <vector>
4 #include "petsc.h"
5 #include "range.hpp"
6 
7 namespace ablate::domain {
8 
12 class DynamicRange {
13  private:
14  // The points in this range
15  std::vector<PetscInt> points;
16 
17  // the updated range object
19 
20  public:
25  inline void Add(PetscInt p) { points.push_back(p); }
26 
31  inline const ablate::domain::Range& GetRange() {
32  range.points = points.data();
33  range.start = 0;
34  range.end = (PetscInt)points.size();
35  return range;
36  }
37 };
38 } // namespace ablate::domain
39 #endif // ABLATELIBRARY_RANGE_HPP
Definition: dynamicRange.hpp:12
const ablate::domain::Range & GetRange()
Definition: dynamicRange.hpp:31
void Add(PetscInt p)
Definition: dynamicRange.hpp:25
Definition: range.hpp:11