# PETSc error code 63 (argument out of range)

**URL:** <https://fenicsproject.discourse.group/t/petsc-error-code-63-argument-out-of-range/1564>\
**Category:** Uncategorized\
**Created:** [September 18, 2019, 7:12am UTC](https://fenicsproject.discourse.group/t/petsc-error-code-63-argument-out-of-range/1564 "2019-09-18T07:12:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kamensky](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kamensky](https://fenicsproject.discourse.group/u/kamensky)\
**Post date:** [September 20, 2019, 6:35am UTC](https://fenicsproject.discourse.group/t/petsc-error-code-63-argument-out-of-range/1564/2 "2019-09-20T06:35:14Z")

</div>

My guess is that this has something to do with assembling a residual entirely on the boundary, since I only see `ds` measures in the definition of `F1`. Take a look at the following minimal example, which includes a possible solution:

```python
from dolfin import *
mesh = UnitIntervalMesh(10)
V = FunctionSpace(mesh,"CG",1)

# Constrain all interior nodes:
bc = DirichletBC(V,Constant(0.0),"!(near(x[0],0.0)||near(x[0],1.0))",
                 "pointwise")

# Try to solve a variational problem on the boundary:
u = Function(V)
v = TestFunction(V)

# Causes error code 63 on its own:
residual = (u-1.0)*v*ds

# Fix:
residual += Constant(0.0)*u*v*dx

solve(residual==0,u,bcs=[bc,])

```

---

_[View the full topic](https://fenicsproject.discourse.group/t/petsc-error-code-63-argument-out-of-range/1564)._
