oomph::DocLinearSolverInfo Class Reference

#include <oomph_utilities.h>

Public Member Functions

 DocLinearSolverInfo ()
 
void setup_new_time_step ()
 Set up a new vector of pairs for a new time step. More...
 
void clear_current_time_step ()
 
void add_iteration_and_time (unsigned iter, double prec_setup_time, double linear_solver_time)
 Add a new iteration and time pair. More...
 
unsigned current_ntime_step () const
 The number of time steps. More...
 
unsigned current_nnewton_step () const
 The number of Newton steps. More...
 
Vector< Vector< Vector< double > > > & iterations_and_times ()
 Accessor function for the iteration and times. More...
 
Vector< Vector< Vector< double > > > iterations_and_times () const
 Accessor function for the iteration and times (const version). More...
 

Private Attributes

Vector< Vector< Vector< double > > > Iterations_and_times
 Storage for number of iterations during Newton steps. More...
 

Detailed Description

Collection of data structures for storing information about linear solves. Currently only contains storage for the iteration counts and the linear solver time.

Constructor & Destructor Documentation

◆ DocLinearSolverInfo()

oomph::DocLinearSolverInfo::DocLinearSolverInfo ( )
inline

Constructor. Initialised the Iterations_and_times vector of vector of pairs.

Vector< Vector< Vector< double > > > Iterations_and_times
Storage for number of iterations during Newton steps.
Definition: oomph_utilities.h:489

Member Function Documentation

◆ add_iteration_and_time()

void oomph::DocLinearSolverInfo::add_iteration_and_time ( unsigned  iter,
double  prec_setup_time,
double  linear_solver_time 
)
inline

Add a new iteration and time pair.

444  {
445 #ifdef PARANOID
446  if (Iterations_and_times.size() == 0)
447  {
448  std::ostringstream error_message;
449  error_message << "Iterations_and_times is empty. "
450  << "Call setup_new_time_step()\n";
451  throw OomphLibError(error_message.str(),
454  }
455 #endif
456  Vector<double> tmp_iter_time_vec(3, 0);
457  tmp_iter_time_vec[0] = (double)iter;
458  tmp_iter_time_vec[1] = prec_setup_time;
459  tmp_iter_time_vec[2] = linear_solver_time;
460  Iterations_and_times.back().push_back(tmp_iter_time_vec);
461  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ clear_current_time_step()

void oomph::DocLinearSolverInfo::clear_current_time_step ( )
inline
435  {
436  Iterations_and_times.pop_back();
438  }
void setup_new_time_step()
Set up a new vector of pairs for a new time step.
Definition: oomph_utilities.h:427

◆ current_nnewton_step()

unsigned oomph::DocLinearSolverInfo::current_nnewton_step ( ) const
inline

The number of Newton steps.

471  {
472  return Iterations_and_times.back().size();
473  }

◆ current_ntime_step()

unsigned oomph::DocLinearSolverInfo::current_ntime_step ( ) const
inline

The number of time steps.

465  {
466  return Iterations_and_times.size();
467  }

◆ iterations_and_times() [1/2]

Vector<Vector<Vector<double> > >& oomph::DocLinearSolverInfo::iterations_and_times ( )
inline

Accessor function for the iteration and times.

477  {
478  return Iterations_and_times;
479  }

◆ iterations_and_times() [2/2]

Vector<Vector<Vector<double> > > oomph::DocLinearSolverInfo::iterations_and_times ( ) const
inline

Accessor function for the iteration and times (const version).

483  {
484  return Iterations_and_times;
485  }

◆ setup_new_time_step()

void oomph::DocLinearSolverInfo::setup_new_time_step ( )
inline

Set up a new vector of pairs for a new time step.

428  {
429  // For each new time step, we have a new vector consisting of pairs of
430  // unsigned (for the iteration) and double (for the timing results).
431  Iterations_and_times.push_back(Vector<Vector<double>>());
432  }
Matrix< Type, Size, 1 > Vector
\cpp11 SizeƗ1 vector of type Type.
Definition: Eigen/Eigen/src/Core/Matrix.h:515

Member Data Documentation

◆ Iterations_and_times

Vector<Vector<Vector<double> > > oomph::DocLinearSolverInfo::Iterations_and_times
private

Storage for number of iterations during Newton steps.


The documentation for this class was generated from the following file: