← Back to team overview

dolfin team mailing list archive

Re: Petrov-Galerkin FEM (Upwinding)

 

On Wednesday 04 March 2009 13:13:26 Anders Logg wrote:
> On Wed, Mar 04, 2009 at 09:08:49AM +0100, Johan Hake wrote:
> > On Wednesday 04 March 2009 08:21:11 Anders Logg wrote:
> > > On Tue, Mar 03, 2009 at 08:08:56PM -0500, Hatef Monajemi wrote:
> > > > Hi
> > > >
> > > > I was just wondering if it is possible to implement the
> > > > Petrov-Galerkin type of weighting functions in dolfin. I am trying to
> > > > solve a convection dominated problem in which the use of standard
> > > > Galerkin weighting generates the oscillations which can be removed by
> > > > upwinding. Is there any demo which shows the implementation of
> > > > Petrov-Galerkin type of testfunctions.
> > > >
> > > > Thanks,
> > > >
> > > > Hatef
> > >
> > > Yes, look at
> > >
> > >   demo/pde/stokes/stabilized
> > >
> > > It's very straightforward, just write
> > >
> > >   v = TestFunction(V)
> > >   v = v + delta*A(v)
> > >
> > > where delta is a stabilization parameter and A is a suitable operator.
> >
> > The stabilizing parameter showed in this demo is quite crude. If it wont
> > work for you, you can consider:
> >
> >   P = FunctionSpace(mesh,"CG",1)
> >   V = VectorFunctionSpace(mesh,"CG"2)
> >   v = TestFunction(P)
> >
> >   field = Function(V,"Some vector valued function that drives the
> > advection") stab = Function(V,open("SUPG_stab.h").read()) # V is a Vector
> >   stab.field = field
> >
> >
> >   v = v + 0.2*dot(stab,grad(v))
> >
> > Here 0.2*stab relates to the delta Anders mention and A relates to grad
> >
> > We could consider adding the handed function as a SpecialFunction in
> > DOLFIN. It is a general SUPG stabilization term, which depends not only
> > on the local meshsize but also on the local field size.
>
> Would that work? The added term must be linear in a TestFunction, so
> it can't be a Function.

Not sure what you are aiming at here. The stab function does not depend on the 
testfunction.

Johan


Follow ups

References