mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: allow delayed construction of regionFaModel in volume bcs (#3419)
Ideally wish to delay construction of the finite-area mesh until updateCoeffs(), when it is actually needed. This helps avoid difficult to trace errors and avoids inadvertent parallel communication during construction from a dictionary. However, lazy evaluation fails at the later stage while attempting to load the corresponding initial fields, since the timeIndex has already advanced. Use the newly introduced regionModels::allowFaModels() switch to locally enable or disable lazy evaluation as needed. This allows selective disabling (eg, in post-processing utilities) where loading the volume field should not activate the associated regionFaModel and loading a finite-area mesh too (which may not exist or be defined at that point).
This commit is contained in:
@ -135,9 +135,14 @@ int main(int argc, char *argv[])
|
||||
"Only reconstruct new times (i.e. that do not exist already)"
|
||||
);
|
||||
|
||||
// Prevent volume BCs from triggering finite-area
|
||||
regionModels::allowFaModels(false);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Configuration
|
||||
|
||||
const bool doFields = !args.found("no-fields");
|
||||
wordRes selectedFields;
|
||||
|
||||
Reference in New Issue
Block a user