mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adjust to data::CellData changes
This commit is contained in:
parent
3b60e1ef89
commit
7328b91958
@ -320,7 +320,7 @@ public:
|
|||||||
|
|
||||||
// write all cell data registered in local state
|
// write all cell data registered in local state
|
||||||
for (const auto& pair : localCellData_) {
|
for (const auto& pair : localCellData_) {
|
||||||
const auto& data = pair.second.data;
|
const auto& data = pair.second.data<double>();
|
||||||
|
|
||||||
// write all data from local data to buffer
|
// write all data from local data to buffer
|
||||||
write(buffer, localIndexMap_, data);
|
write(buffer, localIndexMap_, data);
|
||||||
@ -333,7 +333,7 @@ public:
|
|||||||
// its order governs the order the data got received.
|
// its order governs the order the data got received.
|
||||||
for (auto& pair : localCellData_) {
|
for (auto& pair : localCellData_) {
|
||||||
const std::string& key = pair.first;
|
const std::string& key = pair.first;
|
||||||
auto& data = globalCellData_.data(key);
|
auto& data = globalCellData_.data<double>(key);
|
||||||
|
|
||||||
//write all data from local cell data to buffer
|
//write all data from local cell data to buffer
|
||||||
read(buffer, indexMap, data);
|
read(buffer, indexMap, data);
|
||||||
|
@ -633,21 +633,21 @@ setRestart(const data::Solution& sol,
|
|||||||
{
|
{
|
||||||
Scalar so = 1.0;
|
Scalar so = 1.0;
|
||||||
if (!saturation_[waterPhaseIdx].empty() && sol.has("SWAT")) {
|
if (!saturation_[waterPhaseIdx].empty() && sol.has("SWAT")) {
|
||||||
saturation_[waterPhaseIdx][elemIdx] = sol.data("SWAT")[globalDofIndex];
|
saturation_[waterPhaseIdx][elemIdx] = sol.data<double>("SWAT")[globalDofIndex];
|
||||||
so -= sol.data("SWAT")[globalDofIndex];
|
so -= sol.data<double>("SWAT")[globalDofIndex];
|
||||||
}
|
}
|
||||||
if (!saturation_[gasPhaseIdx].empty() && sol.has("SGAS")) {
|
if (!saturation_[gasPhaseIdx].empty() && sol.has("SGAS")) {
|
||||||
saturation_[gasPhaseIdx][elemIdx] = sol.data("SGAS")[globalDofIndex];
|
saturation_[gasPhaseIdx][elemIdx] = sol.data<double>("SGAS")[globalDofIndex];
|
||||||
so -= sol.data("SGAS")[globalDofIndex];
|
so -= sol.data<double>("SGAS")[globalDofIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sSol_.empty()) {
|
if (!sSol_.empty()) {
|
||||||
// keep the SSOL option for backward compatibility
|
// keep the SSOL option for backward compatibility
|
||||||
// should be removed after 10.2018 release
|
// should be removed after 10.2018 release
|
||||||
if (sol.has("SSOL"))
|
if (sol.has("SSOL"))
|
||||||
sSol_[elemIdx] = sol.data("SSOL")[globalDofIndex];
|
sSol_[elemIdx] = sol.data<double>("SSOL")[globalDofIndex];
|
||||||
else if (sol.has("SSOLVENT"))
|
else if (sol.has("SSOLVENT"))
|
||||||
sSol_[elemIdx] = sol.data("SSOLVENT")[globalDofIndex];
|
sSol_[elemIdx] = sol.data<double>("SSOLVENT")[globalDofIndex];
|
||||||
|
|
||||||
so -= sSol_[elemIdx];
|
so -= sSol_[elemIdx];
|
||||||
}
|
}
|
||||||
@ -660,7 +660,7 @@ setRestart(const data::Solution& sol,
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (!data.empty() && sol.has(name)) {
|
if (!data.empty() && sol.has(name)) {
|
||||||
data[elemIdx] = sol.data(name)[globalDofIndex];
|
data[elemIdx] = sol.data<double>(name)[globalDofIndex];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -330,18 +330,18 @@ computeTrans_(const std::unordered_map<int,int>& cartesianToActive,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gc2 - gc1 == 1 && cartDims[0] > 1 ) {
|
if (gc2 - gc1 == 1 && cartDims[0] > 1 ) {
|
||||||
tranx.data[gc1] = globalTrans().transmissibility(c1, c2);
|
tranx.data<double>()[gc1] = globalTrans().transmissibility(c1, c2);
|
||||||
continue; // skip other if clauses as they are false, last one needs some computation
|
continue; // skip other if clauses as they are false, last one needs some computation
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gc2 - gc1 == cartDims[0] && cartDims[1] > 1) {
|
if (gc2 - gc1 == cartDims[0] && cartDims[1] > 1) {
|
||||||
trany.data[gc1] = globalTrans().transmissibility(c1, c2);
|
trany.data<double>()[gc1] = globalTrans().transmissibility(c1, c2);
|
||||||
continue; // skipt next if clause as it needs some computation
|
continue; // skipt next if clause as it needs some computation
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gc2 - gc1 == cartDims[0]*cartDims[1] ||
|
if ( gc2 - gc1 == cartDims[0]*cartDims[1] ||
|
||||||
directVerticalNeighbors(cartDims, cartesianToActive, gc1, gc2))
|
directVerticalNeighbors(cartDims, cartesianToActive, gc1, gc2))
|
||||||
tranz.data[gc1] = globalTrans().transmissibility(c1, c2);
|
tranz.data<double>()[gc1] = globalTrans().transmissibility(c1, c2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ public:
|
|||||||
auto& tracer_model = simulator_.problem().tracerModel();
|
auto& tracer_model = simulator_.problem().tracerModel();
|
||||||
for (int tracer_index = 0; tracer_index < tracer_model.numTracers(); tracer_index++) {
|
for (int tracer_index = 0; tracer_index < tracer_model.numTracers(); tracer_index++) {
|
||||||
const auto& tracer_name = tracer_model.fname(tracer_index);
|
const auto& tracer_name = tracer_model.fname(tracer_index);
|
||||||
const auto& tracer_solution = restartValues.solution.data(tracer_name);
|
const auto& tracer_solution = restartValues.solution.template data<double>(tracer_name);
|
||||||
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
||||||
unsigned globalIdx = this->collectToIORank_.localIdxToGlobalIdx(elemIdx);
|
unsigned globalIdx = this->collectToIORank_.localIdxToGlobalIdx(elemIdx);
|
||||||
tracer_model.setTracerConcentration(tracer_index, globalIdx, tracer_solution[globalIdx]);
|
tracer_model.setTracerConcentration(tracer_index, globalIdx, tracer_solution[globalIdx]);
|
||||||
|
Loading…
Reference in New Issue
Block a user