Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

P1Tet.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 
00004 #ifndef __P1TET_H
00005 #define __P1TET_H
00006 
00007 #include <dolfin/FunctionSpace.h>
00008 #include <dolfin/ShapeFunction.h>
00009 #include <dolfin/ExpressionFunction.h>
00010 
00011 namespace dolfin {
00012   
00013   class P1Tet : public FunctionSpace {
00014   public:
00015     
00016     // Definition of the local function space
00017     P1Tet() : FunctionSpace(4)
00018     {
00019       // Define shape functions
00020       ShapeFunction v0(tet10);
00021       ShapeFunction v1(tet11);
00022       ShapeFunction v2(tet12);
00023       ShapeFunction v3(tet13);
00024       
00025       // Add shape functions and specify derivatives
00026       add(v0, -1.0, -1.0, -1.0);
00027       add(v1,  1.0,  0.0,  0.0);
00028       add(v2,  0.0,  1.0,  0.0);
00029       add(v3,  0.0,  0.0,  1.0);
00030     }
00031     
00032     // Mapping from local to global degrees of freedom
00033     int dof(int i, const Cell& cell) const
00034     {
00035       return cell.nodeID(i);
00036     }
00037     
00038     // Evalutation of degrees of freedom
00039     real dof(int i, const Cell& cell, const ExpressionFunction& f, real t) const
00040     {
00041       Point p = cell.coord(i);
00042       return f(p.x, p.y, p.z, t);
00043     }
00044     
00045   };
00046   
00047 }
00048 
00049 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.