Write .pvd error

Hello,

May I ask if you can please help me resolve the following error:

*** -------------------------------------------------------------------------
*** Error: Unable to write to file.
*** Reason: Unable to open file “BC.pvd” for writing.
*** Where: This error was encountered inside GenericFile.cpp.
*** Process: 0


*** DOLFIN version: 2019.1.0
*** Git changeset: 74d7efe1e84d65e9433fd96c50f1d278fa3e3f3f
*** -------------------------------------------------------------------------
When executing my code, I successfully initialise the problem and subsequently solve it, but this error seems to be related with the creation of my output files in .pvd form:

Output:
#cells = 18492
#vertices = 4090
Setting up MPET problem
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Traceback (most recent call last):
File “mpm_2comp_v0.0.py”, line 306, in
single_run(1, 500, 1.0)
File “mpm_2comp_v0.0.py”, line 135, in single_run
out_BC << chi_v
File “/usr/local/lib/python3.6/dist-packages/dolfin/io/init.py”, line 14, in lshift
self.write(u._cpp_object)
RuntimeError:

I have used this code successfully (unaltered) on the previous version of FENICS, without a problem.

Best wishes,

John

Can you post the part of code that deals with writing of the pvd file? In general,

with open("<filename>.pvd") as fil:
    fil.write(u)

works seamlessly.

Hi Bhavesh,
I resolved the issue with the following command: sudo chmod 777 -R /home/fenics
It was a permission issue…
Best,
John