Import static solution to a time-dependent problem


285
views
0
10 months ago by
Hello everybody.
I am trying to solve a reaction-difussion equation which has as an input the result of another reaction-difussion equation.
I was trying to save the solution by using TimeSeries, but I guess this does not make much sense, since the problem is not time-dependent. Also I tried creating a HDF5 file to write and then read the solution, but it is not working either. Can anybody help me? I have very little knowledge about FEniCS.

Here are the two things I have tried.

--- Option #1: TimeSeries ---
To write the solution of the static problem:
timeseries_u = TimeSeries ('solution')
timeseries_u.store(u.vector(),0)

To read the solution in the time-dependent problem:
timeseries_w = TimeSeries('solution')
timeseries_w.retrieve(w.vector(),0)

--- Option #2: HDF5 file ---
To write the solution of the static problem:
outputfile = HDF5(mesh.mpi_comm(), "u.h5", "w")
outputfile.write(u, "solution")
outputfile.close()

To read the solution in the time-dependent problem:
inputfile = HDF5(mesh.mpi_comm(), "u.h5", "r")
inputfile.read(w, "solution")
inputfile.close()

Thanks in advance!

Best,

Isabela
Community: FEniCS Project
What was the error?  Can you provide a MWE?
written 10 months ago by pf4d  
When using the TimeSeries there is not indeed an error but it says this:
Calling FFC just-in-time (JIT) compiler, this may take some time.

*** Warning: Krylov solver did not converge in 0 iterations (PETSc reason DIVERGED_NANORINF, residual norm ||r|| = 0.000000e+00).

It seems everything is zero.

Using the HDF5 I have no problem to write it but when I try to use it it says the same as before:
*** Warning: Krylov solver did not converge in 0 iterations (PETSc reason DIVERGED_NANORINF, residual norm ||r|| = 0.000000e+00).

Sorry, what is a MWE?

Best,

Isabela






written 10 months ago by Isabela  
https://www.allanswered.com/post/emre/read-before-posting-how-do-i-get-by-my-question-answered/
written 10 months ago by pf4d  
Have you looked at your solution to see if they seem to give plausible results?
written 10 months ago by pf4d  
Yes, it seems. I am going to get a MWE and write here again. Thanks!
written 10 months ago by Isabela  

1 Answer


0
10 months ago by
I realised the problem is not in writing or reading the file. Thank you for answering anyway!!!
Please login to add an answer/comment or follow this question.

Similar posts:
Search »