sparse_assemble_test.cc File Reference
#include <time.h>
#include "generic.h"
#include "navier_stokes.h"
#include "meshes/simple_rectangular_quadmesh.h"

Classes

class  RectangularDrivenCavityProblem< ELEMENT >
 Driven cavity problem in rectangular domain. More...
 

Namespaces

 Global_Variables
 Namespace for physical parameters.
 

Functions

int main (int argc, char *argv[])
 Driver to compare different assembly strategies. More...
 

Variables

unsigned Global_Variables::Nx =4
 Number of elements in x direction. More...
 
unsigned Global_Variables::Ny =4
 Number of elements in x direction. More...
 
bool Global_Variables::Dump_matrices =true
 By default we're dumping the matrices for comparison. More...
 
bool Global_Variables::Halt_code =false
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver to compare different assembly strategies.

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

401 {
402 
403  // Store command line arguments
404  CommandLineArgs::setup(argc,argv);
405 
406  cout << "Testing sparse assembly" << endl;
407  cout << "-----------------------" << endl;
408 
409  // Loop over all assembly strategies or just do one?
410  unsigned lo_method=1;
411  unsigned hi_method=8;
412 
413  if (CommandLineArgs::Argc==1)
414  {
415  std::cout
416  << "No command line args specified -- running all assembly strategies"
417  << std::endl;
418  }
419  else if (CommandLineArgs::Argc==6)
420  {
421  Global_Variables::Nx=atoi(argv[1]);
422  Global_Variables::Ny=atoi(argv[1]);
423  lo_method=atoi(argv[3]);
424  hi_method=atoi(argv[3]);
425  std::cout << "Assembly method: " << hi_method << std::endl;
426  Global_Variables::Dump_matrices=atoi(argv[4]);
427  Global_Variables::Halt_code=atoi(argv[5]);
428  }
429  else
430  {
431  std::cout
432  << "Wrong number of command line args specified!\n"
433  << "Specify none or five: \n"
434  << "- Number of elements in x-direction\n"
435  << "- Number of elements in y-direction\n"
436  << "- assembly method [1-4]\n"
437  << "- output of matrices [0/1]\n"
438  << "- halt code to analyse memory usage [0/1]\n"
439  << std::endl;
440  exit(1);
441  }
442 
443 
444  cout << "Mesh with "
445  << Global_Variables::Nx << " x "
446  << Global_Variables::Ny << " elements."
447  << std::endl;
448 
449  for (unsigned method = lo_method; method<=hi_method; method++)
450  {
451  // Build the problem with QTaylorHoodElements
453 
454  // Perform actions before solve to get the problem ready
455  problem.actions_before_newton_solve();
456 
457  // Run with assembly with specified method
458  problem.compare_assembly_strategies(method);
459 
460  }
461 
462 } // end_of_main
Driven cavity problem in rectangular domain.
Definition: linear_solvers/driven_cavity.cc:77
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
unsigned Nx
Number of elements in x direction.
Definition: sparse_assemble_test.cc:55
unsigned Ny
Number of elements in x direction.
Definition: sparse_assemble_test.cc:58
bool Halt_code
Definition: sparse_assemble_test.cc:65
bool Dump_matrices
By default we're dumping the matrices for comparison.
Definition: sparse_assemble_test.cc:61
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::Argc, Global_Variables::Dump_matrices, Global_Variables::Halt_code, Global_Variables::Nx, Global_Variables::Ny, problem, and Flag_definition::setup().