Skip to content
Snippets Groups Projects
Commit 3f19e903 authored by mattijs's avatar mattijs Committed by Mark OLESEN
Browse files

COMP: finiteArea: dangling reference warning

parent bbd6219e
No related merge requests found
......@@ -105,20 +105,13 @@ leastSquaresFaGrad<Type>::calcGrad
{
const faPatchField<Type>& bf = vsf.boundaryField()[patchi];
//const Field<Type>& vsfp =
//(
// bf.coupled()
// ? bf.patchNeighbourField().cref()
// : const_cast<faPatchField<Type>&>(bf)
//);
const tmp<Field<Type>> tvsfp
(
bf.coupled()
? bf.patchNeighbourField()
: bf
);
const Field<Type>& vsfp = tvsfp();
tmp<Field<Type>> tvsfp(bf);
if (bf.coupled())
{
tvsfp = bf.patchNeighbourField();
}
const auto& vsfp = tvsfp();
const faePatchVectorField& ownLsp = ownLs.boundaryField()[patchi];
const labelUList& edgeFaces =
......
......@@ -209,8 +209,8 @@ Foam::edgeInterpolationScheme<Type>::interpolate
label size = vf.boundaryField()[pi].patch().size();
label start = vf.boundaryField()[pi].patch().start();
Field<Type> pOwnVf = vf.boundaryField()[pi].patchInternalField();
Field<Type> pNgbVf = vf.boundaryField()[pi].patchNeighbourField();
Field<Type> pOwnVf(vf.boundaryField()[pi].patchInternalField());
Field<Type> pNgbVf(vf.boundaryField()[pi].patchNeighbourField());
Field<Type>& pSf = sf.boundaryFieldRef()[pi];
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment