Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Search for

# fe_ex1.cpp

Go to the documentation of this file.

    00001 #include <SyFi.h>
    00002
    00003 using namespace GiNaC;
    00004
    00005 void usage(FE& fe) {
    00006   ex Ni;
    00007   ex gradNi;
    00008   ex dofi;
    00009   for (int i=0; i< fe.nbf() ; i++) {
    00010     Ni = fe.N(i);
    00011     gradNi = grad(Ni);
    00012     dofi = fe.dof(i);
    00013     cout <<"The basis function, N("<<i<<")="<<Ni<<endl;
    00014     cout <<"The gradient of N("<<i<<")="<<gradNi<<endl;
    00015     cout <<"The corresponding dof, L("<<i<<")="<<dofi<<endl;
    00016   }
    00017 }
    00018
    00019
    00020
    00021 int main(){
    00022   int order = 1;
    00023   Triangle triangle(lst(0,0), lst(1,0), lst(0,1));
    00024   LagrangeFE fe;
    00025   fe.set(order);
    00026   fe.set(triangle);
    00027   fe.compute_basis_functions();
    00028
    00029   usage(fe);
    00030
    00031 }
    00032
    00033