dof_ex3.cpp File Reference

#include <SyFi.h>
#include <Dof_Ptv.h>

Go to the source code of this file.

Functions

int main ()


Function Documentation

int main (  ) 

Definition at line 10 of file dof_ex3.cpp.

References DofT< D, C >::glob_dof(), DofT< D, C >::insert_dof(), SyFi::p, DofT< D, C >::size(), and SyFi::x.

00010            {
00011 
00012 
00013     Dof_Ptv dof(true,true); 
00014 
00015     // initialization of Ptv used as dof 
00016     double x[2];
00017     x[0] = 0.0; x[1] = 0.0;  
00018     Ptv p(2,x); 
00019 
00020 
00021     // first triangle 
00022     p[0] = 0.0; p[1] = 0.0;  
00023     dof.insert_dof(0,1,p); 
00024 
00025     p[0] = 1.0; p[1] = 0.0;  
00026     dof.insert_dof(0,2,p); 
00027 
00028     p[0] = 0.0; p[1] = 1.0;  
00029     dof.insert_dof(0,3,p); 
00030 
00031     // second triangle 
00032     p[0] = 1.0; p[1] = 1.0;  
00033     dof.insert_dof(1,1,p); 
00034 
00035     p[0] = 1.0; p[1] = 0.0;  
00036     dof.insert_dof(1,2,p); 
00037 
00038     p[0] = 0.0; p[1] = 1.0;  
00039     dof.insert_dof(1,3,p); 
00040 
00041 
00042 
00043     // print out the global dofs
00044     // and their corresponding local dofs
00045 
00046     vector_ii vec; 
00047     pair<unsigned int,unsigned int> index; 
00048     Ptv exdof; 
00049     for (unsigned int i=0; i< dof.size(); i++) {
00050         exdof = dof.glob_dof(i); 
00051         cout <<"global dof " <<i<<" dof "<<exdof<<endl; 
00052 //        vec = dof.glob2loc(i);
00053         for (unsigned int j=0; j<vec.size(); j++) { 
00054             index = vec[j]; 
00055             cout <<"  element "<<index.first<<" local dof "<<index.second<<endl; 
00056         }
00057     }
00058 }


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