eigenproblems/harmonic/harmonic.cc File Reference
#include "generic.h"
#include "meshes/one_d_mesh.h"

Classes

class  ComplexLess< T >
 
class  HarmonicEquations
 
class  QHarmonicElement< NNODE_1D >
 
class  HarmonicProblem< ELEMENT, EIGEN_SOLVER >
 1D Harmonic problem in unit interval. More...
 

Functions

int main (int argc, char **argv)
 Driver for 1D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver for 1D Poisson problem.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

443 {
444 //Want to test Trilinos if we have it, so we must initialise MPI
445 //if we have compiled with it
446 #ifdef OOMPH_HAS_MPI
447  MPI_Helpers::init(argc,argv);
448 #endif
449 
450  // Set up the problem:
451  unsigned n_element=100; //Number of elements
452 
453  clock_t t_start1 = clock();
454  //Solve with ARPACK
455  {
457  problem(n_element);
458 
459  std::cout << "Matrix size " << problem.ndof() << std::endl;
460 
461  problem.solve(1);
462  }
463  clock_t t_end1 = clock();
464 
465  clock_t t_start2 = clock();
466  //Solve with LAPACK_QZ
467  {
469  problem(n_element);
470 
471  problem.solve(2);
472  }
473  clock_t t_end2 = clock();
474 
475 #ifdef OOMPH_HAS_TRILINOS
476  clock_t t_start3 = clock();
477 //Solve with Anasazi
478  {
480  problem.solve(3);
481  }
482  clock_t t_end3 = clock();
483 #endif
484 
485  std::cout << "ARPACK TIME: " << (double)(t_end1 - t_start1)/CLOCKS_PER_SEC
486  << std::endl;
487 
488  std::cout << "LAPACK TIME: " << (double)(t_end2 - t_start2)/CLOCKS_PER_SEC
489  << std::endl;
490 
491 #ifdef OOMPH_HAS_TRILINOS
492  std::cout << "ANASAZI TIME: " << (double)(t_end3 - t_start3)/CLOCKS_PER_SEC
493  << std::endl;
494 #endif
495 
496 #ifdef OOMPH_HAS_MPI
497  MPI_Helpers::finalize();
498 #endif
499 
500 } // end of main
1D Harmonic problem in unit interval.
Definition: eigenproblems/harmonic/harmonic.cc:269
Class for the Anasazi eigensolver.
Definition: trilinos_eigen_solver.h:571
Class for the ARPACK eigensolver.
Definition: eigen_solver.h:104
Class for the LAPACK eigensolver.
Definition: eigen_solver.h:224
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References problem.