Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fluidparticles
MigFlow
Commits
26feb420
Commit
26feb420
authored
Dec 07, 2020
by
Michel Henry
Browse files
no print
parent
dcd83f84
Pipeline
#8788
passed with stages
in 5 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/scontact.py
View file @
26feb420
...
...
@@ -433,13 +433,10 @@ class ParticleProblem :
x
,
cells
,
d
,
cdata
,
fdata
=
VTK
.
read
(
dirname
+
"/boundaries_%05d.vtu"
%
i
)
tagnames
=
VTK
.
string_array_decode
(
fdata
[
"TagNames"
])
tagmap
=
{}
print
(
fdata
)
print
(
tagnames
)
for
j
,
n
in
enumerate
(
tagnames
)
:
tagmap
[
j
]
=
self
.
_lib
.
particleProblemGetTagId
(
self
.
_p
,
n
)
offsets
=
np
.
hstack
([[
0
],
cells
[
"offsets"
]])
el
=
cells
[
"connectivity"
]
print
(
tagmap
)
tags
=
np
.
vectorize
(
tagmap
.
get
)(
cdata
[
"Tag"
])
materials
=
cdata
[
"Material"
]
for
idx
in
np
.
where
(
cells
[
"types"
]
==
1
)[
0
]
:
...
...
@@ -513,6 +510,7 @@ class ParticleProblem :
"""
self
.
_lib
.
particleProblemAddBoundaryDisk
.
restype
=
c_size_t
return
self
.
_lib
.
particleProblemAddBoundaryDisk
(
self
.
_p
,
self
.
_coord_type
(
*
x0
),
c_double
(
r
),
tag
.
encode
(),
material
.
encode
())
def
add_boundary_periodic_entity
(
self
,
etag
,
edim
,
transform
):
"""Adds a periodic entity.
...
...
@@ -523,6 +521,7 @@ class ParticleProblem :
"""
self
.
_lib
.
particleProblemAddBoundaryPeriodicEntity
.
restype
=
c_size_t
return
self
.
_lib
.
particleProblemAddBoundaryPeriodicEntity
(
self
.
_p
,
c_int
(
etag
),
c_int
(
edim
),
self
.
_coord_type
(
*
transform
))
def
add_boundary_periodic_segment
(
self
,
x0
,
x1
,
etag
)
:
"""Adds a boundary periodic segment.
...
...
@@ -533,6 +532,7 @@ class ParticleProblem :
"""
self
.
_lib
.
particleProblemAddBoundaryPeriodicSegment
.
restype
=
c_size_t
return
self
.
_lib
.
particleProblemAddBoundaryPeriodicSegment
(
self
.
_p
,
self
.
_coord_type
(
*
x0
),
self
.
_coord_type
(
*
x1
),
c_int
(
etag
))
def
add_boundary_segment
(
self
,
x0
,
x1
,
tag
,
material
=
"default"
)
:
"""Adds a boundary segment.
...
...
@@ -559,6 +559,7 @@ class ParticleProblem :
raise
NameError
(
"Triangle boundaries only available in 3D"
)
self
.
_lib
.
particleProblemAddBoundaryTriangle
.
restype
=
c_size_t
return
self
.
_lib
.
particleProblemAddBoundaryTriangle
(
self
.
_p
,
self
.
_coord_type
(
*
x0
),
self
.
_coord_type
(
*
x1
),
self
.
_coord_type
(
*
x2
),
tag
.
encode
(),
material
.
encode
())
def
add_boundary_periodic_triangle
(
self
,
x0
,
x1
,
x2
,
etag
):
"""Adds a boundary periodic triangle.
...
...
@@ -573,7 +574,6 @@ class ParticleProblem :
self
.
_lib
.
particleProblemAddBoundaryPeriodicTriangle
.
restype
=
c_size_t
return
self
.
_lib
.
particleProblemAddBoundaryPeriodicTriangle
(
self
.
_p
,
self
.
_coord_type
(
*
x0
),
self
.
_coord_type
(
*
x1
),
self
.
_coord_type
(
*
x2
),
c_int
(
etag
))
def
add_particle
(
self
,
x
,
r
,
m
,
tag
=
"default"
,
forced
=
0
):
"""Adds a particle in the particle problem.
...
...
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