taylorhood_ex.cpp
Go to the documentation of this file.00001 #include <SyFi.h>
00002 #include <fstream>
00003
00004 using namespace GiNaC;
00005 using namespace SyFi;
00006 using namespace std;
00007
00008 int main() {
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
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 }
00051