Cannot infer geometric dimension for this expression

Asked by Yaakoub El Khamra

Greetings
I am new to finite elements and FEniCS in general. I am running into this error when trying to run a somewhat complicated problem:

Cannot infer geometric dimension for this expression.

The output is as follows:

Cannot infer geometric dimension for this expression.
Traceback (most recent call last):
  File "/home/yye00/Dropbox/Code/FEniCS_Code/Python/Sovereign/IMPES_2D_2Ph_BlackOil.py", line 277, in <module>
    solve(a == L, Pw, BC_For_Producer)
.....

I can gladly provide the full python script but it is a bit lengthy (300 lines). Do I just copy/paste it? Many thanks in advance.

Regards
Yaakoub El Khamra

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Yaakoub El Khamra
Solved:
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

We cannot help you without a running example. Please reduce your script to a minimal example that still reproduces the error,
and then try posting. (300 lines is too much, 10-30 lines might be managable.)

Revision history for this message
Yaakoub El Khamra (yelkhamra) said :
#2

Thank you very much. I am reducing it now.

Revision history for this message
Yaakoub El Khamra (yelkhamra) said :
#3

In reducing the problem I think I have identified the error. I was using grad() improperly. Thank you very much Marie!

Revision history for this message
Marie Rognes (meg-simula) said :
#4

That is how it often goes... Glad to hear that the problem is solved.