# LinearVariationalSolver does not return a dolfin.Function when solving a refined problem

Dear DOLFIN team.

I solve a refined problem created with adapt() using the LinearVariation

Unfortunately, the solution of that problem is not a dolfin.Function object, but rather a dolfin.

is very restrictive regarding its operations (e.g. I can not multiply it with a scalar).

The following code demonstrates my problem:

=======

from dolfin import *

mesh = UnitSquareMesh(2, 2)

V = FunctionSpace(mesh, "CG", 1)

u = TrialFunction(V)

v = TestFunction(V)

sol = Function(V)

s = interpolate(

a = u*v*dx

L = s*v*dx

problem = LinearVariation

solver = LinearVariation

solver.solve()

print isinstance(sol, dolfin.Function) # True

print isinstance(

# because we can use sol as our dolfin.Function

# But in this case we don't have a dolfin.Function, only a dolfin.

mesh_fine = adapt(mesh)

prob_fine = adapt(problem, mesh_fine)

solver = LinearVariation

solver.solve()

print isinstance(

# be a dolfin.Function to be usable

print isinstance(

# dolfin.Function to be usable

# For example I want to do somehthing like

print 2*prob_

=======

Thanks very much for your help,

Simon

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- DOLFIN Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Simon Funke

- Solved:

- Last query:

- Last reply: