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
9701cb49
Commit
9701cb49
authored
Oct 23, 2017
by
Matthieu Constant
Browse files
visu 3d
parent
e9b90ced
Changes
3
Hide whitespace changes
Inline
Side-by-side
marblesbag/fluid3.py
View file @
9701cb49
...
...
@@ -46,6 +46,9 @@ class fluid_problem :
def
export
(
self
,
output_dir
,
t
,
it
)
:
lib
.
fluid_problem_export
(
self
.
_fp
,
output_dir
.
encode
(),
c_double
(
t
),
c_int
(
it
))
def
export_vtk
(
self
,
output_dir
,
t
,
it
)
:
lib
.
fluid_problem_export_vtk
(
self
.
_fp
,
output_dir
.
encode
(),
c_double
(
t
),
c_int
(
it
))
def
compute_node_force
(
self
,
dt
)
:
def
np2c
(
a
)
:
return
c_void_p
(
a
.
ctypes
.
data
)
...
...
marblesbag/scontact3.py
View file @
9701cb49
...
...
@@ -82,7 +82,6 @@ class ParticleProblem :
def
write_vtk
(
self
,
odir
,
i
,
t
)
:
lib
.
particleProblemWriteVtk
(
self
.
_p
,
odir
.
encode
(),
i
)
shutil
.
move
(
outputname
+
"_tmp"
,
outputname
)
def
add_boundary_disk
(
self
,
x0
,
r
,
tag
)
:
lib
.
particleProblemAddBoundaryDisk
.
restype
=
c_size_t
...
...
marblesbag/src/fluid_problem.c
View file @
9701cb49
...
...
@@ -145,19 +145,27 @@ int fluid_problem_export_vtk(const FluidProblem *problem, const char *output_dir
fprintf
(
f
,
"</Points>
\n
"
);
fprintf
(
f
,
"<Cells>
\n
"
);
fprintf
(
f
,
"<DataArray type=
\"
Int32
\"
Name=
\"
connectivity
\"
format=
\"
ascii
\"
>
\n
"
);
for
(
int
i
=
0
;
i
<
mesh
->
n_elements
*
3
;
++
i
)
{
for
(
int
i
=
0
;
i
<
mesh
->
n_elements
*
(
DIMENSION
+
1
)
;
++
i
)
{
fprintf
(
f
,
"%i "
,
mesh
->
elements
[
i
]);
}
fprintf
(
f
,
"
\n
</DataArray>
\n
"
);
fprintf
(
f
,
"<DataArray type=
\"
Int32
\"
Name=
\"
offsets
\"
format=
\"
ascii
\"
>
\n
"
);
for
(
int
i
=
0
;
i
<
mesh
->
n_elements
;
++
i
)
{
fprintf
(
f
,
"%i "
,
(
i
+
1
)
*
3
);
fprintf
(
f
,
"%i "
,
(
i
+
1
)
*
(
DIMENSION
+
1
)
);
}
#if DIMENSION == 2
fprintf
(
f
,
"
\n
</DataArray>
\n
"
);
fprintf
(
f
,
"<DataArray type=
\"
Int32
\"
Name=
\"
types
\"
format=
\"
ascii
\"
>
\n
"
);
for
(
int
i
=
0
;
i
<
mesh
->
n_elements
;
++
i
)
{
fprintf
(
f
,
"%i "
,
5
);
// 10 for 3d
}
#else
fprintf
(
f
,
"
\n
</DataArray>
\n
"
);
fprintf
(
f
,
"<DataArray type=
\"
Int32
\"
Name=
\"
types
\"
format=
\"
ascii
\"
>
\n
"
);
for
(
int
i
=
0
;
i
<
mesh
->
n_elements
;
++
i
)
{
fprintf
(
f
,
"%i "
,
10
);
// 10 for 3d
}
#endif
fprintf
(
f
,
"
\n
</DataArray>
\n
"
);
fprintf
(
f
,
"</Cells>
\n
"
);
//fprintf(f,"<PointData Scalars=\"Pressure Porosity\" Vectors=\"Velocity\">\n");
...
...
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