Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
eb604fdb
Commit
eb604fdb
authored
Jul 23, 2008
by
Mark Olesen
Browse files
revert to previous search order - constant/polyMesh/blockMeshDict
- retain failsafe check (constant/blockMeshDict)
parent
b4337874
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
View file @
eb604fdb
...
...
@@ -28,12 +28,12 @@ Application
Description
A multi-block mesh generator.
The
@a constant/
blockMeshDict (or @a constant/\<region\>
/blockMeshDict
)
is used.
A
@a constant/
polyMesh
/blockMeshDict
(or @a constant/\<region\>/polyMesh/blockMeshDict)
is used.
For
backwards compatibility, @a constant/polyMesh/blockMeshDict
(or
@a constant/
\<region\>/polyMesh/blockMeshDict) can also be used
if the p
re
v
io
us search fail
ed.
For
people who like to accidentally remove their entire
@a constant/
polyMesh/, the path @a constant/blockMeshDict
(or @a constant/\<
re
g
io
n\>/blockMeshDict) will also be check
ed.
Usage
...
...
@@ -86,77 +86,83 @@ int main(int argc, char *argv[])
if
(
args
.
options
().
found
(
"region"
))
{
regionName
=
args
.
options
()[
"region"
];
regionName
=
args
.
options
()[
"region"
];
polyMeshDir
=
regionName
/
polyMesh
::
meshSubDir
;
constantDir
=
runTime
.
constant
()
/
regionName
;
Info
<<
nl
<<
"Generating mesh for region "
<<
regionName
<<
endl
;
// try constant/<region>/blockMeshDict
meshDictPtr
.
reset
(
new
IOobject
(
"blockMeshDict"
,
runTime
.
constant
(),
regionName
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
}
else
{
regionName
=
polyMesh
::
defaultRegion
;
regionName
=
polyMesh
::
defaultRegion
;
polyMeshDir
=
polyMesh
::
meshSubDir
;
constantDir
=
runTime
.
constant
();
}
// try constant/blockMeshDict
meshDictPtr
.
reset
// check constant/polyMesh or constant/polyMesh/<region>/
meshDictPtr
.
reset
(
new
IOobject
(
new
IOobject
(
"blockMeshDict"
,
runTime
.
constant
(),
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
}
"blockMeshDict"
,
runTime
.
constant
(),
polyMeshDir
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
// not found, fallback to polyMesh directory
if
(
!
meshDictPtr
->
headerOk
())
{
meshDictPtr
.
reset
(
new
IOobject
// not found, failsafe checks
if
(
args
.
options
().
found
(
"region"
))
{
// try constant/<region>/blockMeshDict
meshDictPtr
.
reset
(
"blockMeshDict"
,
runTime
.
constant
(),
polyMeshDir
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
}
new
IOobject
(
"blockMeshDict"
,
runTime
.
constant
(),
regionName
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
}
else
{
// try constant/blockMeshDict
meshDictPtr
.
reset
(
new
IOobject
(
"blockMeshDict"
,
runTime
.
constant
(),
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
}
if
(
!
meshDictPtr
->
headerOk
())
{
FatalErrorIn
(
args
.
executable
())
<<
"Cannot open mesh description file
"
<<
nl
<<
constantDir
/
"blockMeshDict"
<<
nl
<<
"or "
<<
nl
<<
constantDir
/
polyMeshDir
/
polyMesh
::
meshSubDir
/
"blockMeshDict"
<<
nl
<<
exit
(
FatalError
);
if
(
!
meshDictPtr
->
headerOk
())
{
FatalErrorIn
(
args
.
executable
())
<<
"Cannot open mesh description file
\n
"
<<
constantDir
/
polyMeshDir
/
"blockMeshDict"
<<
"
\n
(or "
<<
constantDir
/
"blockMeshDict"
<<
")"
<<
nl
<<
nl
<<
exit
(
FatalError
);
}
}
Info
<<
nl
<<
"Reading mesh description file"
<<
endl
;
IOdictionary
blockMeshDict
(
meshDictPtr
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment