Boundary condition Expression gives error on Apply

The error is at the botom: it only happens when I apply a veloicty dirichlet BC not a pressure dirichlet.

bcp.append(DirichletBC(Q,Constant(0.0) ,boundaries,inflow_vein))

bcp.append(DirichletBC(V,Constant(0.0) ,boundaries,inflow_vein))

The one in V, velocity space gives error, in Q , pressure space, doesnt.

File "/home/jack/anaconda2/envs/fenicsproject/lib/python3.7/site-packages/oasis-2018.1-py3.7.egg/oasis/problems/NSfracStep/Test_case.py", line 248, in initialize
    [bc.apply(x_1[ui]) for bc in bcs[ui]]
  File "/home/jack/anaconda2/envs/fenicsproject/lib/python3.7/site-packages/oasis-2018.1-py3.7.egg/oasis/problems/NSfracStep/Test_case.py", line 248, in <listcomp>
    [bc.apply(x_1[ui]) for bc in bcs[ui]]
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 'VecSetValuesLocal'.
*** Reason:  PETSc error code is: 63 (Argument out of range).
*** Where:   This error was encountered inside /home/conda/feedstock_root/build_artifacts/fenics-pkgs_1569407024839/work/dolfin/dolfin/la/PETScVector.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2019.1.0
*** Git changeset:  f3de96341c54e434c48115de5a3975b482aee933

anyone any ideas?

As you have not provided a minimal example, i have to do an educated guess. Is your FunctionSpace V a VectorFunctionSpace? If Yes, see:

1 Like