← Back to team overview

dolfin team mailing list archive

Using errornorm() in C++

 

Ok, so I made a .ufl file called ENorm.ufl:


element = FiniteElement("Lagrange", triangle, 1)

uh = Function(element)
u   = Function(element)
e   = uh - u

M = dot(e, e)*dx


I used linear elements because my problem uses linear elements and I'm going to use this to find the relative error, not the absolute error, so there shouldn't be any accuracy problems. I compiled it and included it in a test program.

I have two problems. The first is this line in my main():   ENorm::CoefficientSpace_v VCoef(rectangle);   , where rectangle is my mesh. I got CoefficientSpace_v is not a member of ENorm. I got the above code fragment from demo/pde/functional.  I tried recompiling ENorm but didn't help.

My second problem is that the functions I want to compare are both declared on a FunctionSpace and have to be for my solution. I am going to try to interpolate. My question is will this work:

Function Phi(V);
Funtion u(VCoef);
Phi.interpolate(u);

where V is a FunctionSpace, VCoef is a CoefficientSpace_v, and both sapces are defined on the same mesh. I think this should end up interpolating Phi onto CoefficientSpace VCoef so I can use Phi when assembling my functional. I obviously can't test this until I get my first problem fixed.

Thanks again,

Phil