Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
amfe
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Aerospace and Mechanical Engineering
amfe
Commits
b69b6ff1
Commit
b69b6ff1
authored
1 year ago
by
Adrien Crovato
Browse files
Options
Downloads
Patches
Plain Diff
Update threshold deprecated function for VTK9
parent
c4a384e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
amfe v1.0.7
Pipeline
#21427
passed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tboxVtk/cutter.py
+9
-11
9 additions, 11 deletions
tboxVtk/cutter.py
with
9 additions
and
11 deletions
tboxVtk/cutter.py
+
9
−
11
View file @
b69b6ff1
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright 2020 University of Liège
# Copyright 2020 University of Liège
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -29,13 +29,12 @@ class Cutter:
...
@@ -29,13 +29,12 @@ class Cutter:
self
.
grid
=
_grid
self
.
grid
=
_grid
def
cut
(
self
,
tag
,
cutO
,
cutN
,
tag_name
=
"
tag
"
):
def
cut
(
self
,
tag
,
cutO
,
cutN
,
tag_name
=
"
tag
"
):
'''
"""
Cut the physical group ided
"
tag
"
with a plane defined by point
"
cutO
"
and normal
"
cutN
"
Cut the physical group ided
"
tag
"
with a plane defined by point
"
cutO
"
and normal
"
cutN
"
"""
'''
import
numpy
as
np
# create a threshold containing the physical group (tag) to cut
# create a threshold containing the physical group (tag) to cut
thresh
=
vtk
.
vtkThreshold
()
thresh
=
vtk
.
vtkThreshold
()
thresh
.
ThresholdBetween
(
tag
,
tag
)
thresh
.
SetLowerThreshold
(
tag
)
thresh
.
SetUpperThreshold
(
tag
)
thresh
.
SetInputConnection
(
self
.
grid
)
thresh
.
SetInputConnection
(
self
.
grid
)
thresh
.
SetInputArrayToProcess
(
0
,
0
,
0
,
vtk
.
vtkDataObject
.
FIELD_ASSOCIATION_CELLS
,
tag_name
)
# "tag" is the default name set in tboxVtk::VtkExport::save
thresh
.
SetInputArrayToProcess
(
0
,
0
,
0
,
vtk
.
vtkDataObject
.
FIELD_ASSOCIATION_CELLS
,
tag_name
)
# "tag" is the default name set in tboxVtk::VtkExport::save
thresh
.
Update
()
thresh
.
Update
()
...
@@ -51,10 +50,9 @@ class Cutter:
...
@@ -51,10 +50,9 @@ class Cutter:
return
cutter
.
GetOutput
()
return
cutter
.
GetOutput
()
def
extract
(
self
,
cutData
,
tagDim
,
vname
,
atPoint
=
True
):
def
extract
(
self
,
cutData
,
tagDim
,
vname
,
atPoint
=
True
):
'''
"""
Extract points
"
pts
"
, connectivity list
"
elems
"
and data
"
vals
"
named
"
vname
"
from cutting plane data
"
cutData
"
.
Extract points
"
pts
"
, connectivity list
"
elems
"
and data
"
vals
"
named
"
vname
"
from cutting plane data
"
cutData
"
.
The physical group dimension is given by
"
tagDim
"
and
"
atPoint
"
is True if vname is defined at points.
The physical group dimension is given by
"
tagDim
"
and
"
atPoint
"
is True if vname is defined at points.
'''
"""
import
numpy
as
np
import
numpy
as
np
# transfer point coordinates
# transfer point coordinates
_pts
=
cutData
.
GetPoints
()
_pts
=
cutData
.
GetPoints
()
...
...
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