← Back to team overview

dolfin team mailing list archive

Re: DG viz

 

On Thu, Jun 28, 2007 at 12:17:50PM -0400, Jake Ostien wrote:
> Garth N. Wells wrote:
> >
> >
> > Jake Ostien wrote:
> >> Hi,
> >>
> >> If even possible, does anyone know how to view the fully 
> >> discontinuous solution (without the interpolation to the vertices)?
> >>
> >
> > It's not possible at the moment. The best approach for now is to 
> > project the discontinuous solution onto a continuous basis, and plot 
> > the continuous field.
> OK.  Here's a related question, I need to check that my weakly enforced 
> Dirichlet BCs are being properly handled.  Right now I think I need to 
> sample the discontinuous function along a given subset of the boundary 
> (which I do by iterating through all the vertices and selected solution 
> components by position), and manually integrate those values along the 
> boundary for comparison with the prescribed value, say zero for 
> simplicity.  Is there a better way to do this?  I am observing some 
> noise (oscillations) in the projected solution near the boundaries and I 
> am trying to figure out why.
> 
> -Jake

Sounds like you want to compute a functional of the computed solution?

Say you want to check the L2 error of the computed solution along 
a subset of the boundary. In FFC, do this:

element = FiniteElement(...)

u = Function(element)
u0 = Function(element)

e = u - u0

M = e*e*ds

Here, u is your computed solution, u0 is a boundary condition (you
want u = u0 on the boundary). Then the functional M will be the L2
error squared along a subset of the boundary.

Assemble the functional in DOLFIN by

double L2error = assemble(M, mesh, sub_domain);

where M is the form (taking two arguments u and u0) and sub_domain is
the sub_domain you want to integrate over.

/Anders


Follow ups

References