Transmissibility: add a cache for centroids and use this in update()

The loops repeatedly calls distanceVector which recalculates
the centroid for a cell. This is not a trivial calculation
This commit is contained in:
Arne Morten Kvarving
2025-01-16 11:53:09 +01:00
parent 635d7d77dd
commit 9a97bf41c5
2 changed files with 12 additions and 1 deletions

View File

@@ -284,6 +284,7 @@ protected:
const CartesianIndexMapper& cartMapper_;
const Grid& grid_;
std::function<std::array<double,dimWorld>(int)> centroids_;
std::vector<std::array<double,dimWorld>> centroids_cache_;
Scalar transmissibilityThreshold_;
std::map<std::pair<unsigned, unsigned>, Scalar> transBoundary_;
std::map<std::pair<unsigned, unsigned>, Scalar> thermalHalfTransBoundary_;