Skip to content

Commit

Permalink
Reduce Object Copying
Browse files Browse the repository at this point in the history
In particular, switch to taking parameters as reference to 'const'
where possible, and return references where meaningful.
Furthermore, construct objects in place where possible and reduce
object scopes.
  • Loading branch information
bska committed Dec 19, 2024
1 parent 07f881a commit 7876d12
Show file tree
Hide file tree
Showing 9 changed files with 826 additions and 667 deletions.
810 changes: 437 additions & 373 deletions opm/geomech/Fracture.cpp

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions opm/geomech/Fracture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ class Fracture
void setFractureGrid(std::unique_ptr<Fracture::Grid>& gptr); // a hack to allow use of another grid
std::vector<std::tuple<int, double, double>> wellIndices() const;
WellInfo& wellInfo(){return wellinfo_;}
const WellInfo& wellInfo() const {return wellinfo_;}
std::vector<double> leakOfRate() const;
double injectionPressure() const;
void setPerfPressure(double perfpressure){perf_pressure_ = perfpressure;}
Dune::FieldVector<double, 6> stress(Dune::FieldVector<double, 3> obs) const;
Dune::FieldVector<double, 6> strain(Dune::FieldVector<double, 3> obs) const;
Dune::FieldVector<double, 3> disp(Dune::FieldVector<double, 3> obs) const;
Dune::FieldVector<double, 6> stress(const Dune::FieldVector<double, 3>& obs) const;
Dune::FieldVector<double, 6> strain(const Dune::FieldVector<double, 3>& obs) const;
Dune::FieldVector<double, 3> disp(const Dune::FieldVector<double, 3>& obs) const;

private:
Dune::BlockVector<Dune::FieldVector<double, 3>> all_slips() const;
void resetWriters();
Expand Down
Loading

0 comments on commit 7876d12

Please sign in to comment.