Commit 61415755 authored by mattijs's avatar mattijs
Browse files

BUG: cellCellStencil: use before mesh.update. Fixes #1028.

parent 8e82e7b8
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -55,12 +55,7 @@ typedef MeshObject
class cellCellStencilObject
:
public MeshObject
<
fvMesh,
MoveableMeshObject,
cellCellStencilObject
>,
public Stencil,
public cellCellStencil
{
// Private data
......
......@@ -44,6 +44,15 @@ namespace Foam
bool Foam::dynamicOversetFvMesh::updateAddressing() const
{
const cellCellStencilObject& overlap = Stencil::New(*this);
// Make sure that stencil is not still in the initial, non-uptodate
// state. This gets triggered by e.g. Poisson wall distance that
// triggers the stencil even though time has not been updated (and hence
// mesh.update() has not been called.
if (!stencilIsUpToDate_)
{
stencilIsUpToDate_ = true;
const_cast<cellCellStencilObject&>(overlap).update();
}
// The (processor-local part of the) stencil determines the local
// faces to add to the matrix. tbd: parallel
......@@ -227,6 +236,7 @@ Foam::dynamicOversetFvMesh::dynamicOversetFvMesh(const IOobject& io)
{
// Load stencil (but do not update)
(void)Stencil::New(*this, false);
stencilIsUpToDate_ = false;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -65,6 +65,8 @@ protected:
// lduAddressing (true)
mutable bool active_;
mutable bool stencilIsUpToDate_;
//- Extended addressing (extended with local interpolation stencils)
mutable autoPtr<fvMeshPrimitiveLduAddressing> lduPtr_;
......
Markdown is supported
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