reconstructParMesh does not handle moving mesh cases with topology changes
Summary
Use reconstructParMesh on a (parallel) case with topo changes. It will crash when trying to recalculate the mesh.phi() before that field has been updated.
Steps to reproduce
Example case
tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop
and use the Allrun-parallel script.
What is the current bug behaviour?
Crash with out-of-bounds error.
Relevant logs and/or images
--> FOAM FATAL ERROR: (openfoam-2212)
index 2275 out of range [0,2275]
From void Foam::UList<T>::checkIndex(Foam::label) const [with T = double; Foam::label = int]
in file /home/pikachu2/mattijs/OpenFOAM/OpenFOAM-plus/work/develop/src/OpenFOAM/lnInclude/UListI.H at line 169.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#1 Foam::error::simpleExit(int, bool) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#2 Foam::error::exiting(int, bool) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#3 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/OpenFOAM/lnInclude/errorManip.H:93 (discriminator 4)
#4 Foam::UList<double>::checkIndex(int) const at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/OpenFOAM/lnInclude/UListI.H:169
#5 Foam::UList<double>::operator[](int) at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/OpenFOAM/lnInclude/UListI.H:304
#6 Foam::fvGeometryScheme::setMeshPhi() const at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C:103 (discriminator 2)
#7 Foam::fvGeometryScheme::movePoints() at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C:159
#8 Foam::basicFvGeometryScheme::movePoints() in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#9 Foam::surfaceInterpolation::updateGeom() in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#10 Foam::primitiveMesh::faceCentres() const in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#11 Foam::polyPatch::faceCentres() const in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#12 Foam::cyclicAMIPolyPatch::calcTransforms() at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C:472
#13 Foam::cyclicAMIPolyPatch::initGeometry(Foam::PstreamBuffers&) at ~/OpenFOAM/OpenFOAM-plus/work/develop/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C:497
#14 Foam::polyBoundaryMesh::calcGeometry() in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#15 Foam::polyMesh::resetPrimitives(Foam::autoPtr<Foam::Field<Foam::Vector<double> > >&&, Foam::autoPtr<Foam::List<Foam::face> >&&, Foam::autoPtr<Foam::List<int> >&&, Foam::autoPtr<Foam::List<int> >&&, Foam::UList<int> const&, Foam::UList<int> const&, bool) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#16 Foam::polyTopoChange::changeMesh(Foam::polyMesh&, Foam::UList<int> const&, bool, bool, bool, bool) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so
#17 Foam::polyTopoChange::changeMesh(Foam::polyMesh&, bool, bool, bool, bool) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so
#18 Foam::fvMeshAdder::add(int, Foam::UPtrList<Foam::fvMesh>&, Foam::List<int> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<int> >&) in ~/OpenFOAM/OpenFOAM-plus/work/develop/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so
#19 ? at ~/OpenFOAM/OpenFOAM-plus/work/develop/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C:1142
#20 __libc_start_main in /lib64/libc.so.6
#21 ? at /home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:122
Environment information
- OpenFOAM version : v2206
Possible fixes
- problem is that the cyclicAMI triggers the fvMeshGemoetry::meshPhi() calculation when trying to find out the patch face correspondence and transformations
- not trigger fvGeometryScheme::setPhi before all is mapped? inside fvGeometryScheme?
- delete mesh.phi() before fvGeometryScheme::movePoints gets called (e.g. inside reconstructParMesh) (still should be reconstructed afterwards)
- can unset mesh.moving() inside reconstructParMesh but that also then gets rid of reconstruction of points0, meshPhi
- change tutorial to delete the points0, meshPhi files before running the reconstructParMesh (same problem)
- extend redistributePar -reconstruct to work on topology change cases.