foamPostProcess: Load the modular solver library before constructing the mesh

to ensure all the solver specific patch types are available when the mesh is
constructed.
This commit is contained in:
Henry Weller
2024-04-13 09:44:01 +01:00
parent 5a9681c693
commit dfb816c511

View File

@ -259,6 +259,30 @@ int main(int argc, char *argv[])
const instantList timeDirs = timeSelector::select0(runTime, args); const instantList timeDirs = timeSelector::select0(runTime, args);
// Either the solver name is specified...
word solverName;
// ...or the fields are specified on the command-line
// or later inferred from the function arguments
HashSet<word> requiredFields;
if (args.optionReadIfPresent("solver", solverName))
{
libs.open("lib" + solverName + ".so");
}
else
{
// Initialise the set of selected fields from the command-line options
if (args.optionFound("fields"))
{
args.optionLookup("fields")() >> requiredFields;
}
if (args.optionFound("field"))
{
requiredFields.insert(word(args.optionLookup("field")()));
}
}
word regionName = fvMesh::defaultRegion; word regionName = fvMesh::defaultRegion;
if (args.optionReadIfPresent("region", regionName)) if (args.optionReadIfPresent("region", regionName))
@ -285,30 +309,6 @@ int main(int argc, char *argv[])
) )
); );
// Either the solver name is specified...
word solverName;
// ...or the fields are specified on the command-line
// or later inferred from the function arguments
HashSet<word> requiredFields;
if (args.optionReadIfPresent("solver", solverName))
{
libs.open("lib" + solverName + ".so");
}
else
{
// Initialise the set of selected fields from the command-line options
if (args.optionFound("fields"))
{
args.optionLookup("fields")() >> requiredFields;
}
if (args.optionFound("field"))
{
requiredFields.insert(word(args.optionLookup("field")()));
}
}
// Construct functionObjectList // Construct functionObjectList
autoPtr<functionObjectList> functionsPtr autoPtr<functionObjectList> functionsPtr
( (