BUG: Wrong FatalIOError message in displacementMethod and optMeshMovement

- The core of the FatalIOError message was not printed due to exiting
  with FatalError instead of FatalIOError
- Changed the TypeName in all derived classes of displacementMethod so
  that the toc printed by the FatalIOError corresponds to what the user
  should add in dynamicMeshDict
This commit is contained in:
Vaggelis Papoutsis
2020-01-02 13:27:41 +02:00
committed by Andrew Heather
parent 122e496590
commit fed6a9efd4
7 changed files with 15 additions and 15 deletions

View File

@ -75,12 +75,11 @@ Foam::autoPtr<Foam::displacementMethod> Foam::displacementMethod::New
false
)
);
word motionSolverName(dynamicMeshDict.get<word>("solver"));
word modelType("displacementMethod" + motionSolverName);
word solverType(dynamicMeshDict.get<word>("solver"));
Info<< "displacementMethod type : " << modelType << endl;
Info<< "displacementMethod type : " << solverType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType);
if (!cstrIter.found())
{
@ -88,9 +87,9 @@ Foam::autoPtr<Foam::displacementMethod> Foam::displacementMethod::New
(
dynamicMeshDict,
"solver",
modelType,
solverType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<displacementMethod>(cstrIter()(mesh, patchIDs));
}

View File

@ -82,7 +82,7 @@ private:
public:
//- Runtime type information
TypeName("displacementMethoddisplacementLaplacian");
TypeName("displacementLaplacian");
// Constructors

View File

@ -86,7 +86,7 @@ private:
public:
//- Runtime type information
TypeName("displacementMethodelasticityMotionSolver");
TypeName("elasticityMotionSolver");
// Constructors

View File

@ -83,7 +83,7 @@ private:
public:
//- Runtime type information
TypeName("displacementMethodlaplacianMotionSolver");
TypeName("laplacianMotionSolver");
// Constructors

View File

@ -84,7 +84,7 @@ private:
public:
//- Runtime type information
TypeName("displacementMethodvelocityLaplacian");
TypeName("velocityLaplacian");
// Constructors

View File

@ -77,7 +77,7 @@ private:
public:
//- Runtime type information
TypeName("displacementMethodvolumetricBSplinesMotionSolver");
TypeName("volumetricBSplinesMotionSolver");
// Constructors

View File

@ -110,7 +110,7 @@ Foam::autoPtr<Foam::optMeshMovement> Foam::optMeshMovement::New
"type",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<optMeshMovement>(cstrIter()(mesh, dict, patchIDs));
@ -156,9 +156,10 @@ void Foam::optMeshMovement::writeMeshQualityMetrics()
if (writeMeshQualityMetrics_)
{
cellQuality cellQualityEngine(mesh_);
tmp<scalarField> cellNonOrtho = cellQualityEngine.nonOrthogonality();
tmp<scalarField> cellSkewness = cellQualityEngine.skewness();
Info<< "Average, Max cell non - orthogonality " << gAverage(cellNonOrtho())
tmp<scalarField> cellNonOrtho(cellQualityEngine.nonOrthogonality());
tmp<scalarField> cellSkewness(cellQualityEngine.skewness());
Info<< "Average, Max cell non - orthogonality "
<< gAverage(cellNonOrtho())
<< " " << gMax(cellNonOrtho()) << endl;
Info<< "Average, Max cell skewness " << gAverage(cellSkewness())
<< " " << gMax(cellSkewness()) << endl;