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
d9145a59
Commit
d9145a59
authored
1 year ago
by
Julian Heinze
Browse files
Options
Downloads
Patches
Plain Diff
use function to remove bulk ids
parent
ce732477
No related branches found
No related tags found
1 merge request
!116
bug fix - remove bulk_node/element_ids after assignment
Pipeline
#22263
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ogstools/feflowlib/tools.py
+14
-7
14 additions, 7 deletions
ogstools/feflowlib/tools.py
with
14 additions
and
7 deletions
ogstools/feflowlib/tools.py
+
14
−
7
View file @
d9145a59
...
...
@@ -48,10 +48,9 @@ def get_specific_surface(surface_mesh: pv.PolyData, filter_condition):
def
assign_bulk_ids
(
mesh
:
pv
.
UnstructuredGrid
):
"""
Add
fields
bulk_node_ids and bulk_element_ids to the given bulk mesh.
Add
data arrays for
bulk_node_ids and bulk_element_ids to the given bulk mesh.
:param mesh_name: name of the mesh
:type mesh_name: str
:param mesh: bulk mesh
"""
# The format must be unsigned integer, as it is required by OGS
mesh
[
"
bulk_node_ids
"
]
=
np
.
arange
(
mesh
.
n_points
,
dtype
=
np
.
uint64
)
...
...
@@ -60,6 +59,16 @@ def assign_bulk_ids(mesh: pv.UnstructuredGrid):
)
def
remove_bulk_ids
(
mesh
:
pv
.
UnstructuredGrid
):
"""
Remove data arrays for bulk_node_ids and bulk_element_ids of the given bulk mesh.
:param mesh: bulk mesh
"""
mesh
.
point_data
.
remove
(
"
bulk_node_ids
"
)
mesh
.
cell_data
.
remove
(
"
bulk_element_ids
"
)
def
extract_point_boundary_conditions
(
out_mesh_path
:
Path
,
mesh
:
pv
.
UnstructuredGrid
):
...
...
@@ -111,8 +120,7 @@ def extract_point_boundary_conditions(
str
(
out_mesh_path
/
point_data
)
+
"
.vtu
"
]
=
filtered_points
# Remove bulk node/element ids from bulk mesh, as they are not needed anymore.
mesh
.
point_data
.
remove
(
"
bulk_node_ids
"
)
mesh
.
cell_data
.
remove
(
"
bulk_element_ids
"
)
remove_bulk_ids
(
mesh
)
return
dict_of_point_boundary_conditions
...
...
@@ -172,8 +180,7 @@ def extract_cell_boundary_conditions(
# correct unit for P_IOFLOW, in FEFLOW m/d in ogs m/s
topsurf
.
cell_data
[
"
P_IOFLOW
"
]
=
topsurf
.
cell_data
[
"
P_IOFLOW
"
]
# Remove bulk node/element ids from bulk mesh, as they are not needed anymore.
mesh
.
point_data
.
remove
(
"
bulk_node_ids
"
)
mesh
.
cell_data
.
remove
(
"
bulk_element_ids
"
)
remove_bulk_ids
(
mesh
)
return
(
bulk_mesh_path
.
with_stem
(
"
topsurface_
"
+
bulk_mesh_path
.
stem
),
topsurf
,
...
...
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