Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
f3084a31
Commit
f3084a31
authored
4 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[bin][extractlinedata] simplify and add docu
parent
b2302ce8
No related branches found
No related tags found
1 merge request
!2207
Feature/improve extract line data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/postprocessing/extractlinedata.py
+18
-18
18 additions, 18 deletions
bin/postprocessing/extractlinedata.py
with
18 additions
and
18 deletions
bin/postprocessing/extractlinedata.py
+
18
−
18
View file @
f3084a31
...
@@ -23,25 +23,28 @@ except ImportError:
...
@@ -23,25 +23,28 @@ except ImportError:
print
(
"
`paraview.simple` not found. Make sure using pvpython instead of python.
"
)
print
(
"
`paraview.simple` not found. Make sure using pvpython instead of python.
"
)
# import locations
# import locations
commonOutDirectory
=
False
outDirectory
=
args
[
'
outputDirectory
'
]
outDirectory
=
args
[
'
outputDirectory
'
]
if
not
outDirectory
==
''
:
if
not
outDirectory
==
''
and
not
os
.
path
.
exists
(
outDirectory
):
outDirectory
+=
'
/
'
os
.
makedirs
(
outDirectory
)
commonOutDirectory
=
True
if
not
os
.
path
.
exists
(
outDirectory
):
os
.
makedirs
(
outDirectory
)
# loop over all vtk files
# loop over all vtk files
counter
=
1
counter
=
1
for
curFile
in
args
[
'
files
'
]:
for
curFile
in
args
[
'
files
'
]:
# if no output directory was specified, use the directory of the given file
curOutDirectory
=
outDirectory
if
curOutDirectory
==
''
:
curOutDirectory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
curFile
)
)
# if no basename was specified, reuse the file name for the .csv file
if
args
[
'
outFile
'
]
==
''
:
csvFileName
=
os
.
path
.
join
(
curOutDirectory
,
os
.
path
.
splitext
(
os
.
path
.
basename
(
curFile
))[
0
]
+
"
.csv
"
)
else
:
csvFileName
=
os
.
path
.
join
(
curOutDirectory
,
args
[
'
outFile
'
]
+
"
.csv
"
)
# print progress to command line
# print progress to command line
fileWithoutPath
=
os
.
path
.
basename
(
curFile
)
if
not
commonOutDirectory
:
abspath
=
os
.
path
.
abspath
(
curFile
)
outDirectory
=
os
.
path
.
dirname
(
abspath
)
+
'
/
'
basename
=
os
.
path
.
splitext
(
fileWithoutPath
)[
0
]
if
args
[
'
verbosity
'
]
==
1
:
if
args
[
'
verbosity
'
]
==
1
:
print
(
"
Processing file ({}/{}): {}
"
.
format
(
counter
,
len
(
args
[
'
files
'
]),
fileWithoutPath
))
print
(
"
Processing file ({}/{}): {}
"
.
format
(
counter
,
len
(
args
[
'
files
'
]),
os
.
path
.
basename
(
curFile
)
))
counter
+=
1
counter
+=
1
# load vtk file
# load vtk file
...
@@ -58,16 +61,13 @@ for curFile in args['files']:
...
@@ -58,16 +61,13 @@ for curFile in args['files']:
plotOverLine
.
Source
.
Point2
=
args
[
'
point2
'
]
plotOverLine
.
Source
.
Point2
=
args
[
'
point2
'
]
# write output to csv writer
# write output to csv writer
if
not
args
[
'
outFile
'
]
==
''
:
writer
=
CreateWriter
(
csvFileName
,
plotOverLine
)
basename
=
args
[
'
outFile
'
]
csvFile
=
outDirectory
+
basename
+
'
.csv
'
writer
=
CreateWriter
(
csvFile
,
plotOverLine
)
writer
.
UpdatePipeline
()
writer
.
UpdatePipeline
()
# print the parameters and the column numbers
# print the parameters and the column numbers
if
args
[
'
verbosity
'
]
==
2
:
if
args
[
'
verbosity
'
]
==
2
:
with
open
(
csvFile
)
as
f
:
with
open
(
csvFile
Name
)
as
f
:
print
(
csvFile
)
print
(
csvFile
Name
)
reader
=
csv
.
reader
(
f
)
reader
=
csv
.
reader
(
f
)
paramList
=
list
(
reader
)
paramList
=
list
(
reader
)
paramCounter
=
1
paramCounter
=
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment