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
d4bbdc9d
Commit
d4bbdc9d
authored
Dec 19, 2017
by
Matthieu Constant
Browse files
uniformisation 2d-3D
parent
53f9c8c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
python/marblesbag/fluid.py
View file @
d4bbdc9d
...
...
@@ -15,7 +15,7 @@ class StrongBoundary(Structure):
class
fluid_problem
:
def
__init__
(
self
,
mesh_file_name
,
g
,
mu
,
rho
,
epsilon
,
strong_boundaries
):
def
__init__
(
self
,
mesh_file_name
,
g
,
mu
,
rho
,
epsilon
,
strong_boundaries
,
notComputeEpsilon
):
nsb
=
len
(
strong_boundaries
)
class
Bnd
:
def
__init__
(
self
,
b
)
:
...
...
@@ -31,7 +31,7 @@ class fluid_problem :
asb
=
(
StrongBoundary
*
nsb
)(
*
[
StrongBoundary
(
i
[
0
].
encode
(),
i
[
1
],
BNDCB
(
Bnd
(
i
[
2
]).
apply
))
for
i
in
strong_boundaries
])
self
.
asb
=
asb
lib
.
fluid_problem_new
.
restype
=
c_void_p
self
.
_fp
=
c_void_p
(
lib
.
fluid_problem_new
(
mesh_file_name
.
encode
(),
c_double
(
g
),
c_double
(
mu
),
c_double
(
rho
),
c_double
(
epsilon
),
nsb
,
asb
))
self
.
_fp
=
c_void_p
(
lib
.
fluid_problem_new
(
mesh_file_name
.
encode
(),
c_double
(
g
),
c_double
(
mu
),
c_double
(
rho
),
c_double
(
epsilon
),
nsb
,
asb
,
c_int
(
notComputeEpsilon
)
))
if
self
.
_fp
==
None
:
raise
NameError
(
"cannot create fluid problem"
)
...
...
python/marblesbag/scontact3.py
View file @
d4bbdc9d
...
...
@@ -72,9 +72,9 @@ class ParticleProblem :
triangleTag
=
self
.
_get_idx
(
"TriangleTag"
)
triangles
[
triangleTag
==
tag
,
9
:
12
]
=
v
def
iterate
(
self
,
dt
,
forces
)
:
def
iterate
(
self
,
dt
,
forces
,
tol
=
1e-8
)
:
self
.
_get_matrix
(
"ExternalForces"
,
3
)[:]
=
forces
lib
.
particleProblemIterate
(
self
.
_p
,
c_double
(
numpy
.
min
(
self
.
r
())),
c_double
(
dt
),
c_double
(
3e-8
),
c_int
(
-
1
))
lib
.
particleProblemIterate
(
self
.
_p
,
c_double
(
numpy
.
min
(
self
.
r
())),
c_double
(
dt
),
c_double
(
tol
),
c_int
(
-
1
))
def
write_vtk
(
self
,
odir
,
i
,
t
)
:
lib
.
particleProblemWriteVtk
(
self
.
_p
,
odir
.
encode
(),
i
)
...
...
Write
Preview
Markdown
is supported
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