Skip to content

Commit

Permalink
Merge pull request boutproject#2038 from boutproject/loc_div_par_k_gr…
Browse files Browse the repository at this point in the history
…ad_par

Add location checks to Div_par_K_Grad_par
  • Loading branch information
ZedThree authored May 27, 2020
2 parents dc737b2 + 635304a commit 1843ba1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mesh/difops.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,26 @@ const Field3D Div_par_K_Grad_par(BoutReal kY, const Field3D &f, CELL_LOC outloc)
}

const Field2D Div_par_K_Grad_par(const Field2D &kY, const Field2D &f, CELL_LOC outloc) {
if (outloc == CELL_DEFAULT) outloc = f.getLocation();

return interp_to(kY, outloc)*Grad2_par2(f, outloc) + Div_par(kY, outloc)*Grad_par(f, outloc);
}

const Field3D Div_par_K_Grad_par(const Field2D &kY, const Field3D &f, CELL_LOC outloc) {
if (outloc == CELL_DEFAULT) outloc = f.getLocation();

return interp_to(kY, outloc)*Grad2_par2(f, outloc) + Div_par(kY, outloc)*Grad_par(f, outloc);
}

const Field3D Div_par_K_Grad_par(const Field3D &kY, const Field2D &f, CELL_LOC outloc) {
if (outloc == CELL_DEFAULT) outloc = f.getLocation();

return interp_to(kY, outloc)*Grad2_par2(f, outloc) + Div_par(kY, outloc)*Grad_par(f, outloc);
}

const Field3D Div_par_K_Grad_par(const Field3D &kY, const Field3D &f, CELL_LOC outloc) {
if (outloc == CELL_DEFAULT) outloc = f.getLocation();

return interp_to(kY, outloc)*Grad2_par2(f, outloc) + Div_par(kY, outloc)*Grad_par(f, outloc);
}

Expand Down

0 comments on commit 1843ba1

Please sign in to comment.