Incorrect Gradient Calculated
I have a peculiar problem. I am trying to calculate the gradient of a solution and am obtaining incorrect solutions for a particular vector. When I provide another vector I get an apparently correct solution (the sign and trend are correct). When I provide the vector which has trouble, I obtain a strong jump at the boundary with an incorrect sign in the gradient after the boundary.
I am working in C++
ts is the vector which gives me trouble
L_gradT.q = ts;
solve(a_gradT == L_gradT, gradt);
My UFL file
element = FiniteElement(
#Q : Value
q = Coefficient(
# gradq : Total derivative of variable
u= TrialFunction(
w = TestFunction(
a = inner(u,w)*dx
L = inner(grad(q),w)*dx
I know this is open ended, but how should I go about debugging this? Can I change solvers?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Charles Cook
- Solved:
- Last query:
- Last reply: