Skip to content

Fix FV::Div_Par_K_Grad_Par#1341

Merged
bendudson merged 4 commits intonextfrom
fix_FV-Div_par_K_Grad_par
Nov 1, 2018
Merged

Fix FV::Div_Par_K_Grad_Par#1341
bendudson merged 4 commits intonextfrom
fix_FV-Div_par_K_Grad_par

Conversation

@johnomotani
Copy link
Contributor

Previously, fup/fdown and Kup/Kdown fields were defined but not used. The inputs fin and Kin were copied to f and K before checking hasYupYdown(), but since yup_field and ydown_field are not copied in the Field3D assignment operator, the yup/ydown branch could never be used.

Second commit makes K/Kup/Kdown/f/fup/fdown into Field3D& references to avoid copies. Is this better or worse style?

Previously, fup/fdown and Kup/Kdown fields were defined but not used.
The inputs fin and Kin were copied to f and K before checking
hasYupYdown(), but since yup_field and ydown_field are not copied in the
Field3D assignment operator, the yup/ydown branch could never be used.
@ZedThree
Copy link
Member

const& is good, it automatically extends the lifetime of the temporary to the lifetime of the reference.

I might even use const auto& here

}

if (!(K.hasYupYdown() && f.hasYupYdown())) {
if (!(Kin.hasYupYdown() && fin.hasYupYdown())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just use if (!use_yup_ydown) ?

@bendudson bendudson merged commit 17f2864 into next Nov 1, 2018
@bendudson bendudson deleted the fix_FV-Div_par_K_Grad_par branch November 1, 2018 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants