mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: streamFunction: avoid over-eager optimisation (fixes #2603)
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenFOAM Foundation
|
Copyright (C) 2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -64,8 +64,6 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
|
|||||||
& Vector<label>(Vector<label>::X, Vector<label>::Y, Vector<label>::Z)
|
& Vector<label>(Vector<label>::X, Vector<label>::Y, Vector<label>::Z)
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar thickness = vector(slabNormal) & mesh_.bounds().span();
|
|
||||||
|
|
||||||
const pointMesh& pMesh = pointMesh::New(mesh_);
|
const pointMesh& pMesh = pointMesh::New(mesh_);
|
||||||
|
|
||||||
auto tstreamFunction = tmp<pointScalarField>::New
|
auto tstreamFunction = tmp<pointScalarField>::New
|
||||||
@ -395,6 +393,9 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
|
|||||||
} while (!finished);
|
} while (!finished);
|
||||||
|
|
||||||
// Normalise the stream-function by the 2D mesh thickness
|
// Normalise the stream-function by the 2D mesh thickness
|
||||||
|
// calculate thickness here to avoid compiler oddness (#2603)
|
||||||
|
const scalar thickness = vector(slabNormal) & mesh_.bounds().span();
|
||||||
|
|
||||||
streamFunction /= thickness;
|
streamFunction /= thickness;
|
||||||
streamFunction.boundaryFieldRef() = 0.0;
|
streamFunction.boundaryFieldRef() = 0.0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user