Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OGSTools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ogs
OpenGeoSys Tools
OGSTools
Commits
18ac8a4b
Commit
18ac8a4b
authored
2 months ago
by
joergbuchwald
Committed by
Tobias Meisel
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "[meshlib] remove filepath from Mesh"
This reverts commit
d24f7029
.
parent
573a9e0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!234
add save_pvd method to mesh series
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ogstools/meshlib/ip_mesh.py
+3
-4
3 additions, 4 deletions
ogstools/meshlib/ip_mesh.py
ogstools/meshlib/mesh.py
+3
-0
3 additions, 0 deletions
ogstools/meshlib/mesh.py
ogstools/meshlib/mesh_series.py
+4
-0
4 additions, 0 deletions
ogstools/meshlib/mesh_series.py
with
10 additions
and
4 deletions
ogstools/meshlib/ip_mesh.py
+
3
−
4
View file @
18ac8a4b
from
pathlib
import
Path
from
tempfile
import
mkdtemp
from
typing
import
TypeVar
import
numpy
as
np
...
...
@@ -197,10 +196,10 @@ def to_ip_point_cloud(mesh: Mesh) -> pv.UnstructuredGrid:
for
key
in
bad_keys
:
if
key
in
_mesh
.
field_data
:
_mesh
.
field_data
.
remove
(
key
)
tempdir
=
mkdtemp
(
prefix
=
"
to_ip_point_cloud
"
)
input_file
=
Path
(
tempdir
)
/
"
ipDataToPointCloud_input.vtu
"
parentpath
=
Path
()
if
mesh
.
filepath
is
None
else
mesh
.
filepath
.
parent
input_file
=
parentpath
/
"
ipDataToPointCloud_input.vtu
"
_mesh
.
save
(
input_file
)
output_file
=
Path
(
tempdir
)
/
"
ip_mesh.vtu
"
output_file
=
parentpath
/
"
ip_mesh.vtu
"
ogs
.
cli
.
ipDataToPointCloud
(
i
=
str
(
input_file
),
o
=
str
(
output_file
))
return
pv
.
XMLUnstructuredGridReader
(
output_file
).
read
()
...
...
This diff is collapsed.
Click to expand it.
ogstools/meshlib/mesh.py
+
3
−
0
View file @
18ac8a4b
...
...
@@ -27,6 +27,8 @@ class Mesh(pv.UnstructuredGrid):
Contains additional data and functions mainly for postprocessing.
"""
filepath
:
Path
|
None
=
None
# pylint: disable=C0116
@copy_method_signature
(
data_processing
.
difference
)
def
difference
(
self
,
*
args
:
Any
,
**
kwargs
:
Any
)
->
Any
:
...
...
@@ -94,6 +96,7 @@ class Mesh(pv.UnstructuredGrid):
else
:
mesh
=
cls
(
pv
.
read
(
filepath
))
mesh
.
filepath
=
Path
(
filepath
).
with_suffix
(
"
.vtu
"
)
return
mesh
@classmethod
...
...
This diff is collapsed.
Click to expand it.
ogstools/meshlib/mesh_series.py
+
4
−
0
View file @
18ac8a4b
...
...
@@ -245,6 +245,10 @@ class MeshSeries:
mesh
=
Mesh
(
self
.
mesh_func
(
pv_mesh
))
if
lazy_eval
:
self
.
_mesh_cache
[
timevalue
]
=
mesh
if
self
.
_data_type
==
"
pvd
"
:
mesh
.
filepath
=
Path
(
self
.
timestep_files
[
data_timestep
])
else
:
mesh
.
filepath
=
Path
(
self
.
filepath
)
return
mesh
def
rawdata_file
(
self
)
->
Path
|
None
:
...
...
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