tetrahedron_ex1.cpp
Go to the documentation of this file.00001 #include <SyFi.h>
00002 #include <fstream>
00003
00004
00005 using namespace GiNaC;
00006 using namespace SyFi;
00007 using namespace std;
00008
00009 int main() {
00010
00011 initSyFi(3);
00012
00013 archive ar;
00014
00015 ex p0 = lst(0.0,0.0,0.0);
00016 ex p1 = lst(1.0,0.0,0.0);
00017 ex p2 = lst(0.0,1.0,0.0);
00018 ex p3 = lst(0.0,0.0,1.0);
00019
00020 Tetrahedron tetrahedron(p0,p1,p2,p3);
00021
00022 ex repr = tetrahedron.repr();
00023 cout <<"t.repr "<<repr<<endl;
00024 ar.archive_ex(repr, "repr");
00025
00026 ex f = x*y*z;
00027 ex intf = tetrahedron.integrate(f);
00028 cout <<"intf "<<intf<<endl;
00029 ar.archive_ex(intf, "intf");
00030
00031 ofstream vfile("tetrahedron_ex1.gar.v");
00032 vfile << ar; vfile.close();
00033 if(!compare_archives("tetrahedron_ex1.gar.v", "tetrahedron_ex1.gar.r")) {
00034 cerr << "Failure!" << endl;
00035 return -1;
00036 }
00037
00038 return 0;
00039 }
00040