dof_ex3.cpp

Go to the documentation of this file.
00001 #include <SyFi.h>
00002 #include <ptv.h>
00003 
00004 //double ptv::tolerance = 0.0001; 
00005 
00006 int main() {
00007 
00008   DofT<ptv,ptv_is_less> dof; 
00009 
00010   // initialization of ptv used as dof 
00011 
00012   // first triangle 
00013   double x[2];
00014   x[0] = 0.0; x[1] = 0.0;  
00015   ptv p(2,x); 
00016   dof.insert_dof(1,1,p); 
00017 
00018   p[0] = 1.0; p[1] = 0.0;  
00019   dof.insert_dof(1,2,p); 
00020 
00021   p[0] = 0.0; p[1] = 1.0;  
00022   dof.insert_dof(1,3,p); 
00023 
00024   // second triangle 
00025   p[0] = 1.0; p[1] = 1.0;  
00026   dof.insert_dof(2,1,p); 
00027 
00028   p[0] = 1.0; p[1] = 0.0;  
00029   dof.insert_dof(2,2,p); 
00030 
00031   p[0] = 0.0; p[1] = 1.0;  
00032   dof.insert_dof(2,3,p); 
00033 
00034 
00035 
00036   // print out the global dofs
00037   // and their corresponding local dofs
00038 
00039   vector<pair<int,int> > vec; 
00040   pair<int,int> index; 
00041   ptv exdof; 
00042   for (int i=0; i< dof.size(); i++) {
00043     exdof = dof.glob_dof(i); 
00044     cout <<"global dof " <<i<<" dof "<<exdof<<endl; 
00045     vec = dof.glob2loc(i);
00046     for (int j=0; j<vec.size(); j++) { 
00047       index = vec[j]; 
00048       cout <<"  element "<<index.first<<" local dof "<<index.second<<endl; 
00049     }
00050   }
00051 }
00052 
00053 
00054 

Generated on Wed Apr 19 12:38:13 2006 for SyFi by  doxygen 1.4.4