Adhere to CamelCase for types, functions, and variables.

This seems to be covered for types and functions by our coding style
with room for interpretation. For variables the coding styles asks for
underlines though, but nevermind.
This commit is contained in:
Markus Blatt
2019-01-16 12:21:07 +01:00
parent fb0f04d814
commit ace49a2c22

View File

@@ -91,9 +91,9 @@ class EclTransmissibility
static const unsigned elemIdxShift = 32; // bits static const unsigned elemIdxShift = 32; // bits
using NncData = Opm::NNCdata;
public: public:
using NNCdata = Opm::NNCdata;
EclTransmissibility(const Vanguard& vanguard) EclTransmissibility(const Vanguard& vanguard)
: vanguard_(vanguard) : vanguard_(vanguard)
@@ -386,7 +386,7 @@ public:
globalToLocal[cartElemIdx] = elemIdx; globalToLocal[cartElemIdx] = elemIdx;
} }
applyEditNNCToGridTrans_(elemMapper, globalToLocal); applyEditNNCToGridTrans_(elemMapper, globalToLocal);
applyNNCToGridTrans_(globalToLocal); applyNncToGridTrans_(globalToLocal);
//remove very small non-neighbouring transmissibilities //remove very small non-neighbouring transmissibilities
removeSmallNonCartesianTransmissibilities_(); removeSmallNonCartesianTransmissibilities_();
@@ -598,62 +598,62 @@ private:
/// \return Two vector of NNCs (scaled with EDITNNC). The first one are the NNCs that have been applied /// \return Two vector of NNCs (scaled with EDITNNC). The first one are the NNCs that have been applied
/// and the second the NNCs not resembled by faces of the grid. NNCs specified for /// and the second the NNCs not resembled by faces of the grid. NNCs specified for
/// inactive cells are omitted in these vectors. /// inactive cells are omitted in these vectors.
std::tuple<std::vector<NNCdata>, std::vector<NNCdata> > std::tuple<std::vector<NncData>, std::vector<NncData> >
applyNNCToGridTrans_(const std::vector<int>& cartesianToCompressed) applyNncToGridTrans_(const std::vector<int>& cartesianToCompressed)
{ {
// First scale NNCs with EDITNNC. // First scale NNCs with EDITNNC.
std::vector<NNCdata> processed_nnc, unprocessed_nnc; std::vector<NncData> processedNnc, unprocessedNnc;
const auto& nnc = vanguard_.eclState().getInputNNC(); const auto& nnc = vanguard_.eclState().getInputNNC();
if ( ! nnc.hasNNC() ) if ( ! nnc.hasNNC() )
{ {
return make_tuple(processed_nnc, unprocessed_nnc); return make_tuple(processedNnc, unprocessedNnc);
} }
auto nnc_data = nnc.nncdata(); auto nncData = nnc.nncdata();
auto editnnc_data = vanguard_.eclState().getInputEDITNNC().data(); auto editnncData = vanguard_.eclState().getInputEDITNNC().data();
auto compare = [](const NNCdata& d1, const NNCdata& d2){ auto nncLess = [](const NncData& d1, const NncData& d2){
return ( d1.cell1 < d2.cell1 ) || return ( d1.cell1 < d2.cell1 ) ||
( d1.cell1 == d2.cell1 && d1.cell2 < d2.cell2 ); ( d1.cell1 == d2.cell1 && d1.cell2 < d2.cell2 );
}; };
std::sort(nnc_data.begin(), nnc_data.end(), compare); std::sort(nncData.begin(), nncData.end(), nncLess);
auto candidate = nnc_data.begin(); auto candidate = nncData.begin();
for ( const auto& edit: editnnc_data ) for ( const auto& edit: editnncData )
{ {
auto print_nnc_warning = [](int c1, int c2){ auto printNncWarning = [](int c1, int c2){
std::ostringstream sstr; std::ostringstream sstr;
sstr << "Cannot edit NNC from " << c1 << " to " << c2 sstr << "Cannot edit NNC from " << c1 << " to " << c2
<< " as it does not exist"; << " as it does not exist";
Opm::OpmLog::warning(sstr.str()); Opm::OpmLog::warning(sstr.str());
}; };
if ( candidate == nnc_data.end() ) if ( candidate == nncData.end() )
{ {
// no more NNCs left // no more NNCs left
print_nnc_warning(edit.cell1, edit.cell2); printNncWarning(edit.cell1, edit.cell2);
continue; continue;
} }
if ( candidate->cell1 != edit.cell1 || candidate->cell2 != edit.cell2 ) if ( candidate->cell1 != edit.cell1 || candidate->cell2 != edit.cell2 )
{ {
candidate = std::lower_bound(candidate, nnc_data.end(), NNCdata(edit.cell1, edit.cell2, 0), compare); candidate = std::lower_bound(candidate, nncData.end(), NncData(edit.cell1, edit.cell2, 0), nncLess);
if ( candidate == nnc_data.end() ) if ( candidate == nncData.end() )
{ {
// no more NNCs left // no more NNCs left
print_nnc_warning(edit.cell1, edit.cell2); printNncWarning(edit.cell1, edit.cell2);
continue; continue;
} }
} }
auto first_candidate = candidate; auto firstCandidate = candidate;
while ( candidate != nnc_data.end() && candidate->cell1 == edit.cell1 && candidate->cell2 == edit.cell2 ) while ( candidate != nncData.end() && candidate->cell1 == edit.cell1 && candidate->cell2 == edit.cell2 )
{ {
candidate->trans *= edit.trans; candidate->trans *= edit.trans;
++candidate; ++candidate;
} }
// start with first match in next iteration to catch case where next // start with first match in next iteration to catch case where next
// EDITNNC is for same pair. // EDITNNC is for same pair.
candidate = first_candidate; candidate = firstCandidate;
} }
for (const auto& nnc_entry : nnc.nncdata()) for (const auto& nncEntry : nnc.nncdata())
{ {
auto c1 = nnc_entry.cell1, c2 = nnc_entry.cell2; auto c1 = nncEntry.cell1, c2 = nncEntry.cell2;
auto low = cartesianToCompressed[c1], high = cartesianToCompressed[c2]; auto low = cartesianToCompressed[c1], high = cartesianToCompressed[c2];
if ( low > high) if ( low > high)
@@ -679,18 +679,18 @@ private:
{ {
// This NNC is not resembled by the grid. Save it for later // This NNC is not resembled by the grid. Save it for later
// processing with local cell values // processing with local cell values
unprocessed_nnc.push_back({c1, c2, nnc_entry.trans}); unprocessedNnc.push_back({c1, c2, nncEntry.trans});
} }
else else
{ {
// NNC is represented by the grid and might be a neighboring connection // NNC is represented by the grid and might be a neighboring connection
// In this case the transmissibilty is added to the value already // In this case the transmissibilty is added to the value already
// set or computed. // set or computed.
candidate->second += nnc_entry.trans; candidate->second += nncEntry.trans;
processed_nnc.push_back({c1, c2, nnc_entry.trans}); processedNnc.push_back({c1, c2, nncEntry.trans});
} }
} }
return make_tuple(processed_nnc, unprocessed_nnc); return make_tuple(processedNnc, unprocessedNnc);
} }
/// \brief Multiplies the grid transmissibilities according to EDITNNC. /// \brief Multiplies the grid transmissibilities according to EDITNNC.