pnpn2_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 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
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 }
00051