pnpn2_ex.cpp File Reference

#include <SyFi.h>
#include <fstream>

Go to the source code of this file.

Functions

int main ()


Function Documentation

int main (  ) 

Definition at line 8 of file pnpn2_ex.cpp.

References SyFi::compare_archives(), SyFi::Lagrange::compute_basis_functions(), SyFi::VectorLagrange::compute_basis_functions(), SyFi::compute_Stokes_element_matrix(), SyFi::initSyFi(), SyFi::istr(), SyFi::StandardFE::set_order(), SyFi::StandardFE::set_polygon(), SyFi::VectorLagrange::set_size(), and test::usage.

00008            {
00009 
00010   initSyFi(2); 
00011 
00012   ReferenceTriangle domain; 
00013 
00014   int order = 5; 
00015 
00016   VectorLagrange v_fe;
00017   v_fe.set_order(order);
00018   v_fe.set_size(2); 
00019   v_fe.set_polygon(domain);
00020   v_fe.compute_basis_functions();
00021 
00022   Lagrange p_fe;
00023   p_fe.set_order(order-2);
00024   p_fe.set_polygon(domain);
00025   p_fe.compute_basis_functions();
00026 
00027 
00028   usage(v_fe, p_fe); 
00029 
00030   Dof dof; 
00031   std::map<std::pair<unsigned int,unsigned int>, ex> A; 
00032   compute_Stokes_element_matrix(v_fe, p_fe, dof, A);  
00033 
00034 
00035   // regression test 
00036 
00037   archive ar; 
00038   map<std::pair<unsigned int,unsigned int>,ex>::iterator iter; 
00039   for (iter = A.begin(); iter != A.end() ; iter++) {
00040     ar.archive_ex((*iter).second, istr("A_", (*iter).first.first, (*iter).first.second).c_str()); 
00041   }
00042   ofstream vfile("pnpn2_ex.gar.v"); 
00043   vfile << ar; vfile.close(); 
00044   if(!compare_archives("pnpn2_ex.gar.v", "pnpn2_ex.gar.r")) { 
00045     cerr << "Failure!" << endl;
00046     return -1;
00047   }
00048 
00049   return 0; 
00050 }


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