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
56296e89
Commit
56296e89
authored
Oct 14, 2008
by
Mark Olesen
Browse files
foamToEnsightParts: added -index option, streamlined IOobject usage, fixed typo
parent
2c6b1368
Changes
4
Show whitespace changes
Inline
Side-by-side
applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
View file @
56296e89
...
...
@@ -39,6 +39,10 @@ Usage
@param -zeroTime \n
Include the often incomplete initial conditions.
@param -index \<start\>\n
Ignore the time index contained in the time file and use a
simple indexing when creating the @c Ensight/data/######## files.
Note
- no parallel data.
- writes to @a Ensight directory to avoid collisions with foamToEnsight.
...
...
@@ -70,6 +74,7 @@ int main(int argc, char *argv[])
timeSelector
::
addOptions
(
true
,
false
);
argList
::
noParallel
();
argList
::
validOptions
.
insert
(
"ascii"
,
""
);
argList
::
validOptions
.
insert
(
"index"
,
"start"
);
const
word
volFieldTypes
[]
=
{
...
...
@@ -104,6 +109,15 @@ int main(int argc, char *argv[])
format
=
IOstream
::
ASCII
;
}
// control for renumbering iterations
bool
optIndex
=
false
;
label
indexingNumber
=
0
;
if
(
args
.
options
().
found
(
"index"
))
{
optIndex
=
true
;
indexingNumber
=
readLabel
(
IStringStream
(
args
.
options
()[
"index"
])());
}
fileName
ensightDir
=
args
.
rootPath
()
/
args
.
globalCaseName
()
/
"Ensight"
;
fileName
dataDir
=
ensightDir
/
"data"
;
fileName
caseFileName
=
"Ensight.case"
;
...
...
applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H
View file @
56296e89
// Read time index from */uniform/time,
//
but treat 0 and constant specially
// Read time index from */uniform/time,
but treat 0 and constant specially
//
or simply increment from the '-index' option if it was supplied
label
timeIndex
=
0
;
if
if
(
optIndex
)
{
timeIndex
=
indexingNumber
++
;
}
else
if
(
runTime
.
timeName
()
!=
"constant"
&&
runTime
.
timeName
()
!=
"0"
...
...
@@ -22,19 +26,8 @@
if
(
io
.
headerOk
())
{
IOdictionary
timeObject
(
IOobject
(
"time"
,
runTime
.
timeName
(),
"uniform"
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
io
.
readOpt
()
=
IOobject
::
MUST_READ
;
IOdictionary
timeObject
(
io
);
timeObject
.
lookup
(
"index"
)
>>
timeIndex
;
}
...
...
applications/utilities/postProcessing/dataConversion/foamToEnsightParts/moveMesh.H
View file @
56296e89
{
IOobject
io
Points
IOobject
io
(
"points"
,
runTime
.
timeName
(),
...
...
@@ -7,21 +7,11 @@
mesh
);
if
(
io
Points
.
headerOk
())
if
(
io
.
headerOk
())
{
// Reading new points
pointIOField
newPoints
(
IOobject
(
"points"
,
mesh
.
time
().
timeName
(),
polyMesh
::
meshSubDir
,
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
// Read new points
io
.
readOpt
()
=
IOobject
::
MUST_READ
;
pointIOField
newPoints
(
io
);
mesh
.
movePoints
(
newPoints
);
}
...
...
applications/utilities/postProcessing/dataConversion/foamToEnsightParts/validateFields.H
View file @
56296e89
...
...
@@ -5,7 +5,8 @@ forAllIter(HashTable<word>, volumeFields, fieldIter)
const
word
&
fieldName
=
fieldIter
.
key
();
const
word
&
fieldType
=
fieldIter
();
if
(
fieldName
.
size
()
>
2
&&
fieldName
(
fieldName
.
size
()
-
2
,
2
)
!=
"_0"
)
// ignore _0 fields
if
(
fieldName
.
size
()
>
2
&&
fieldName
(
fieldName
.
size
()
-
2
,
2
)
==
"_0"
)
{
volumeFields
.
erase
(
fieldIter
);
}
...
...
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