Skip to content
GitLab
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
f1d7955e
Commit
f1d7955e
authored
Jul 29, 2008
by
Mark Olesen
Browse files
BUGFIX - blockMeshApp should now handle paths properly
parent
f8b27463
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
View file @
f1d7955e
...
...
@@ -80,57 +80,70 @@ int main(int argc, char *argv[])
word
regionName
;
fileName
polyMeshDir
;
word
dictName
(
"blockMeshDict"
);
fileName
dictPath
(
runTime
.
constant
());
if
(
args
.
options
().
found
(
"region"
))
{
regionName
=
args
.
options
()[
"region"
];
// constant/<region>/polyMesh/blockMeshDict
regionName
=
args
.
options
()[
"region"
];
polyMeshDir
=
regionName
/
polyMesh
::
meshSubDir
;
Info
<<
nl
<<
"Generating mesh for region "
<<
regionName
<<
endl
;
}
else
{
regionName
=
polyMesh
::
defaultRegion
;
// constant/polyMesh/blockMeshDict
regionName
=
polyMesh
::
defaultRegion
;
polyMeshDir
=
polyMesh
::
meshSubDir
;
}
word
dictName
(
"blockMeshDict"
);
fileName
dictPath
(
runTime
.
constant
()
/
polyMeshDir
);
fileName
dictLocal
=
polyMeshDir
;
if
(
args
.
options
().
found
(
"dict"
))
{
fileName
userDict
(
args
.
options
()[
"dict"
]);
wordList
elems
(
fileName
(
args
.
options
()[
"dict"
]).
components
());
dictName
=
elems
[
elems
.
size
()
-
1
];
dictPath
=
elems
[
0
];
dictLocal
=
""
;
dictName
=
userDict
.
name
();
dictPath
=
userDict
.
path
();
if
(
elems
.
size
()
==
1
)
{
dictPath
=
"."
;
}
else
if
(
elems
.
size
()
>
2
)
{
dictLocal
=
fileName
(
SubList
<
word
>
(
elems
,
elems
.
size
()
-
2
,
1
));
}
}
Info
<<
nl
<<
"Reading block mesh description dictionary"
<<
endl
;
IOobject
meshD
escriptionIOobject
IOobject
meshD
ictIo
(
dictName
,
dictPath
,
dictLocal
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
);
if
(
!
meshD
escriptionIOobject
.
headerOk
())
if
(
!
meshD
ictIo
.
headerOk
())
{
FatalErrorIn
(
args
.
executable
())
<<
"Cannot open mesh description file: "
<<
nl
<<
dictPath
/
dictName
<<
nl
<<
"Cannot open mesh description file
\n
"
<<
meshDictIo
.
objectPath
()
<<
nl
<<
exit
(
FatalError
);
}
IOdictionary
meshDescription
(
meshDescriptionIOobject
);
Info
<<
nl
<<
"Creating block mesh"
<<
endl
;
Info
<<
nl
<<
"Creating block mesh from
\n
"
<<
meshDictIo
.
objectPath
()
<<
endl
;
blockMesh
blocks
(
meshDescription
);
IOdictionary
meshDict
(
meshDictIo
);
blockMesh
blocks
(
meshDict
);
if
(
writeTopo
)
{
...
...
@@ -187,7 +200,7 @@ int main(int argc, char *argv[])
(
runTime
,
runTime
.
constant
(),
polyMeshDir
,
//polyMesh::meshSubDir
polyMeshDir
,
patchNames
,
patchTypes
,
defaultFacesName
,
...
...
@@ -215,11 +228,11 @@ int main(int argc, char *argv[])
// Read in a list of dictionaries for the merge patch pairs
if
(
meshD
escription
.
found
(
"mergePatchPairs"
))
if
(
meshD
ict
.
found
(
"mergePatchPairs"
))
{
List
<
Pair
<
word
>
>
mergePatchPairs
(
meshD
escription
.
lookup
(
"mergePatchPairs"
)
meshD
ict
.
lookup
(
"mergePatchPairs"
)
);
if
(
mergePatchPairs
.
size
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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