TimeSeries interpolation not working in parallel?


91
views
1
11 weeks ago by
Hi,

I'd like to use the feature of TimeSeries.retrieve() that interpolates the values to the requested time. However, in parallel, this does not seem to work. Running the following code with mpirun -n 2 fails (error message below). With 'interpolation = False' it works.
Is there a way to make this work, apart from doing it 'by hand'?

from dolfin import *

set_log_level(PROGRESS)

interpolation = True

mesh = UnitSquareMesh(8, 8)
V = FunctionSpace(mesh, 'P', 1)
ex = Expression("t", degree=1, t=0.)
u = Function(V)

# store data
ts = TimeSeries(mpi_comm_world(), 'test_series')
times = [1., 2., 3.]
for t in times:
    ex.t = t
    u = interpolate(ex, V)
    ts.store(u.vector(), t)

# retrieve data
ts = TimeSeries(mpi_comm_world(), 'test_series')
times = ts.vector_times()
for t in times:
    ts.retrieve(u.vector(), t, interpolation)
​

Error message:

Traceback (most recent call last):
  File "timeseries_mwe.py", line 24, in <module>
    ts.retrieve(u.vector(), t, True)
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to successfully call PETSc function 'VecAXPY'.
*** Reason:  PETSc error code is: 75 (Arguments are incompatible).
*** Where:   This error was encountered inside /build/dolfin-fyfCiA/dolfin-2017.2.0.post0/dolfin/la/PETScVector.cpp.
*** Process: 1
***
*** DOLFIN version: 2017.2.0
*** Git changeset:  unknown
*** -------------------------------------------------------------------------
​



Thanks for your help.
David

Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »