mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
variableState: Don't form objects when references suffice
There's no need to form new objects, especially for the 'xvar', when there are existing objects to which read-only references can be bound.
This commit is contained in:
parent
eccc5c9694
commit
78b87b8857
@ -530,10 +530,10 @@ namespace {
|
|||||||
|
|
||||||
if (active_[ Gas]) {
|
if (active_[ Gas]) {
|
||||||
// Define Sg Rs and Rv in terms of xvar.
|
// Define Sg Rs and Rv in terms of xvar.
|
||||||
ADB rsSat = fluidRsSat(state.pressure, cells_);
|
const ADB& rsSat = fluidRsSat(state.pressure, cells_);
|
||||||
ADB rvSat = fluidRvSat(state.pressure, cells_);
|
const ADB& rvSat = fluidRvSat(state.pressure, cells_);
|
||||||
ADB xvar = vars[ nextvar++ ];
|
const ADB& xvar = vars[ nextvar++ ];
|
||||||
ADB sg = isSg*xvar + isRv* so;
|
const ADB& sg = isSg*xvar + isRv* so;
|
||||||
state.saturation[ pu.phase_pos[ Gas ] ] = sg;
|
state.saturation[ pu.phase_pos[ Gas ] ] = sg;
|
||||||
so = so - sg;
|
so = so - sg;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user