From 82702d19cef968c869a2c777fdca401732742dc9 Mon Sep 17 00:00:00 2001 From: "A.N. Colli" <32985001+ancolli@users.noreply.github.com> Date: Sat, 17 May 2025 17:53:55 +0200 Subject: [PATCH] Update isoSurface.C resizing to cope with changing meshes --- .../isoSchemes/isoSurface/isoSurface.C | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C b/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C index 5ea1da50..bf3788b3 100644 --- a/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C +++ b/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C @@ -62,6 +62,7 @@ Foam::reconstruction::isoSurface::isoSurface // Tolerances and solution controls iso_(modelDict().lookupOrAddDefault("iso", 0.5,false,false)) { + reconstruct(); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -80,8 +81,26 @@ void Foam::reconstruction::isoSurface::reconstruct(bool forceUpdate) { return; } + // Interpolating alpha1 cell centre values to mesh points (vertices) + if (mesh_.topoChanging()) + { + // Introduced resizing to cope with changing meshes + if (ap_.size() != mesh_.nPoints()) + { + ap_.resize(mesh_.nPoints()); + + } + if (interfaceCell_.size() != mesh_.nCells()) + { + interfaceCell_.resize(mesh_.nCells()); + } + } ap_ = volPointInterpolation::New(mesh_).interpolate(alpha1_); + + DynamicList> facePts; + + interfaceLabels_.clear(); forAll(alpha1_,cellI) {