lap-solvers.edp

load "SuperLu" 
load "NewSolver" 
verbosity=3; 
//  a example to test the level of optimisation 
// -------------------------------------------- 
int nn=300; 
 mesh Th=square(nn,nn); 
verbosity=5; 
 fespace Vh(Th,P1);     // P1 FE space 
 Vh uh,vh;              // unkown and test function. 
 func f=1;                 //  right hand side function 
 func g=0;                 //  boundary condition function 

 problem laplace0(uh,vh) =                    //  definion of  the problem 
    int2d(Th)( dx(uh)*dx(vh) + dy(uh)*dy(vh) ) //  bilinear form 
  + int1d(Th,1)( uh*vh) 
  + int1d(Th,1)( - vh) 
  + int2d(Th)( -f*vh )                          //  linear form 
  + on(2,3,4,uh=g) ;                      //  boundary condition form 

defaulttoUMFPACK(); 
real cpu=clock() ; 
laplace0; // solve the problem plot(uh); // to see the result 
cout << "-- lap UMFPACK " << nn << "x" << nn << "  : " <<  -cpu+clock() << " s,  max =" << uh[].max << endl; 
uh=0; 
defaulttoSuperLU(); 
cpu=clock() ; 
laplace0; // solve the problem plot(uh); // to see the result 
cout << "-- lap SuperLU " << nn << "x" << nn << "  : " <<  -cpu+clock() << " s,  max =" << uh[].max << endl; 
uh=0;