Skip to content

Commit a77baf0

Browse files
committed
Add a comment in resetCartesianMapper
1 parent a085ee1 commit a77baf0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

opm/simulators/utils/ParallelEclipseState.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,14 @@ class ParallelFieldPropsManager : public FieldPropsManager {
102102
template<class T>
103103
void resetCartesianMapper(const T* mapper)
104104
{
105-
m_activeSize = [mapper]() { return mapper->compressedSize(0); };
106-
m_local2Global = [mapper](int localIdx) { return mapper->cartesianIndex(localIdx, 0); };
105+
// Note: mapper would usually be a CartesianIndexMapper. However, to support also
106+
// the case of a distributed level zero grid in a CpGrid with LGRs, mapper will be
107+
// Opm::LevelCartesianIndexMapper. This change allows access to the Cartesian indices
108+
// of the distributed level zero grid, where the field properties are given - for now.
109+
// In case of supporting LGR field properties, this need to be adapted, to access instead
110+
// each local/level Cartesian index set.
111+
m_activeSize = [mapper]() { return mapper->compressedSize(/*level = */ 0); };
112+
m_local2Global = [mapper](int localIdx) { return mapper->cartesianIndex(localIdx, /* level = */ 0); };
107113
}
108114

109115
bool tran_active(const std::string& keyword) const override;

0 commit comments

Comments
 (0)