Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 227175fd authored by Martin Genet's avatar Martin Genet
Browse files

first attempt at loading initial displacement

parent 9bd509ef
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment