mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-31 09:44:07 -05:00
replace std::count_if with std::ranges::count_if where appropriate
the c++-20 constrained algorithm is safer and code is more readable
This commit is contained in:
1 parent
4b2a574727
commit
7f848ed396
2 files changed
+6
-5
No files matched your search
@@ -232,8 +232,9 @@ void printDomainDistributionSummary(
|
||||
const int owned_cells = partition_vector.size();
|
||||
|
||||
// Count overlap cells using grid view iteration
|
||||
int overlap_cells = std::count_if(elements(gridView).begin(), elements(gridView).end(),
|
||||
[](const auto& cell) { return cell.partitionType() == Dune::OverlapEntity; });
|
||||
int overlap_cells = std::ranges::count_if(elements(gridView),
|
||||
[](const auto& cell)
|
||||
{ return cell.partitionType() == Dune::OverlapEntity; });
|
||||
|
||||
// Store data for summary output
|
||||
local_reports_accumulated.success.num_wells = num_wells;
|
||||
|
||||
@@ -1795,9 +1795,9 @@ int BlackoilWellModelGeneric<Scalar, IndexTraits>::numLocalWellsEnd() const
|
||||
{
|
||||
const auto& wnames = schedule().back().well_order().names();
|
||||
|
||||
return std::count_if(wnames.begin(), wnames.end(),
|
||||
[this](const std::string& wname)
|
||||
{ return ! this->not_on_process_(wname); });
|
||||
return std::ranges::count_if(wnames,
|
||||
[this](const std::string& wname)
|
||||
{ return ! this->not_on_process_(wname); });
|
||||
}
|
||||
|
||||
template<typename Scalar, typename IndexTraits>
|
||||
|
||||
Reference in new issue
Block a user