mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Transmissibility::update: use ThreadSafeMapBuilder for transBoundary
this in preparation for multithreading the loop
This commit is contained in:
@@ -23,22 +23,25 @@
|
||||
#ifndef OPM_TRANSMISSIBILITY_IMPL_HPP
|
||||
#define OPM_TRANSMISSIBILITY_IMPL_HPP
|
||||
|
||||
#ifndef OPM_TRANSMISSIBILITY_HPP
|
||||
#include <config.h>
|
||||
#include <opm/simulators/flow/Transmissibility.hpp>
|
||||
#endif
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/grid/common/mcmgmapper.hh>
|
||||
|
||||
#include <opm/common/OpmLog/KeywordLocation.hpp>
|
||||
#include <opm/common/utility/ThreadSafeMapBuilder.hpp>
|
||||
|
||||
#include <opm/grid/CpGrid.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/KeywordLocation.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/TransMult.hpp>
|
||||
#include <opm/input/eclipse/Units/Units.hpp>
|
||||
|
||||
#include <opm/simulators/flow/Transmissibility.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
@@ -53,6 +56,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace details {
|
||||
@@ -279,6 +284,9 @@ update(bool global, const TransUpdateQuantities update_quantities,
|
||||
prop);
|
||||
};
|
||||
|
||||
ThreadSafeMapBuilder transBoundary(transBoundary_, 1,
|
||||
MapBuilderInsertionMode::Insert_Or_Assign);
|
||||
|
||||
// compute the transmissibilities for all intersections
|
||||
for (const auto& elem : elements(gridView_)) {
|
||||
FaceInfo inside;
|
||||
@@ -339,7 +347,7 @@ update(bool global, const TransUpdateQuantities update_quantities,
|
||||
// averaged. on the grid boundary there only is the half
|
||||
// transmissibility of the interior element.
|
||||
applyMultipliers_(transBoundaryIs, intersection.indexInInside(), inside.cartElemIdx, transMult);
|
||||
transBoundary_.insert_or_assign(std::make_pair(inside.elemIdx, boundaryIsIdx), transBoundaryIs);
|
||||
transBoundary.insert_or_assign(std::make_pair(inside.elemIdx, boundaryIsIdx), transBoundaryIs);
|
||||
|
||||
// for boundary intersections we also need to compute the thermal
|
||||
// half transmissibilities
|
||||
@@ -476,9 +484,10 @@ update(bool global, const TransUpdateQuantities update_quantities,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
centroids_cache_.clear();
|
||||
|
||||
transBoundary.finalize();
|
||||
|
||||
// Potentially overwrite and/or modify transmissibilities based on input from deck
|
||||
this->updateFromEclState_(global);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user