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