#include <SyFi.h>
#include <fstream>
Go to the source code of this file.
Functions | |
int | main () |
int main | ( | ) |
Definition at line 8 of file box_ex1.cpp.
References SyFi::compare_archives(), demos::simple::f, SyFi::initSyFi(), SyFi::Box::integrate(), demos::crouzeixraviart::p0, SyFi::Box::repr(), SyFi::x, SyFi::y, and SyFi::z.
00008 { 00009 00010 initSyFi(3); 00011 00012 ex f = x*y*z; 00013 00014 // integration over the reference box 00015 ReferenceBox box; 00016 00017 ex repr = box.repr(); 00018 cout <<"b.repr "<<repr<<endl; 00019 00020 ex intf = box.integrate(f); 00021 cout <<"intf "<<intf<<endl; 00022 00023 // integration over the another box 00024 ex p0 = lst(-1.0,-1.0,-1.0); 00025 ex p1 = lst( 1.0, 1.0, 1.0); 00026 00027 Box box2(p0,p1); 00028 00029 ex repr2 = box2.repr(); 00030 cout <<"b2.repr "<<repr<<endl; 00031 00032 00033 00034 ex intf2 = box2.integrate(f); 00035 cout <<"intf2 "<<intf2<<endl; 00036 00037 00038 // regression test 00039 00040 archive ar; 00041 ar.archive_ex(repr, "repr"); 00042 ar.archive_ex(intf, "intf"); 00043 ar.archive_ex(repr2, "repr2"); 00044 ar.archive_ex(intf2, "intf2"); 00045 00046 00047 ofstream vfile("box_ex1.gar.v"); 00048 vfile << ar; vfile.close(); 00049 00050 if(!compare_archives("box_ex1.gar.v", "box_ex1.gar.r")) { 00051 cerr << "Failure!" << endl; 00052 return -1; 00053 } 00054 00055 return 0; 00056 }