← Back to team overview

dolfin team mailing list archive

patch to enable CellData export for vector functions

 

I prepared simple patch to enable CellData export for 2D and 3D vector
functions defined over discontinuous lagrange elements.
Could you apply this to the main repository?

--- a/dolfin/io/VTKFile.cpp	Thu Dec 18 08:52:35 2008 +0100
+++ b/dolfin/io/VTKFile.cpp	Thu Dec 18 13:11:06 2008 -0700
@@ -201,6 +201,14 @@
       // FIXME: Update for new FiniteElement signatures
       //error("Discontinuous Lagrange functions of order k > 0 cannot
be written in VTK format. You may need to project your function.");
     }
+  }
+  else if(rank == 1)
+  {
+ if( (dim == 2 && element.signature() == "MixedElement([FiniteElement('Discontinuous Lagrange', 'triangle', 0),
FiniteElement('Discontinuous Lagrange', 'triangle', 0)])")
+        || (dim == 3 && element.signature() ==
"MixedElement([FiniteElement('Discontinuous Lagrange', 'tetrahedron',
0), FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0),
FiniteElement('Discontinuous Lagrange', 'tetrahedron', 0)])") )
+     {
+       data_type = "cell";
+     }
   }
   else
   {

regrd.
BArtek



Follow ups