Picard vs Newton: "Form is empty. Cannot pass to JIT compiler

Asked by Yaakoub El Khamra on 2012-11-26

I am hoping for some clarification regarding a somewhat weird issue. The following works:
problem_parameters['time_integration'] = "Steady" # default='Steady'
problem = Problem(mesh, problem_parameters)

# Set up first PDESystem
solver_parameters['space']['u'] = VectorFunctionSpace #
default=FunctionSpace
solver_parameters['degree']['u'] = 2 # default=1
solver_parameters['degree']['p'] = 1 # default=1

solver_parameters['familyname'] = 'Scalar'
solver_parameters['iteration_type'] = 'Newton'
GloalFormulation = PDESystem([['u', 'p']], problem, solver_parameters)

class DarcyGlobal(PDESubSystem):
    def form(self, u, u_, v_u, p, v_p, **kwargs):
        F = inner(u,v_u)*dx - 0.1*inner(p, div(v_u))*dx + inner(div(u),v_p)*dx
        return F

However if I change the iteration_type to Picard, I get the following error:
"RuntimeError: Form is empty. Cannot pass to JIT compiler."

The full trace is below:

Traceback (most recent call last):
  File "/home/yye00/Dropbox/Code/FEniCS_Code/Python/Sovereign/CBCExperimental.py", line 60, in <module>
    problem.solve()
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/Problem.py", line 55, in solve
    %(self.prm['time_integration'], func))
  File "<string>", line 1, in <module>
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/Problem.py", line 75, in solve_Steady_advance
    logging=False)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESystem.py", line 329, in solve_inner
    logging=max_iter>1)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 819, in solve_nonlinear
    assemble_b=pdesubsystem.assemble_b)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 124, in solve
    res, dx = solve(assemble_A, assemble_b)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 147, in solve_Picard_system
    if assemble_b: self.assemble(self.b)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 225, in assemble
    exterior_facet_domains=self.exterior_facet_domains)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/fem/assembling.py", line 158, in assemble
    common_cell=common_cell)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/fem/form.py", line 56, in __init__
    common_cell)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 95, in jit
    raise RuntimeError, "Form is empty. Cannot pass to JIT compiler."
RuntimeError: Form is empty. Cannot pass to JIT compiler.

Question information

Language:
English Edit question
Status:
Solved
For:
CBC.PDESys Edit question
Assignee:
No assignee Edit question
Solved by:
Yaakoub El Khamra
Solved:
Last query:
Last reply:

Hi,

Looks like your Form does not have a linear component, that is, a rhs. I've been meaning to fix that, meanwhile you could add something like zero to the form, something along the lines of

inner(Constant((0, 0)), u)*dx

Mikael

Den Nov 26, 2012 kl. 6:41 PM skrev Yaakoub El Khamra:

> New question #215309 on CBC.PDESys:
> https://answers.launchpad.net/cbcpdesys/+question/215309
>
> I am hoping for some clarification regarding a somewhat weird issue. The following works:
> problem_parameters['time_integration'] = "Steady" # default='Steady'
> problem = Problem(mesh, problem_parameters)
>
> # Set up first PDESystem
> solver_parameters['space']['u'] = VectorFunctionSpace #
> default=FunctionSpace
> solver_parameters['degree']['u'] = 2 # default=1
> solver_parameters['degree']['p'] = 1 # default=1
>
> solver_parameters['familyname'] = 'Scalar'
> solver_parameters['iteration_type'] = 'Newton'
> GloalFormulation = PDESystem([['u', 'p']], problem, solver_parameters)
>
> class DarcyGlobal(PDESubSystem):
> def form(self, u, u_, v_u, p, v_p, **kwargs):
> F = inner(u,v_u)*dx - 0.1*inner(p, div(v_u))*dx + inner(div(u),v_p)*dx
> return F
>
> However if I change the iteration_type to Picard, I get the following error:
> "RuntimeError: Form is empty. Cannot pass to JIT compiler."
>
> The full trace is below:
>
> Traceback (most recent call last):
> File "/home/yye00/Dropbox/Code/FEniCS_Code/Python/Sovereign/CBCExperimental.py", line 60, in <module>
> problem.solve()
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/Problem.py", line 55, in solve
> %(self.prm['time_integration'], func))
> File "<string>", line 1, in <module>
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/Problem.py", line 75, in solve_Steady_advance
> logging=False)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESystem.py", line 329, in solve_inner
> logging=max_iter>1)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 819, in solve_nonlinear
> assemble_b=pdesubsystem.assemble_b)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 124, in solve
> res, dx = solve(assemble_A, assemble_b)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 147, in solve_Picard_system
> if assemble_b: self.assemble(self.b)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/cbc/pdesys/PDESubSystems.py", line 225, in assemble
> exterior_facet_domains=self.exterior_facet_domains)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/fem/assembling.py", line 158, in assemble
> common_cell=common_cell)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/fem/form.py", line 56, in __init__
> common_cell)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
> return local_jit(*args, **kwargs)
> File "/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 95, in jit
> raise RuntimeError, "Form is empty. Cannot pass to JIT compiler."
> RuntimeError: Form is empty. Cannot pass to JIT compiler.
>
>
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Yaakoub El Khamra (yelkhamra) said : #2

Thank you sir.