Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_dic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
BERBEROGLU Ezgi
dolfin_dic
Commits
76b29d66
Commit
76b29d66
authored
8 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
writing vtk files in case of backward registration
parent
ff320aae
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
compute_strains.py
+5
-4
5 additions, 4 deletions
compute_strains.py
fedic.py
+7
-1
7 additions, 1 deletion
fedic.py
image_expressions_py.py
+1
-1
1 addition, 1 deletion
image_expressions_py.py
plot_strains.py
+0
-3
0 additions, 3 deletions
plot_strains.py
print_tools.py
+0
-2
0 additions, 2 deletions
print_tools.py
with
13 additions
and
11 deletions
compute_strains.py
+
5
−
4
View file @
76b29d66
...
...
@@ -31,8 +31,9 @@ def compute_strains(
if
(
ref_folder
is
not
None
)
and
(
ref_basename
is
not
None
):
ref_mesh
=
myVTK
.
readUGrid
(
filename
=
ref_folder
+
"
/
"
+
ref_basename
+
"
-WithLocalBasis.vtk
"
,
verbose
=
0
)
verbose
=
verbose
)
ref_n_cells
=
ref_mesh
.
GetNumberOfCells
()
if
(
verbose
):
print
"
ref_n_cells =
"
+
str
(
ref_n_cells
)
if
(
ref_mesh
.
GetCellData
().
HasArray
(
"
sector_id
"
)):
iarray_sector_id
=
ref_mesh
.
GetCellData
().
GetArray
(
"
sector_id
"
)
...
...
@@ -66,7 +67,7 @@ def compute_strains(
for
k_frame
in
xrange
(
n_frames
):
mesh
=
myVTK
.
readUGrid
(
filename
=
sol_folder
+
"
/
"
+
sol_basename
+
"
_
"
+
str
(
k_frame
).
zfill
(
n_zfill
)
+
"
.
"
+
sol_ext
,
verbose
=
0
)
verbose
=
verbose
)
n_cells
=
mesh
.
GetNumberOfCells
()
if
(
ref_mesh
is
not
None
):
assert
(
n_cells
==
ref_n_cells
)
...
...
@@ -76,11 +77,11 @@ def compute_strains(
mesh
=
mesh
,
disp_array_name
=
disp_array_name
,
ref_mesh
=
ref_mesh
,
verbose
=
0
)
verbose
=
verbose
)
myVTK
.
writeUGrid
(
ugrid
=
mesh
,
filename
=
sol_folder
+
"
/
"
+
sol_basename
+
"
_
"
+
str
(
k_frame
).
zfill
(
n_zfill
)
+
"
.
"
+
sol_ext
,
verbose
=
0
)
verbose
=
verbose
)
if
(
write_strains
)
or
(
write_strain_vs_radius
):
if
(
ref_mesh
is
not
None
):
...
...
This diff is collapsed.
Click to expand it.
fedic.py
+
7
−
1
View file @
76b29d66
...
...
@@ -13,6 +13,7 @@ import glob
import
math
import
numpy
import
os
import
shutil
import
time
import
myVTKPythonLibrary
as
myVTK
...
...
@@ -178,10 +179,12 @@ def fedic(
if
not
os
.
path
.
exists
(
working_folder
):
os
.
mkdir
(
working_folder
)
pvd_basename
=
working_folder
+
"
/
"
+
working_basename
+
"
_
"
file_pvd
=
dolfin
.
File
(
pvd_basename
+
"
.pvd
"
)
for
vtu_filename
in
glob
.
glob
(
pvd_basename
+
"
*.vtu
"
):
os
.
remove
(
vtu_filename
)
file_pvd
=
dolfin
.
File
(
pvd_basename
+
"
.pvd
"
)
file_pvd
<<
(
U
,
float
(
images_ref_frame
))
os
.
remove
(
pvd_basename
+
"
.pvd
"
)
shutil
.
move
(
pvd_basename
+
""
.
zfill
(
6
)
+
"
.vtu
"
,
pvd_basename
+
str
(
images_ref_frame
).
zfill
(
6
)
+
"
.vtu
"
)
if
(
print_iterations
):
for
filename
in
glob
.
glob
(
working_folder
+
"
/
"
+
working_basename
+
"
-frame=*.*
"
):
...
...
@@ -638,7 +641,10 @@ def fedic(
file_volume
.
write
(
"
"
.
join
([
str
(
val
)
for
val
in
[
k_frame
,
mesh_V
]])
+
"
\n
"
)
print_str
(
tab
,
"
Printing solution…
"
)
file_pvd
=
dolfin
.
File
(
pvd_basename
+
"
.pvd
"
)
file_pvd
<<
(
U
,
float
(
k_frame
))
os
.
remove
(
pvd_basename
+
"
.pvd
"
)
shutil
.
move
(
pvd_basename
+
""
.
zfill
(
6
)
+
"
.vtu
"
,
pvd_basename
+
str
(
k_frame
).
zfill
(
6
)
+
"
.vtu
"
)
if
(
images_dynamic_scaling
):
p
=
numpy
.
empty
((
2
,
2
))
...
...
This diff is collapsed.
Click to expand it.
image_expressions_py.py
+
1
−
1
View file @
76b29d66
...
...
@@ -53,7 +53,7 @@ class ExprIm2(dolfin.Expression):
#print " Expr = " + str(Expr)
class
ExprIm3
(
dolfin
.
Expression
):
def
__init__
(
self
,
filename
,
**
kwargs
):
def
__init__
(
self
,
filename
=
None
,
**
kwargs
):
if
filename
is
not
None
:
self
.
init_image
(
filename
=
filename
)
...
...
This diff is collapsed.
Click to expand it.
plot_strains.py
+
0
−
3
View file @
76b29d66
...
...
@@ -8,10 +8,7 @@
### ###
########################################################################
import
math
import
numpy
import
os
import
sys
########################################################################
...
...
This diff is collapsed.
Click to expand it.
print_tools.py
+
0
−
2
View file @
76b29d66
...
...
@@ -8,8 +8,6 @@
### ###
########################################################################
import
myVTKPythonLibrary
as
myVTK
########################################################################
#class Printer:
...
...
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