Errors with gradient computing on C++
Hi
I would like to compute the grad of function sols1 on C++:
....
stiffness_
Function sols1(V);
sols1.vector() = 0.0; //For example
gradient_
gradient_
gradient_
VariationalPr
Function grad_u1(V_1);
projection.
plot(grad_u1);
...
where
gradient_
V = FiniteElement("CG", "triangle", 1)
W = VectorElement("CG", "triangle", 1)
u = TrialFunction(W)
v = TestFunction(W)
f = Coefficient(V)
a = inner(u, v)*dx
L = inner(v,grad(f))*dx
Running errors:
terminate called after throwing an instance of 'std::runtime_
what():
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to create variational problem.
*** Reason: The VariationalProblem class has been removed. Use solve(a == L).
*** Where: This error was encountered inside VariationalProb
*** -------
[ubuntu:04137] *** Process received signal ***
[ubuntu:04137] Signal: Aborted (6)
[ubuntu:04137] Signal code: (-6)
[ubuntu:04137] [ 0] [0x1f940c]
[ubuntu:04137] [ 1] /lib/i386-
[ubuntu:04137] [ 2] /usr/lib/
[ubuntu:04137] [ 3] /usr/lib/
[ubuntu:04137] [ 4] /usr/lib/
[ubuntu:04137] [ 5] /usr/lib/
[ubuntu:04137] [ 6] /usr/lib/
[ubuntu:04137] [ 7] /usr/lib/
[ubuntu:04137] [ 8] /usr/lib/
[ubuntu:04137] [ 9] /usr/lib/
[ubuntu:04137] [10] ./demo-
[ubuntu:04137] [11] /lib/i386-
[ubuntu:04137] [12] ./demo-mesh() [0x8064061]
[ubuntu:04137] *** End of error message ***
Aborted
What are my errors and how to fix it? Any helps are appreciated.
Best regards,
Nguyen Van Dang
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply: