Subject: [FFC-dev] Patch for Vector Crouzeix-Raviart

From: Andy Terrel <[email-masked]>
Date: Sun, 14 Jan 2007 10:26:21 -0600

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

-- 

====================
Andy Terrel
Computer Science Dept
University of Chicago
[email-masked]
---------------------

I believe in getting into hot water; 
it keeps you clean.
                    -G.K. Chesterton

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

---

From: Anders Logg <[email-masked]>
Date: Sun, 14 Jan 2007 23:36:26 +0100

Thanks.

I'll apply it as soon as Rob has applied the corresponding patch to
FIAT.

/Anders

> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev

---

From: Anders Logg <[email-masked]>
Date: Sun, 14 Jan 2007 23:51:21 +0100

Also, please send the patch as a hg bundle:

    0. Fix your ~/.hgrc with something like

        [ui]
        username = "You name <[email-masked]>"

    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

---

From: Andy Terrel <[email-masked]>
Date: Mon, 15 Jan 2007 12:06:57 -0600

Here you go.

-- 

====================
Andy Terrel
Computer Science Dept
University of Chicago
[email-masked]
---------------------

Flying is simple. 
You just throw yourself at the ground and miss.
              -Hitchhiker's Guide to the Galaxy