#include <SyFi.h>
Go to the source code of this file.
Functions | |
int | main () |
|
Definition at line 5 of file fe_ex2.cpp. References LagrangeFE::compute_basis_functions(), grad(), inner(), Triangle::integrate(), LagrangeFE::N(), LagrangeFE::nbf(), and LagrangeFE::set(). 00005 { 00006 Triangle T(lst(0,0), lst(1,0), lst(0,1), "t"); 00007 int order = 2; 00008 00009 std::map<std::pair<int,int>, ex> A; 00010 std::pair<int,int> index; 00011 LagrangeFE fe; 00012 fe.set(order); 00013 fe.set(T); 00014 fe.compute_basis_functions(); 00015 for (int i=0; i< fe.nbf() ; i++) { 00016 index.first = i; 00017 for (int j=0; j< fe.nbf() ; j++) { 00018 index.second = j; 00019 ex nabla = inner(grad(fe.N(i)), grad(fe.N(j))); 00020 ex Aij = T.integrate(nabla); 00021 A[index] = Aij; 00022 } 00023 } 00024 00025 map<std::pair<int,int>,ex>::iterator iter; 00026 for (iter = A.begin(); iter != A.end() ; iter++) { 00027 ex intf = (*iter).second; 00028 cout <<"A["<<(*iter).first.first<<","<<(*iter).first.second<<"]="<<(*iter).second<<endl; 00029 } 00030 00031 00032 00033 }
|