Remove m_ prefix from local variables

This commit is contained in:
Joakim Hove 2019-04-11 13:13:38 +02:00
parent 4b657fc4cf
commit dbff25f79b

View File

@ -45,68 +45,68 @@ namespace Opm {
if (!deck.hasKeyword("AQUANCON"))
return;
std::vector<Opm::AquanconRecord> m_aqurecord;
std::vector<Opm::AquanconRecord> aqurecords;
// Aquifer ID per record
std::vector<int> m_aquiferID_per_record;
std::vector<int> aquiferID_per_record;
int m_maxAquID = 0;
const auto& aquanconKeyword = deck.getKeyword("AQUANCON");
// Resize the parameter vector container based on row entries in aquancon
m_aqurecord.resize(aquanconKeyword.size());
m_aquiferID_per_record.resize(aquanconKeyword.size());
aqurecords.resize(aquanconKeyword.size());
aquiferID_per_record.resize(aquanconKeyword.size());
// We now do a loop over each record entry in aquancon
for (size_t aquanconRecordIdx = 0; aquanconRecordIdx < aquanconKeyword.size(); ++aquanconRecordIdx)
{
const auto& aquanconRecord = aquanconKeyword.getRecord(aquanconRecordIdx);
m_aquiferID_per_record.at(aquanconRecordIdx) = aquanconRecord.getItem("AQUIFER_ID").template get<int>(0);
aquiferID_per_record.at(aquanconRecordIdx) = aquanconRecord.getItem("AQUIFER_ID").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).i1 = aquanconRecord.getItem("I1").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).i2 = aquanconRecord.getItem("I2").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).j1 = aquanconRecord.getItem("J1").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).j2 = aquanconRecord.getItem("J2").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).k1 = aquanconRecord.getItem("K1").template get<int>(0);
m_aqurecord.at(aquanconRecordIdx).k2 = aquanconRecord.getItem("K2").template get<int>(0);
aqurecords.at(aquanconRecordIdx).i1 = aquanconRecord.getItem("I1").template get<int>(0);
aqurecords.at(aquanconRecordIdx).i2 = aquanconRecord.getItem("I2").template get<int>(0);
aqurecords.at(aquanconRecordIdx).j1 = aquanconRecord.getItem("J1").template get<int>(0);
aqurecords.at(aquanconRecordIdx).j2 = aquanconRecord.getItem("J2").template get<int>(0);
aqurecords.at(aquanconRecordIdx).k1 = aquanconRecord.getItem("K1").template get<int>(0);
aqurecords.at(aquanconRecordIdx).k2 = aquanconRecord.getItem("K2").template get<int>(0);
m_aquiferID_per_record.at(aquanconRecordIdx) = aquanconRecord.getItem("AQUIFER_ID").template get<int>(0);
m_maxAquID = (m_maxAquID < m_aquiferID_per_record.at(aquanconRecordIdx) )?
m_aquiferID_per_record.at(aquanconRecordIdx) : m_maxAquID;
aquiferID_per_record.at(aquanconRecordIdx) = aquanconRecord.getItem("AQUIFER_ID").template get<int>(0);
m_maxAquID = (m_maxAquID < aquiferID_per_record.at(aquanconRecordIdx) )?
aquiferID_per_record.at(aquanconRecordIdx) : m_maxAquID;
double influx_mult = aquanconRecord.getItem("INFLUX_MULT").getSIDouble(0);
FaceDir::DirEnum faceDir = FaceDir::FromString(aquanconRecord.getItem("FACE").getTrimmedString(0));
// Loop over the cartesian indices to convert to the global grid index
for (int k=m_aqurecord.at(aquanconRecordIdx).k1; k <= m_aqurecord.at(aquanconRecordIdx).k2; k++) {
for (int j=m_aqurecord.at(aquanconRecordIdx).j1; j <= m_aqurecord.at(aquanconRecordIdx).j2; j++)
for (int i=m_aqurecord.at(aquanconRecordIdx).i1; i <= m_aqurecord.at(aquanconRecordIdx).i2; i++)
m_aqurecord.at(aquanconRecordIdx).global_index_per_record.push_back
for (int k=aqurecords.at(aquanconRecordIdx).k1; k <= aqurecords.at(aquanconRecordIdx).k2; k++) {
for (int j=aqurecords.at(aquanconRecordIdx).j1; j <= aqurecords.at(aquanconRecordIdx).j2; j++)
for (int i=aqurecords.at(aquanconRecordIdx).i1; i <= aqurecords.at(aquanconRecordIdx).i2; i++)
aqurecords.at(aquanconRecordIdx).global_index_per_record.push_back
(
grid.getGlobalIndex(i-1, j-1, k-1)
);
}
size_t global_index_per_record_size = m_aqurecord.at(aquanconRecordIdx).global_index_per_record.size();
size_t global_index_per_record_size = aqurecords.at(aquanconRecordIdx).global_index_per_record.size();
m_aqurecord.at(aquanconRecordIdx).influx_coeff_per_record.resize(global_index_per_record_size, nullptr);
aqurecords.at(aquanconRecordIdx).influx_coeff_per_record.resize(global_index_per_record_size, nullptr);
if (aquanconRecord.getItem("INFLUX_COEFF").hasValue(0))
{
const double influx_coeff = aquanconRecord.getItem("INFLUX_COEFF").getSIDouble(0);
for (auto& influx: m_aqurecord.at(aquanconRecordIdx).influx_coeff_per_record)
for (auto& influx: aqurecords.at(aquanconRecordIdx).influx_coeff_per_record)
{
influx.reset(new double(influx_coeff));
}
}
m_aqurecord.at(aquanconRecordIdx).influx_mult_per_record.resize(global_index_per_record_size,influx_mult);
m_aqurecord.at(aquanconRecordIdx).face_per_record.resize(global_index_per_record_size,faceDir);
m_aqurecord.at(aquanconRecordIdx).record_index_per_record.resize(global_index_per_record_size,aquanconRecordIdx);
aqurecords.at(aquanconRecordIdx).influx_mult_per_record.resize(global_index_per_record_size,influx_mult);
aqurecords.at(aquanconRecordIdx).face_per_record.resize(global_index_per_record_size,faceDir);
aqurecords.at(aquanconRecordIdx).record_index_per_record.resize(global_index_per_record_size,aquanconRecordIdx);
}
// Collate_function
collate_function(m_aquoutput, m_aqurecord, m_aquiferID_per_record, m_maxAquID);
collate_function(m_aquoutput, aqurecords, aquiferID_per_record, m_maxAquID);
// Logic for grid connection applied here
m_aquoutput = logic_application(m_aquoutput);
@ -115,8 +115,8 @@ namespace Opm {
// This function is used to convert from a per record vector to a per aquifer ID vector.
void Aquancon::collate_function(std::vector<Aquancon::AquanconOutput>& output_vector,
std::vector<Opm::AquanconRecord>& m_aqurecord,
std::vector<int> m_aquiferID_per_record, int m_maxAquID)
std::vector<Opm::AquanconRecord>& aqurecords,
std::vector<int> aquiferID_per_record, int m_maxAquID)
{
output_vector.resize(m_maxAquID);
// Find record indices at which the aquifer ids are located in
@ -124,7 +124,7 @@ namespace Opm {
{
std::vector<int> result_id;
convert_record_id_to_aquifer_id(result_id, i, m_aquiferID_per_record);
convert_record_id_to_aquifer_id(result_id, i, aquiferID_per_record);
// We add the aquifer id into each element of output_vector
output_vector.at(i - 1).aquiferID = i;
@ -133,32 +133,32 @@ namespace Opm {
// This is for the global indices
output_vector.at(i - 1).global_index.insert(
output_vector.at(i - 1).global_index.end(),
m_aqurecord.at(record_index_matching_id).global_index_per_record.begin(),
m_aqurecord.at(record_index_matching_id).global_index_per_record.end()
aqurecords.at(record_index_matching_id).global_index_per_record.begin(),
aqurecords.at(record_index_matching_id).global_index_per_record.end()
);
// This is for the influx_coeff
output_vector.at(i - 1).influx_coeff.insert(
output_vector.at(i - 1).influx_coeff.end(),
m_aqurecord.at(record_index_matching_id).influx_coeff_per_record.begin(),
m_aqurecord.at(record_index_matching_id).influx_coeff_per_record.end()
aqurecords.at(record_index_matching_id).influx_coeff_per_record.begin(),
aqurecords.at(record_index_matching_id).influx_coeff_per_record.end()
);
// This is for the influx_multiplier
output_vector.at(i - 1).influx_multiplier.insert(
output_vector.at(i - 1).influx_multiplier.end(),
m_aqurecord.at(record_index_matching_id).influx_mult_per_record.begin(),
m_aqurecord.at(record_index_matching_id).influx_mult_per_record.end()
aqurecords.at(record_index_matching_id).influx_mult_per_record.begin(),
aqurecords.at(record_index_matching_id).influx_mult_per_record.end()
);
// This is for the reservoir_face_dir
output_vector.at(i - 1).reservoir_face_dir.insert(
output_vector.at(i - 1).reservoir_face_dir.end(),
m_aqurecord.at(record_index_matching_id).face_per_record.begin(),
m_aqurecord.at(record_index_matching_id).face_per_record.end()
aqurecords.at(record_index_matching_id).face_per_record.begin(),
aqurecords.at(record_index_matching_id).face_per_record.end()
);
// This is for the record index in order for us to know which one is updated
output_vector.at(i - 1).record_index.insert(
output_vector.at(i - 1).record_index.end(),
m_aqurecord.at(record_index_matching_id).record_index_per_record.begin(),
m_aqurecord.at(record_index_matching_id).record_index_per_record.end()
aqurecords.at(record_index_matching_id).record_index_per_record.begin(),
aqurecords.at(record_index_matching_id).record_index_per_record.end()
);
}
}
@ -253,16 +253,16 @@ namespace Opm {
}
void Aquancon::convert_record_id_to_aquifer_id(std::vector<int>& record_indices_matching_id,
int i, std::vector<int> m_aquiferID_per_record)
int i, std::vector<int> aquiferID_per_record)
{
auto it = std::find_if( m_aquiferID_per_record.begin(), m_aquiferID_per_record.end(),
auto it = std::find_if( aquiferID_per_record.begin(), aquiferID_per_record.end(),
[&](int id) {
return id == i;
}
);
while (it != m_aquiferID_per_record.end()) {
record_indices_matching_id.emplace_back(std::distance(m_aquiferID_per_record.begin(), it));
it = std::find_if(std::next(it), m_aquiferID_per_record.end(), [&](int id){return id == i;});
while (it != aquiferID_per_record.end()) {
record_indices_matching_id.emplace_back(std::distance(aquiferID_per_record.begin(), it));
it = std::find_if(std::next(it), aquiferID_per_record.end(), [&](int id){return id == i;});
}
}