robust.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 triange;
00013 Robust fe(triange);
00014 fe.compute_basis_functions();
00015
00016 for (int i=0; i< fe.nbf(); i++) {
00017
00018 cout <<"fe.N("<<i<<")= "<<fe.N(i)<<endl;
00019 cout <<"div(fe.N("<<i<<"))= "<<(div(fe.N(i))).expand()<<endl;
00020
00021 }
00022
00023
00024
00025 archive ar;
00026
00027 for (int i=0; i< fe.nbf(); i++) {
00028 ar.archive_ex(fe.N(i), istr("N",i).c_str());
00029 ar.archive_ex((div(fe.N(i))).expand(), istr("divN",i).c_str());
00030 }
00031
00032 ofstream vfile("robust.gar.v");
00033 vfile << ar; vfile.close();
00034 if(!compare_archives("robust.gar.v", "robust.gar.r")) {
00035 cerr << "Failure!" << endl;
00036 return -1;
00037 }
00038
00039
00040
00041 return 0;
00042
00043 }
00044
00045