SyFi  0.3
pnpn2_ex.cpp File Reference
#include <SyFi.h>
#include <fstream>

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main ( )

Definition at line 8 of file pnpn2_ex.cpp.

References SyFi::compare_archives(), SyFi::Lagrange::compute_basis_functions(), SyFi::VectorLagrange::compute_basis_functions(), SyFi::compute_Stokes_element_matrix(), SyFi::initSyFi(), SyFi::istr(), SyFi::StandardFE::set_order(), SyFi::StandardFE::set_polygon(), SyFi::VectorLagrange::set_size(), and SyFi::usage().

           {

  initSyFi(2); 

  ReferenceTriangle domain; 

  int order = 5; 

  VectorLagrange v_fe;
  v_fe.set_order(order);
  v_fe.set_size(2); 
  v_fe.set_polygon(domain);
  v_fe.compute_basis_functions();

  Lagrange p_fe;
  p_fe.set_order(order-2);
  p_fe.set_polygon(domain);
  p_fe.compute_basis_functions();


  usage(v_fe, p_fe); 

  Dof dof; 
  std::map<std::pair<unsigned int,unsigned int>, ex> A; 
  compute_Stokes_element_matrix(v_fe, p_fe, dof, A);  


  // regression test 

  archive ar; 
  map<std::pair<unsigned int,unsigned int>,ex>::iterator iter; 
  for (iter = A.begin(); iter != A.end() ; iter++) {
    ar.archive_ex((*iter).second, istr("A_", (*iter).first.first, (*iter).first.second).c_str()); 
  }
  ofstream vfile("pnpn2_ex.gar.v"); 
  vfile << ar; vfile.close(); 
  if(!compare_archives("pnpn2_ex.gar.v", "pnpn2_ex.gar.r")) { 
    cerr << "Failure!" << endl;
    return -1;
  }

  return 0; 
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator