fe_ex1.cpp

Go to the documentation of this file.
00001 #include <SyFi.h>
00002 
00003 void usage(FE& fe) { 
00004   ex Ni; 
00005   ex gradNi; 
00006   ex dofi; 
00007   for (int i=1; i<= fe.nbf() ; i++) { 
00008     Ni = fe.N(i); 
00009     gradNi = grad(Ni); 
00010     dofi = fe.dof(i); 
00011     cout <<"The basis function, N("<<i<<")="<<Ni<<endl; 
00012     cout <<"The gradient of N("<<i<<")="<<gradNi<<endl; 
00013     cout <<"The corresponding dof, L("<<i<<")="<<dofi<<endl; 
00014   }
00015 }
00016 
00017 
00018 
00019 int main(){ 
00020   int order = 2; 
00021   Triangle triangle(lst(0,0), lst(1,0), lst(0,1));   
00022   LagrangeFE fe; 
00023   fe.set(order); 
00024   fe.set(triangle); 
00025   fe.compute_basis_functions(); 
00026 
00027   usage(fe); 
00028 
00029 }
00030 
00031 

Generated on Tue Nov 22 11:10:22 2005 for SyFi by  doxygen 1.4.4