oomph::ProblemBasedShiftInvertOperator Class Reference

Class for the shift invert operation. More...

#include <trilinos_eigen_solver.h>

+ Inheritance diagram for oomph::ProblemBasedShiftInvertOperator:

Public Member Functions

 ProblemBasedShiftInvertOperator (Problem *const &problem_pt, LinearSolver *const &linear_solver_pt, const double &sigma=0.0)
 
void apply (const DoubleMultiVector &x, DoubleMultiVector &y) const
 The apply interface. More...
 
- Public Member Functions inherited from oomph::DoubleMultiVectorOperator
 DoubleMultiVectorOperator ()
 Empty constructor. More...
 
virtual ~DoubleMultiVectorOperator ()
 virtual destructor More...
 

Private Attributes

ProblemProblem_pt
 
LinearSolverLinear_solver_pt
 
double Sigma
 
CRDoubleMatrixM_pt
 
CRDoubleMatrixAsigmaM_pt
 

Detailed Description

Class for the shift invert operation.

Constructor & Destructor Documentation

◆ ProblemBasedShiftInvertOperator()

oomph::ProblemBasedShiftInvertOperator::ProblemBasedShiftInvertOperator ( Problem *const &  problem_pt,
LinearSolver *const &  linear_solver_pt,
const double sigma = 0.0 
)
inline
507  : Problem_pt(problem_pt), Linear_solver_pt(linear_solver_pt), Sigma(sigma)
508  {
509  // Before we get into the Arnoldi loop solve the shifted matrix problem
510  // Allocated Row compressed matrices for the mass matrix and shifted main
511  // matrix
512  M_pt = new CRDoubleMatrix(problem_pt->dof_distribution_pt());
513  AsigmaM_pt = new CRDoubleMatrix(problem_pt->dof_distribution_pt());
514 
515  // Assemble the matrices
516  problem_pt->get_eigenproblem_matrices(*M_pt, *AsigmaM_pt, Sigma);
517 
518  // Do not report the time taken
520  }
void disable_doc_time()
Disable documentation of solve times.
Definition: linear_solver.h:116
double Sigma
Definition: trilinos_eigen_solver.h:498
CRDoubleMatrix * AsigmaM_pt
Definition: trilinos_eigen_solver.h:501
LinearSolver * Linear_solver_pt
Definition: trilinos_eigen_solver.h:495
CRDoubleMatrix * M_pt
Definition: trilinos_eigen_solver.h:501
Problem * Problem_pt
Definition: trilinos_eigen_solver.h:492
int sigma
Definition: calibrate.py:179

References AsigmaM_pt, oomph::LinearSolver::disable_doc_time(), oomph::Problem::dof_distribution_pt(), oomph::Problem::get_eigenproblem_matrices(), Linear_solver_pt, M_pt, and Sigma.

Member Function Documentation

◆ apply()

void oomph::ProblemBasedShiftInvertOperator::apply ( const DoubleMultiVector x,
DoubleMultiVector y 
) const
inlinevirtual

The apply interface.

Implements oomph::DoubleMultiVectorOperator.

525  {
526  const unsigned n_vec = x.nvector();
527  const unsigned n_row_local = x.nrow_local();
528  if (n_vec > 1)
529  {
531  }
532  // Solve the first vector
533 
534  DoubleVector X(x.distribution_pt());
535  // Premultiply by mass matrix
536  M_pt->multiply(x.doublevector(0), X);
537  // For some reason I need to create a new vector and copy here
538  // This is odd and not expected, examine carefully
539  DoubleVector Y(x.distribution_pt());
541  // Need to synchronise
542  //#ifdef OOMPH_HAS_MPI
543  // Problem_pt->synchronise_all_dofs();
544  //#endif
545  for (unsigned i = 0; i < n_row_local; i++)
546  {
547  y(0, i) = Y[i];
548  }
549 
550  // Now loop over the others and resolve
551  for (unsigned v = 1; v < n_vec; ++v)
552  {
553  M_pt->multiply(x.doublevector(v), X);
555  //#ifdef OOMPH_HAS_MPI
556  // Problem_pt->synchronise_all_dofs();
557  //#endif
558  for (unsigned i = 0; i < n_row_local; i++)
559  {
560  y(v, i) = Y[i];
561  }
562  }
563  }
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
void multiply(const DoubleVector &x, DoubleVector &soln) const
Multiply the matrix by the vector x: soln=Ax.
Definition: matrices.cc:1782
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
virtual void enable_resolve()
Definition: linear_solver.h:135
virtual void resolve(const DoubleVector &rhs, DoubleVector &result)
Definition: linear_solver.h:225
#define X
Definition: icosphere.cpp:20
Scalar * y
Definition: level1_cplx_impl.h:128
list x
Definition: plotDoE.py:28
const char Y
Definition: test/EulerAngles.cpp:32

References AsigmaM_pt, oomph::LinearSolver::enable_resolve(), i, Linear_solver_pt, M_pt, oomph::CRDoubleMatrix::multiply(), oomph::LinearSolver::resolve(), oomph::LinearSolver::solve(), v, plotDoE::x, X, y, and Y.

Member Data Documentation

◆ AsigmaM_pt

CRDoubleMatrix * oomph::ProblemBasedShiftInvertOperator::AsigmaM_pt
private

◆ Linear_solver_pt

LinearSolver* oomph::ProblemBasedShiftInvertOperator::Linear_solver_pt
private

◆ M_pt

CRDoubleMatrix* oomph::ProblemBasedShiftInvertOperator::M_pt
private

◆ Problem_pt

Problem* oomph::ProblemBasedShiftInvertOperator::Problem_pt
private

◆ Sigma

double oomph::ProblemBasedShiftInvertOperator::Sigma
private

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