arnoldfalkwinther.cpp

Go to the documentation of this file.
00001 #include <SyFi.h>
00002 
00003 using namespace GiNaC; 
00004 
00005 int main() {
00006    ReferenceTetrahedron tetrahedron; 
00007 
00008    nsd = 3; 
00009    int order = 3; 
00010 
00011 
00012    ArnoldFalkWintherWeakSymSigma sigma_fe; 
00013    sigma_fe.set(order); 
00014    sigma_fe.set(tetrahedron); 
00015    sigma_fe.compute_basis_functions(); 
00016    for (int i=0; i<sigma_fe.nbf(); i++) {
00017      cout <<"sigma_fe.N("<<i<<")="<<sigma_fe.N(i)<<endl; ; 
00018      cout <<"div(sigma_fe.N("<<i<<"))="<<div(sigma_fe.N(i))<<endl; ; 
00019      cout <<"sigma_fe.dof("<<i<<"))="<<sigma_fe.dof(i)<<endl; ; 
00020    }
00021 
00022    map<pair<int,int>,ex> A; 
00023    pair<int,int> index; 
00024    for (int i=0; i<sigma_fe.nbf(); i++) {
00025      index.first = i; 
00026      for (int j=0; j<sigma_fe.nbf(); j++) {
00027        index.second = j; 
00028        ex integrand = inner(sigma_fe.N(i), sigma_fe.N(j)); 
00029        A[index] = tetrahedron.integrate(integrand); 
00030        cout <<"A["<<i<<","<<j<<"]="<<A[index]<<endl; 
00031      }
00032    }
00033 
00034 
00035 
00036 
00037    ArnoldFalkWintherWeakSymU u_fe; 
00038    u_fe.set(order); 
00039    u_fe.set(tetrahedron); 
00040    u_fe.compute_basis_functions(); 
00041    for (int i=0; i<u_fe.nbf(); i++) {
00042      cout <<"u_fe.N("<<i<<")="<<u_fe.N(i)<<endl; ; 
00043    }
00044 
00045    map<pair<int,int>,ex> B; 
00046    for (int i=0; i<sigma_fe.nbf(); i++) {
00047      index.first = i; 
00048      for (int j=0; j<u_fe.nbf(); j++) {
00049        index.second = j; 
00050        ex integrand = inner(div(sigma_fe.N(i)), u_fe.N(j)); 
00051        B[index] = tetrahedron.integrate(integrand); 
00052        cout <<"B["<<i<<","<<j<<"]="<<B[index]<<endl; 
00053      }
00054    }
00055 
00056 
00057 
00058 
00059    ArnoldFalkWintherWeakSymP p_fe; 
00060    p_fe.set(order); 
00061    p_fe.set(tetrahedron); 
00062    p_fe.compute_basis_functions(); 
00063    for (int i=0; i<p_fe.nbf(); i++) {
00064      cout <<"p_fe.N("<<i<<")="<<p_fe.N(i)<<endl; ; 
00065    }
00066 
00067 
00068 
00069 }
00070 

Generated on Tue Jun 13 13:18:38 2006 for SyFi by  doxygen 1.4.4