ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #00813
Re: Patch for Vector Crouzeix-Raviart
Also, please send the patch as a hg bundle:
0. Fix your ~/.hgrc with something like
[ui]
username = "You name <your@email.address>"
1. Commit your changes:
hg commit
2. Create the bundle
hg bundle ffc-andy-2007-01-14.hg http://www.fenics.org/hg/ffc
3. Mail bundle to list
/Anders
On Sun, Jan 14, 2007 at 11:36:26PM +0100, Anders Logg wrote:
> Thanks.
>
> I'll apply it as soon as Rob has applied the corresponding patch to
> FIAT.
>
> /Anders
>
>
> On Sun, Jan 14, 2007 at 10:26:21AM -0600, Andy Terrel wrote:
> > Hello,
> >
> > Here is a patch for ffc that I required in order to get Crouzeix-Raviart
> > and Vector Crouzeix-Raviart working. It does depend on the patch I sent
> > to the FIAT mailing list and is based off the 0.3.5 release.
> >
> > As far as testing goes, everything works for my stokes problem using the
> > Crouzeix-Raviart + P0 elements. I can send a demo file if you would
> > like. Oh when I say everything works, I mean the velocity errors are
> > doing what I would expect, the visualization is junk but I think as
> > someone pointed out in the list a while back this is a problem with
> > paraview.
> >
> > Thanks,
> > Andy
> >
>
> > diff -u --new-file --recursive ffc-0.3.5/src/ffc/compiler/finiteelement.py ffc-0.3.5-mod/src/ffc/compiler/finiteelement.py
> > --- ffc-0.3.5/src/ffc/compiler/finiteelement.py 2006-12-01 04:30:01.000000000 -0600
> > +++ ffc-0.3.5-mod/src/ffc/compiler/finiteelement.py 2007-01-14 10:13:16.000000000 -0600
> > @@ -4,6 +4,7 @@
> > __license__ = "GNU GPL Version 2"
> >
> > # Modified by Garth N. Wells 2006
> > +# Modified by Andy R Terrel 2007
> >
> > # Python modules
> > import sys
> > @@ -12,7 +13,7 @@
> > from FIAT.shapes import *
> > from FIAT.Lagrange import Lagrange, VectorLagrange
> > from FIAT.DiscontinuousLagrange import DiscontinuousLagrange, DiscontinuousVectorLagrange
> > -from FIAT.CrouzeixRaviart import CrouzeixRaviart
> > +from FIAT.CrouzeixRaviart import CrouzeixRaviart, VectorCrouzeixRaviart
> > from FIAT.RaviartThomas import RaviartThomas
> > from FIAT.BDM import BDM
> > from FIAT.Nedelec import Nedelec
> > @@ -80,6 +81,9 @@
> > elif type == "Crouzeix-Raviart":
> > print "Warning: element untested"
> > self.element = CrouzeixRaviart(self.fiat_shape)
> > + elif type == "Vector Crouzeix-Raviart":
> > + print "Warning: element untested"
> > + self.element = VectorCrouzeixRaviart(self.fiat_shape)
> > elif type == "Raviart-Thomas" or type == "RT":
> > print "Warning: element untested"
> > self.element = RaviartThomas(self.fiat_shape, degree)
> > diff -u --new-file --recursive ffc-0.3.5/src/ffc/compiler/pointmap.py ffc-0.3.5-mod/src/ffc/compiler/pointmap.py
> > --- ffc-0.3.5/src/ffc/compiler/pointmap.py 2006-12-01 04:30:02.000000000 -0600
> > +++ ffc-0.3.5-mod/src/ffc/compiler/pointmap.py 2007-01-14 10:13:16.000000000 -0600
> > @@ -3,6 +3,8 @@
> > __copyright__ = "Copyright (C) 2005-2006 Anders Logg"
> > __license__ = "GNU GPL Version 2"
> >
> > +# Modified by Andy R Terrel 2007
> > +
> > # FIAT modules
> > from FIAT.dualbasis import *
> > from FIAT.shapes import *
> > @@ -88,7 +90,7 @@
> > local_offset = 0
> > component_offset = 0
> > for element in elements:
> > - # Only works for Lagrange
> > - if "Lagrange" in element.type_str:
> > + # Only works for Lagrange and Crouzeix-Raviart
> > + if "Lagrange" or "Crouzeix-Raviart" in element.type_str:
> > (declarations, local_offset, component_offset) = compute_pointmap(element, local_offset, component_offset)
> > self.declarations += declarations
>
> > _______________________________________________
> > FFC-dev mailing list
> > FFC-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/ffc-dev
>
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev
Follow ups
References