ENH: more fault-tolerance in makeFaMesh decomposition

- if the volume faceProcAddressing is missing, it is not readily
  possible to determine equivalent area procAddressing.

  Instead of throwing an error, be more fault-tolerant by having it
  create with READ_IF_PRESENT and then detect and warn
  if there are problems.
This commit is contained in:
Mark Olesen
2022-11-19 14:30:50 +01:00
parent 67b58c28c0
commit 94c7e180fb
4 changed files with 78 additions and 33 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
Copyright (C) 2021-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -15,9 +15,21 @@ Description
\*---------------------------------------------------------------------------*/
// Embed do-while to support early termination
if (doDecompose && Pstream::parRun())
do
{
faMeshReconstructor reconstructor(aMesh);
faMeshReconstructor reconstructor(aMesh, IOobjectOption::READ_IF_PRESENT);
if (!reconstructor.good())
{
Info<< "Missing volume proc-addressing, "
"cannot generate area proc-addressing." << nl
<< "Also skip decomposing area fields...."
<< endl;
break;
}
reconstructor.writeAddressing();
Info<< "Wrote proc-addressing" << nl << endl;
@ -77,7 +89,7 @@ if (doDecompose && Pstream::parRun())
areaFieldsCache.decomposeAllFields(fieldDecomposer, true);
Info<< endl;
}
}
} while (false);
// ************************************************************************* //