Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_warp
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Genet
dolfin_warp
Commits
227175fd
Commit
227175fd
authored
6 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
first attempt at loading initial displacement
parent
9bd509ef
No related branches found
No related tags found
2 merge requests
!13
Init disp
,
!10
Initialize disp with file is working
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ImageIterator.py
+7
-1
7 additions, 1 deletion
ImageIterator.py
fedic2.py
+5
-1
5 additions, 1 deletion
fedic2.py
with
12 additions
and
2 deletions
ImageIterator.py
+
7
−
1
View file @
227175fd
...
...
@@ -34,6 +34,7 @@ class ImageIterator():
self
.
working_folder
=
parameters
[
"
working_folder
"
]
if
(
"
working_folder
"
in
parameters
)
else
"
.
"
self
.
working_basename
=
parameters
[
"
working_basename
"
]
if
(
"
working_basename
"
in
parameters
)
else
"
sol
"
self
.
initialize_U_from_file
=
parameters
[
"
initialize_U_from_file
"
]
if
(
"
initialize_U_from_file
"
in
parameters
)
else
False
self
.
initialize_DU_with_DUold
=
parameters
[
"
initialize_DU_with_DUold
"
]
if
(
"
initialize_DU_with_DUold
"
in
parameters
)
else
False
...
...
@@ -94,7 +95,12 @@ class ImageIterator():
k_frame_old
=
k_frame
+
1
#self.printer.print_var("k_frame_old",k_frame_old,-1)
if
(
self
.
initialize_DU_with_DUold
):
if
(
self
.
initialize_U_from_file
):
xdmf_filename
=
self
.
initialize_U_from_file
+
"
_
"
+
str
(
k_frame
).
zfill
(
2
)
+
"
.xdmf
"
xdmf_file
=
dolfin
.
XDMFFile
(
xdmf_filename
)
xdmf_file
.
read
(
self
.
problem
.
U
,
"
U
"
)
xdmf_file
.
close
()
elif
(
self
.
initialize_DU_with_DUold
):
self
.
problem
.
U
.
vector
().
axpy
(
1.
,
self
.
problem
.
DUold
.
vector
())
self
.
problem
.
call_before_solve
(
...
...
This diff is collapsed.
Click to expand it.
fedic2.py
+
5
−
1
View file @
227175fd
...
...
@@ -41,6 +41,7 @@ def fedic2(
residual_type
=
"
Iref
"
,
# Iref, Iold, Iref-then-Iold
relax_type
=
"
gss
"
,
# constant, aitken, gss
relax_init
=
1.0
,
initialize_U_from_file
=
0
,
initialize_DU_with_DUold
=
0
,
tol_res
=
None
,
tol_res_rel
=
None
,
...
...
@@ -59,6 +60,8 @@ def fedic2(
"
residual_type must be
\"
Iref
\"
. Aborting.
"
assert
(
relax_init
==
1.
),
\
"
relax_init must be 1. Aborting.
"
assert
(
not
((
initialize_U_from_file
)
and
(
initialize_DU_with_DUold
))),
\
"
Cannot initialize U from file and DU with DUold together. Aborting.
"
assert
(
tol_res
is
None
),
\
"
tol_res is deprecated. Aborting.
"
assert
(
tol_im
is
None
),
\
...
...
@@ -135,6 +138,7 @@ def fedic2(
parameters
=
{
"
working_folder
"
:
working_folder
,
"
working_basename
"
:
working_basename
,
"
initialize_DU_with_DUold
"
:
initialize_DU_with_DUold
})
"
initialize_DU_with_DUold
"
:
initialize_DU_with_DUold
,
"
initialize_U_from_file
"
:
initialize_U_from_file
})
image_iterator
.
iterate
()
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