disconlagrange_ex.cpp File Reference

#include <SyFi.h>

Go to the source code of this file.

Functions

int main ()


Function Documentation

int main (  ) 

Definition at line 7 of file disconlagrange_ex.cpp.

References SyFi::DiscontinuousLagrange::compute_basis_functions(), SyFi::StandardFE::dof(), demos::crouzeixraviart::fe, SyFi::Dof::glob2loc(), SyFi::Dof::glob_dof(), SyFi::initSyFi(), SyFi::Dof::insert_dof(), SyFi::StandardFE::nbf(), SyFi::DiscontinuousLagrange::set_element_number(), SyFi::StandardFE::set_order(), SyFi::StandardFE::set_polygon(), SyFi::Dof::size(), and test::usage.

00007            {
00008 
00009     initSyFi(2); 
00010 
00011     Dof dof(true, true); 
00012     // create two triangles
00013     Triangle t1(lst(0,0), lst(1,0), lst(0,1)); 
00014     Triangle t2(lst(1,1), lst(1,0), lst(0,1)); 
00015 
00016     int order = 2; 
00017 
00018     DiscontinuousLagrange fe; 
00019     fe.set_order(order); 
00020     fe.set_polygon(t1); 
00021     fe.set_element_number(1); 
00022     fe.compute_basis_functions(); 
00023     usage(fe); 
00024     for (unsigned int i=0; i< fe.nbf(); i++) {
00025         dof.insert_dof(1,i,fe.dof(i)); 
00026     }
00027 
00028     fe.set_polygon(t2); 
00029     fe.set_element_number(2); 
00030     fe.compute_basis_functions(); 
00031     usage(fe); 
00032     for (unsigned int i=0; i< fe.nbf(); i++) {
00033         dof.insert_dof(2,i,fe.dof(i)); 
00034     }
00035 
00036     // Print out the global degrees of freedom an their 
00037     // corresponding local degrees of freedom 
00038     vector<pair<unsigned int,unsigned int> > vec; 
00039     pair<unsigned int,unsigned int> index; 
00040     ex exdof; 
00041     for (unsigned int i=0; i< dof.size(); i++) {
00042         exdof = dof.glob_dof(i); 
00043         vec = dof.glob2loc(i);
00044         cout <<"global dof " <<i<<" dof "<<exdof<<endl; 
00045         for (unsigned int j=0; j<vec.size(); j++) { 
00046             index = vec[j]; 
00047             cout <<"  element "<<index.first<<" local dof "<<index.second<<endl; 
00048         }
00049     }
00050 }


Generated on Mon Aug 31 16:16:49 2009 for SyFi by  doxygen 1.5.9