Using the -case argument with extrudeMesh to specify the case directory does not apply to paths stated in extrudeMeshDict
Summary
The utility extrudeMesh fails to read a triSurface file, when I provide the case directory using the '-case' command line flag. The path to the triSurfaceFile is provided in the extrudeMeshDict as 'constant/triSurface/filename'.
Using a working directory which is the case directory, all is well. However, if I call extrudeMesh from the case's parent directory, and provide the case directory using the '-case' argument, the triSurface file can not be found.
Maybe, this is a bug of the VTK-file reader; and not of extrudeMesh itself. However, the unexpected behaviour of extrudeMesh described here is the symptom I encountered. The root-problem may be well something else.
Steps to reproduce
Go to the 'overRhoSimpleFoam/hotCylinder' tutorial case.
Change to 'cylinderMesh', and call 'extrudeMesh' -> all is well
Go back up (call 'cd ..'), clear the case (call './Allclean'), and call 'extrudeMesh -case cylinderMesh' -> error: 'Cannot read file "constant/triSurface/cylinder.vtk"'
Example case
Use the 'overRhoSimpleFoam/hotCylinder' tutorial case.
What is the current bug behaviour?
extrudeMesh fails to read the provided triSurface file, which is provided in extrudeMeshDict.
If I change the entry in the file extrudeMeshDict from 'constant/triSurface/cylinder.vtk' to 'cylinderMesh/constant/triSurface/cylinder.vtk', then extrudeMesh finds the file.
Extruding surfaceMesh read from file "cylinderMesh/constant/triSurface/cylinder.vtk"
What is the expected correct behavior?
I would expect extrudeMesh to take the path from extrudeMeshDict, i.e. 'constant/triSurface/cylinder.vtk', and form a path from the specified case directory.
The output of extrudeMesh lists the correct case directory:
Case : /home/gerhard/OpenFOAM/OpenFOAM-v2006/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh
I would expect, that the path to the triSurface file is treated as a relative path, which is combined with the provided case directory.
Relevant logs and/or images
gerhard@host:~/OpenFOAM/OpenFOAM-v2006/tutorials/compressible/overRhoSimpleFoam/hotCylinder$ ls
Allclean Allrun Allrun.pre cylinderAndBackground cylinderMesh
gerhard@host:~/OpenFOAM/OpenFOAM-v2006/tutorials/compressible/overRhoSimpleFoam/hotCylinder$ extrudeMesh -case cylinderMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : _b45f8f6f58-20200629 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : extrudeMesh -case cylinderMesh
Date : Oct 20 2020
Time : 14:09:57
Host : host
PID : 20346
I/O : uncollated
Case : /home/gerhard/OpenFOAM/OpenFOAM-v2006/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create mesh for time = 0
Selecting extrudeModel linearNormal
Selected extrudeModel for linearNormal using coeffs
{
thickness 0.7;
}
Extruding from surface using model linearNormal
Not collapsing any edges after extrusion
Extruding surfaceMesh read from file "constant/triSurface/cylinder.vtk"
--> FOAM FATAL ERROR:
Cannot read file "constant/triSurface/cylinder.vtk"
From bool Foam::fileFormats::VTKsurfaceFormat<Face>::read(const Foam::fileName&) [with Face = Foam::face]
in file surfaceFormats/vtk/VTKsurfaceFormat.C at line 98.
FOAM exiting
gerhard@host:~/OpenFOAM/OpenFOAM-v2006/tutorials/compressible/overRhoSimpleFoam/hotCylinder$
Environment information
- OpenFOAM version : 2006
- Operating system : Ubuntu-18.04
- Hardware info :
- Compiler : gcc