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

# poisson_reference.cpp

Go to the documentation of this file.

    00001 #include <FE.h>
    00002
    00003
    00004 // could have several versions of this example
    00005 // 1. Std example using the reference element
    00006 // 2. Example using globale element
    00007 // 3. Simple code generation, just printing out a element matrix
    00008 // 4. Code generation towards a backend FFC
    00009 // 5. With Diffpack
    00010 // 6. With ML
    00011
    00012
    00013
    00014 void poisson_reference() {
    00015   std::map<std::pair<int,int>,double> A;
    00016   std::map<int, double> b;
    00017   std::pair<int,int> index;
    00018
    00019   LagrangeFE fe;
    00020   Dof           dof;
    00021   int t=0;
    00022
    00023   ReferenceTriangle triangle;
    00024   int ig, jg;
    00025   fe.set(triangle);
    00026   fe.compute_basis_functions();
    00027   for (int i=1; i <= fe.nbf(); i++) {
    00028     ig = dof.glob_dof(t, i, fe.dof(i));
    00029     index.first = ig;
    00030     for (int j=1; j <= fe.nbf(); j++) {
    00031       jg = dof.glob_dof(t,j fe.dof(j));
    00032       index.second = jg;
    00033       A[index] += integral(triangle,grad(fe.N(i)*grad(fe.N(j))));
    00034     }
    00035     b[ig] += integral(triangle,f*fe.N(i));
    00036   }
    00037 }
    00038
    00039
    00040
    00041 }
    00042
    00043