adjust to data::CellData changes

This commit is contained in:
Arne Morten Kvarving 2023-12-08 18:26:23 +01:00
parent 3b60e1ef89
commit 7328b91958
4 changed files with 13 additions and 13 deletions

View File

@ -320,7 +320,7 @@ public:
// write all cell data registered in local state
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(buffer, localIndexMap_, data);
@ -333,7 +333,7 @@ public:
// its order governs the order the data got received.
for (auto& pair : localCellData_) {
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
read(buffer, indexMap, data);

View File

@ -633,21 +633,21 @@ setRestart(const data::Solution& sol,
{
Scalar so = 1.0;
if (!saturation_[waterPhaseIdx].empty() && sol.has("SWAT")) {
saturation_[waterPhaseIdx][elemIdx] = sol.data("SWAT")[globalDofIndex];
so -= sol.data("SWAT")[globalDofIndex];
saturation_[waterPhaseIdx][elemIdx] = sol.data<double>("SWAT")[globalDofIndex];
so -= sol.data<double>("SWAT")[globalDofIndex];
}
if (!saturation_[gasPhaseIdx].empty() && sol.has("SGAS")) {
saturation_[gasPhaseIdx][elemIdx] = sol.data("SGAS")[globalDofIndex];
so -= sol.data("SGAS")[globalDofIndex];
saturation_[gasPhaseIdx][elemIdx] = sol.data<double>("SGAS")[globalDofIndex];
so -= sol.data<double>("SGAS")[globalDofIndex];
}
if (!sSol_.empty()) {
// keep the SSOL option for backward compatibility
// should be removed after 10.2018 release
if (sol.has("SSOL"))
sSol_[elemIdx] = sol.data("SSOL")[globalDofIndex];
sSol_[elemIdx] = sol.data<double>("SSOL")[globalDofIndex];
else if (sol.has("SSOLVENT"))
sSol_[elemIdx] = sol.data("SSOLVENT")[globalDofIndex];
sSol_[elemIdx] = sol.data<double>("SSOLVENT")[globalDofIndex];
so -= sSol_[elemIdx];
}
@ -660,7 +660,7 @@ setRestart(const data::Solution& sol,
{
if (!data.empty() && sol.has(name)) {
data[elemIdx] = sol.data(name)[globalDofIndex];
data[elemIdx] = sol.data<double>(name)[globalDofIndex];
}
};

View File

@ -330,18 +330,18 @@ computeTrans_(const std::unordered_map<int,int>& cartesianToActive,
}
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
}
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
}
if ( gc2 - gc1 == cartDims[0]*cartDims[1] ||
directVerticalNeighbors(cartDims, cartesianToActive, gc1, gc2))
tranz.data[gc1] = globalTrans().transmissibility(c1, c2);
tranz.data<double>()[gc1] = globalTrans().transmissibility(c1, c2);
}
}

View File

@ -487,7 +487,7 @@ public:
auto& tracer_model = simulator_.problem().tracerModel();
for (int tracer_index = 0; tracer_index < tracer_model.numTracers(); 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) {
unsigned globalIdx = this->collectToIORank_.localIdxToGlobalIdx(elemIdx);
tracer_model.setTracerConcentration(tracer_index, globalIdx, tracer_solution[globalIdx]);