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


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