oomph::EigenProblemHandler Class Reference

#include <assembly_handler.h>

+ Inheritance diagram for oomph::EigenProblemHandler:

Public Member Functions

 EigenProblemHandler (const double &sigma_real)
 Constructor, sets the value of the real shift. More...
 
unsigned ndof (GeneralisedElement *const &elem_pt)
 Return the number of degrees of freedom in the element elem_pt. More...
 
unsigned long eqn_number (GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
 
void get_residuals (GeneralisedElement *const &elem_pt, Vector< double > &residuals)
 Cannot call get_residuals for an eigenproblem, so throw an error. More...
 
void get_jacobian (GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Cannot call get_jacobian for an eigenproblem, so throw an error. More...
 
void get_all_vectors_and_matrices (GeneralisedElement *const &elem_pt, Vector< Vector< double >> &vec, Vector< DenseMatrix< double >> &matrix)
 
 ~EigenProblemHandler ()
 Empty virtual destructor. More...
 
- Public Member Functions inherited from oomph::AssemblyHandler
 AssemblyHandler ()
 Empty constructor. More...
 
virtual void dof_vector (GeneralisedElement *const &elem_pt, const unsigned &t, Vector< double > &dof)
 Return vector of dofs at time level t in the element elem_pt. More...
 
virtual void dof_pt_vector (GeneralisedElement *const &elem_pt, Vector< double * > &dof_pt)
 Return vector of pointers to dofs in the element elem_pt. More...
 
virtual doublelocal_problem_dof (Problem *const &problem_pt, const unsigned &t, const unsigned &i)
 
virtual void get_dresiduals_dparameter (GeneralisedElement *const &elem_pt, double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (GeneralisedElement *const &elem_pt, double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_hessian_vector_products (GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual int bifurcation_type () const
 
virtual doublebifurcation_parameter_pt () const
 
virtual void get_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
virtual void get_inner_products (GeneralisedElement *const &elem_pt, Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (GeneralisedElement *const &elem_pt, Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual ~AssemblyHandler ()
 Empty virtual destructor. More...
 

Private Attributes

double Sigma_real
 Storage for the real shift. More...
 

Detailed Description

A class that is used to define the functions used to assemble the elemental contributions to the mass matrix and jacobian (stiffness) matrix that define a generalised eigenproblem.

Constructor & Destructor Documentation

◆ EigenProblemHandler()

oomph::EigenProblemHandler::EigenProblemHandler ( const double sigma_real)
inline

Constructor, sets the value of the real shift.

229 : Sigma_real(sigma_real) {}
double Sigma_real
Storage for the real shift.
Definition: assembly_handler.h:225

◆ ~EigenProblemHandler()

oomph::EigenProblemHandler::~EigenProblemHandler ( )
inline

Empty virtual destructor.

257 {}

Member Function Documentation

◆ eqn_number()

unsigned long oomph::EigenProblemHandler::eqn_number ( GeneralisedElement *const &  elem_pt,
const unsigned ieqn_local 
)
virtual

Return the global equation number of the local unknown ieqn_local in elem_pt.

Get the global equation number of the local unknown. Direct call to the function in the element.

Reimplemented from oomph::AssemblyHandler.

317  {
318  return elem_pt->eqn_number(ieqn_local);
319  }

References oomph::GeneralisedElement::eqn_number().

◆ get_all_vectors_and_matrices()

void oomph::EigenProblemHandler::get_all_vectors_and_matrices ( GeneralisedElement *const &  elem_pt,
Vector< Vector< double >> &  vec,
Vector< DenseMatrix< double >> &  matrix 
)
virtual

Calculate all desired vectors and matrices provided by the element elem_pt.

Calculate all desired vectors and matrices that are required by the problem by calling those of the underlying element.

Reimplemented from oomph::AssemblyHandler.

354  {
355 #ifdef PARANOID
356  // Check dimension
357  if (matrix.size() != 2)
358  {
359  throw OomphLibError("EigenProblems should return two matrices",
362  }
363 #endif
364  // Find the number of variables
365  unsigned n_var = elem_pt->ndof();
366  // Assign a dummy residuals vector
367  Vector<double> dummy(n_var);
368  // Get the jacobian and mass matrices
369  elem_pt->get_jacobian_and_mass_matrix(dummy, matrix[0], matrix[1]);
370 
371  // If we have a non-zero shift, then shift the A matrix
372  if (Sigma_real != 0.0)
373  {
374  // Set the shifted matrix
375  for (unsigned i = 0; i < n_var; i++)
376  {
377  for (unsigned j = 0; j < n_var; j++)
378  {
379  matrix[0](i, j) -= Sigma_real * matrix[1](i, j);
380  }
381  }
382  }
383  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::GeneralisedElement::get_jacobian_and_mass_matrix(), i, j, matrix(), oomph::GeneralisedElement::ndof(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Sigma_real.

◆ get_jacobian()

void oomph::EigenProblemHandler::get_jacobian ( GeneralisedElement *const &  elem_pt,
Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
virtual

Cannot call get_jacobian for an eigenproblem, so throw an error.

Calculate the elemental Jacobian matrix "d equation / d variable" for elem_pt. Again deliberately broken in the eigenproblem

Reimplemented from oomph::AssemblyHandler.

339  {
340  throw OomphLibError("An eigenproblem does not have a get_jacobian function",
343  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ get_residuals()

void oomph::EigenProblemHandler::get_residuals ( GeneralisedElement *const &  elem_pt,
Vector< double > &  residuals 
)
virtual

Cannot call get_residuals for an eigenproblem, so throw an error.

Return the contribution to the residuals of the element elem_pt This is deliberately broken in our eigenproblem

Reimplemented from oomph::AssemblyHandler.

326  {
327  throw OomphLibError(
328  "An eigenproblem does not have a get_residuals function",
331  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ ndof()

unsigned oomph::EigenProblemHandler::ndof ( GeneralisedElement *const &  elem_pt)
virtual

Return the number of degrees of freedom in the element elem_pt.

Get the number of elemental degrees of freedom. Direct call to the function in the element.

Reimplemented from oomph::AssemblyHandler.

307  {
308  return elem_pt->ndof();
309  }

References oomph::GeneralisedElement::ndof().

Member Data Documentation

◆ Sigma_real

double oomph::EigenProblemHandler::Sigma_real
private

Storage for the real shift.

Referenced by get_all_vectors_and_matrices().


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