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
ALVAREZ BARRIENTOS Felipe
dolfin_dic
Commits
dddf00cf
Commit
dddf00cf
authored
6 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
Now it also works in 2D
parent
2a65da72
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ImageIterator.py
+8
-3
8 additions, 3 deletions
ImageIterator.py
with
8 additions
and
3 deletions
ImageIterator.py
+
8
−
3
View file @
dddf00cf
...
...
@@ -84,6 +84,8 @@ class ImageIterator():
basename
=
self
.
initialize_U_basename
,
ext
=
self
.
initialize_U_ext
)
dof_to_vertex_map
=
dolfin
.
dof_to_vertex_map
(
self
.
problem
.
U_fs
)
n_iter_tot
=
0
global_success
=
True
for
forward_or_backward
in
[
"
forward
"
,
"
backward
"
]:
...
...
@@ -112,10 +114,13 @@ class ImageIterator():
if
(
self
.
initialize_U_from_file
):
mesh
=
mesh_series
.
get_mesh
(
k_frame
)
array_U
=
mesh
.
GetPointData
().
GetArray
(
self
.
initialize_U_array_name
)
array_U
=
vtk
.
util
.
numpy_support
.
vtk_to_numpy
(
array_U
)
array_U
=
array_U
.
astype
(
float
)
array_U
=
vtk
.
util
.
numpy_support
.
vtk_to_numpy
(
array_U
)[:,:
self
.
problem
.
mesh_dimension
]
# print array_U
# array_U = array_U.astype(float)
# print array_U
array_U
=
numpy
.
reshape
(
array_U
,
array_U
.
size
)
self
.
problem
.
U
.
vector
()[:]
=
array_U
[
dolfin
.
dof_to_vertex_map
(
self
.
problem
.
U_fs
)]
# print array_U
self
.
problem
.
U
.
vector
()[:]
=
array_U
[
dof_to_vertex_map
]
elif
(
self
.
initialize_DU_with_DUold
):
self
.
problem
.
U
.
vector
().
axpy
(
1.
,
self
.
problem
.
DUold
.
vector
())
...
...
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