oomph::AugmentedBlockPitchForkLinearSolver Class Reference

#include <assembly_handler.h>

+ Inheritance diagram for oomph::AugmentedBlockPitchForkLinearSolver:

Public Member Functions

 AugmentedBlockPitchForkLinearSolver (LinearSolver *const linear_solver_pt)
 Constructor, inherits the original linear solver. More...
 
 ~AugmentedBlockPitchForkLinearSolver ()
 Destructor: clean up the allocated memory. More...
 
void solve (Problem *const &problem_pt, DoubleVector &result)
 The solve function uses the block factorisation. More...
 
void solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
 
void solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
 
void resolve (const DoubleVector &rhs, DoubleVector &result)
 The resolve function also uses the block factorisation. More...
 
LinearSolverlinear_solver_pt () const
 Access function to the original linear solver. More...
 
- Public Member Functions inherited from oomph::LinearSolver
 LinearSolver ()
 Empty constructor, initialise the member data. More...
 
 LinearSolver (const LinearSolver &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const LinearSolver &)=delete
 Broken assignment operator. More...
 
virtual ~LinearSolver ()
 Empty virtual destructor. More...
 
void enable_doc_time ()
 Enable documentation of solve times. More...
 
void disable_doc_time ()
 Disable documentation of solve times. More...
 
bool is_doc_time_enabled () const
 Is documentation of solve times enabled? More...
 
bool is_resolve_enabled () const
 Boolean flag indicating if resolves are enabled. More...
 
virtual void enable_resolve ()
 
virtual void disable_resolve ()
 
virtual void solve_transpose (Problem *const &problem_pt, DoubleVector &result)
 
virtual void solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
 
virtual void solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
 
virtual void resolve_transpose (const DoubleVector &rhs, DoubleVector &result)
 
virtual void clean_up_memory ()
 
virtual double jacobian_setup_time () const
 
virtual double linear_solver_solution_time () const
 
virtual void enable_computation_of_gradient ()
 
void disable_computation_of_gradient ()
 
void reset_gradient ()
 
void get_gradient (DoubleVector &gradient)
 function to access the gradient, provided it has been computed More...
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 DistributableLinearAlgebraObject ()
 Default constructor - create a distribution. More...
 
 DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DistributableLinearAlgebraObject &)=delete
 Broken assignment operator. More...
 
virtual ~DistributableLinearAlgebraObject ()
 Destructor. More...
 
LinearAlgebraDistributiondistribution_pt () const
 access to the LinearAlgebraDistribution More...
 
unsigned nrow () const
 access function to the number of global rows. More...
 
unsigned nrow_local () const
 access function for the num of local rows on this processor. More...
 
unsigned nrow_local (const unsigned &p) const
 access function for the num of local rows on this processor. More...
 
unsigned first_row () const
 access function for the first row on this processor More...
 
unsigned first_row (const unsigned &p) const
 access function for the first row on this processor More...
 
bool distributed () const
 distribution is serial or distributed More...
 
bool distribution_built () const
 
void build_distribution (const LinearAlgebraDistribution *const dist_pt)
 
void build_distribution (const LinearAlgebraDistribution &dist)
 

Private Attributes

LinearSolverLinear_solver_pt
 Pointer to the original linear solver. More...
 
ProblemProblem_pt
 Pointer to the problem, used in the resolve. More...
 
DoubleVectorAlpha_pt
 Pointer to the storage for the vector alpha. More...
 
DoubleVectorE_pt
 Pointer to the storage for the vector e. More...
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 
- Protected Attributes inherited from oomph::LinearSolver
bool Enable_resolve
 
bool Doc_time
 Boolean flag that indicates whether the time taken. More...
 
bool Compute_gradient
 
bool Gradient_has_been_computed
 flag that indicates whether the gradient was computed or not More...
 
DoubleVector Gradient_for_glob_conv_newton_solve
 

Detailed Description

A custom linear solver class that is used to solve a block-factorised version of the PitchFork bifurcation detection problem.

Constructor & Destructor Documentation

◆ AugmentedBlockPitchForkLinearSolver()

oomph::AugmentedBlockPitchForkLinearSolver::AugmentedBlockPitchForkLinearSolver ( LinearSolver *const  linear_solver_pt)
inline

Constructor, inherits the original linear solver.

705  {
706  }
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
Definition: assembly_handler.h:690
DoubleVector * Alpha_pt
Pointer to the storage for the vector alpha.
Definition: assembly_handler.h:696
DoubleVector * E_pt
Pointer to the storage for the vector e.
Definition: assembly_handler.h:699
LinearSolver * linear_solver_pt() const
Access function to the original linear solver.
Definition: assembly_handler.h:743
Problem * Problem_pt
Pointer to the problem, used in the resolve.
Definition: assembly_handler.h:693

◆ ~AugmentedBlockPitchForkLinearSolver()

oomph::AugmentedBlockPitchForkLinearSolver::~AugmentedBlockPitchForkLinearSolver ( )

Destructor: clean up the allocated memory.

Clean up the memory that may have been allocated by the solver.

2260  {
2261  if (Alpha_pt != 0)
2262  {
2263  delete Alpha_pt;
2264  }
2265  if (E_pt != 0)
2266  {
2267  delete E_pt;
2268  }
2269  }

References Alpha_pt, and E_pt.

Member Function Documentation

◆ linear_solver_pt()

LinearSolver* oomph::AugmentedBlockPitchForkLinearSolver::linear_solver_pt ( ) const
inline

Access function to the original linear solver.

744  {
745  return Linear_solver_pt;
746  }

References Linear_solver_pt.

Referenced by oomph::PitchForkHandler::~PitchForkHandler().

◆ resolve()

void oomph::AugmentedBlockPitchForkLinearSolver::resolve ( const DoubleVector rhs,
DoubleVector result 
)
virtual

The resolve function also uses the block factorisation.

Reimplemented from oomph::LinearSolver.

2512  {
2513  std::cout << "Augmented pitchfork resolve" << std::endl;
2514  // Check that the factors have been stored
2515  if (Alpha_pt == 0)
2516  {
2517  throw OomphLibError("The required vectors have not been stored",
2520  }
2521 
2522  // Get the pointer to the problem
2523  Problem* const problem_pt = Problem_pt;
2524 
2525  PitchForkHandler* handler_pt =
2526  static_cast<PitchForkHandler*>(problem_pt->assembly_handler_pt());
2527 
2528  // Switch things to our block solver
2529  handler_pt->solve_augmented_block_system();
2530  // We need to find out the number of dofs
2531  unsigned n_dof = problem_pt->ndof();
2532 
2533  // create the linear algebra distribution for this solver
2534  // currently only global (non-distributed) distributions are allowed
2535  LinearAlgebraDistribution dist(problem_pt->communicator_pt(), n_dof, false);
2536  this->build_distribution(dist);
2537 
2538  // if the result vector is not setup then rebuild with distribution = global
2539  if (!result.built())
2540  {
2541  result.build(this->distribution_pt(), 0.0);
2542  }
2543 
2544 
2545  // Setup storage
2546  DoubleVector a(this->distribution_pt(), 0.0),
2547  b(this->distribution_pt(), 0.0);
2548 
2549  // Set the values of the a vector
2550  for (unsigned n = 0; n < n_dof; n++)
2551  {
2552  a[n] = rhs[n];
2553  }
2554 
2556 
2557  // Copy rhs vector into local storage so it doesn't get overwritten
2558  // if the linear solver decides to initialise the solution vector, say,
2559  // which it's quite entitled to do!
2560  DoubleVector input_a(a);
2561 
2562  Linear_solver_pt->resolve(input_a, a);
2563 
2564  // We can now construct our multipliers
2565  // Prepare to scale
2566  double dof_length = 0.0, a_length = 0.0;
2567  for (unsigned n = 0; n < n_dof; n++)
2568  {
2569  if (std::fabs(problem_pt->dof(n)) > dof_length)
2570  {
2571  dof_length = std::fabs(problem_pt->dof(n));
2572  }
2573 
2574  if (std::fabs(a[n]) > a_length)
2575  {
2576  a_length = std::fabs(a[n]);
2577  }
2578  }
2579  double a_mult = dof_length / a_length;
2580  const double FD_step = 1.0e-8;
2581  a_mult += FD_step;
2582  a_mult *= FD_step;
2583 
2584  DoubleVector Jprod_a(this->distribution_pt(), 0.0);
2585 
2586  unsigned long n_element = problem_pt->mesh_pt()->nelement();
2587  for (unsigned long e = 0; e < n_element; e++)
2588  {
2589  GeneralisedElement* elem_pt = problem_pt->mesh_pt()->element_pt(e);
2590  // Loop over the ndofs in each element
2591  unsigned n_var = handler_pt->ndof(elem_pt);
2592  // Get some jacobian matrices
2593  DenseMatrix<double> jac(n_var), jac_a(n_var);
2594  // the elemental residual
2595  Vector<double> res_elemental(n_var);
2596  // Get unperturbed jacobian
2597  handler_pt->get_jacobian(elem_pt, res_elemental, jac);
2598 
2599  // Backup the dofs
2600  DoubleVector dof_bac(this->distribution_pt(), 0.0);
2601  // Perturb the dofs
2602  for (unsigned n = 0; n < n_var; n++)
2603  {
2604  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2605  dof_bac[n] = problem_pt->dof(eqn_number);
2606  // Pertub by vector a
2607  problem_pt->dof(eqn_number) += a_mult * a[eqn_number];
2608  }
2609 
2610  problem_pt->actions_after_change_in_bifurcation_parameter();
2611 
2612  // Now get the new jacobian
2613  handler_pt->get_jacobian(elem_pt, res_elemental, jac_a);
2614 
2615  // Reset the dofs
2616  for (unsigned n = 0; n < n_var; n++)
2617  {
2618  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2619  problem_pt->dof(eqn_number) = dof_bac[n];
2620  }
2621 
2622  problem_pt->actions_after_change_in_bifurcation_parameter();
2623 
2624  // OK, now work out the products
2625  for (unsigned n = 0; n < (n_var - 1); n++)
2626  {
2627  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2628  double prod_a = 0.0;
2629  for (unsigned m = 0; m < (n_var - 1); m++)
2630  {
2631  unsigned unknown = handler_pt->eqn_number(elem_pt, m);
2632  prod_a += (jac_a(n, m) - jac(n, m)) * handler_pt->Y[unknown];
2633  }
2634  Jprod_a[eqn_number] += prod_a / a_mult;
2635  }
2636  }
2637 
2638  Jprod_a[n_dof - 1] = 0.0;
2639 
2640  // OK, now we can formulate the next vectors
2641  for (unsigned n = 0; n < n_dof - 1; n++)
2642  {
2643  b[n] = rhs[n_dof + n] - Jprod_a[n];
2644  }
2645  b[n_dof - 1] = rhs[2 * n_dof - 1];
2646 
2647  DoubleVector f(this->distribution_pt(), 0.0);
2648 
2650 
2651  // Calculate the final entry in the vector d
2652  const double d_final = -f[n_dof - 1] / (*E_pt)[n_dof - 1];
2653  // Assemble the final corrections
2654  for (unsigned n = 0; n < n_dof - 1; n++)
2655  {
2656  result[n] = a[n] - (*Alpha_pt)[n] * d_final;
2657  result[n_dof + n] = f[n] + (*E_pt)[n] * d_final;
2658  }
2659 
2660  result[n_dof - 1] = a[n_dof - 1] - (*Alpha_pt)[n_dof - 1] * d_final;
2661  result[2 * n_dof - 1] = d_final;
2662 
2664 
2665  // Switch things to our block solver
2666  handler_pt->solve_full_system();
2667  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
Definition: linear_algebra_distribution.h:457
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
Definition: linear_algebra_distribution.h:507
virtual void enable_resolve()
Definition: linear_solver.h:135
virtual void resolve(const DoubleVector &rhs, DoubleVector &result)
Definition: linear_solver.h:225
virtual void disable_resolve()
Definition: linear_solver.h:144
unsigned long ndof() const
Return the number of dofs.
Definition: problem.h:1674
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
const Scalar * a
Definition: level2_cplx_impl.h:32
int * m
Definition: level2_cplx_impl.h:294
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
double FD_step
FD step.
Definition: black_box_newton_solver.cc:54
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References a, oomph::Problem::actions_after_change_in_bifurcation_parameter(), Alpha_pt, oomph::Problem::assembly_handler_pt(), b, oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), oomph::Problem::communicator_pt(), oomph::LinearSolver::disable_resolve(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::dof(), e(), oomph::Mesh::element_pt(), oomph::LinearSolver::enable_resolve(), oomph::PitchForkHandler::eqn_number(), f(), boost::multiprecision::fabs(), oomph::BlackBoxFDNewtonSolver::FD_step, oomph::PitchForkHandler::get_jacobian(), Linear_solver_pt, m, oomph::Problem::mesh_pt(), n, oomph::Problem::ndof(), oomph::PitchForkHandler::ndof(), oomph::Mesh::nelement(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Problem_pt, oomph::LinearSolver::resolve(), oomph::PitchForkHandler::solve_augmented_block_system(), oomph::PitchForkHandler::solve_full_system(), and oomph::PitchForkHandler::Y.

◆ solve() [1/3]

void oomph::AugmentedBlockPitchForkLinearSolver::solve ( DoubleMatrixBase *const &  matrix_pt,
const DoubleVector rhs,
DoubleVector result 
)
inlinevirtual

The linear-algebra-type solver does not make sense. The interface is deliberately broken

Reimplemented from oomph::LinearSolver.

719  {
720  throw OomphLibError(
721  "Linear-algebra interface does not make sense for this linear solver\n",
724  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ solve() [2/3]

void oomph::AugmentedBlockPitchForkLinearSolver::solve ( DoubleMatrixBase *const &  matrix_pt,
const Vector< double > &  rhs,
Vector< double > &  result 
)
inlinevirtual

The linear-algebra-type solver does not make sense. The interface is deliberately broken

Reimplemented from oomph::LinearSolver.

731  {
732  throw OomphLibError(
733  "Linear-algebra interface does not make sense for this linear solver\n",
736  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ solve() [3/3]

void oomph::AugmentedBlockPitchForkLinearSolver::solve ( Problem *const &  problem_pt,
DoubleVector result 
)
virtual

The solve function uses the block factorisation.

Use a block factorisation to solve the augmented system associated with a PitchFork bifurcation.

Implements oomph::LinearSolver.

2277  {
2278  std::cout << "Augmented pitchfork solve" << std::endl;
2279  // if the result is setup then it should not be distributed
2280 #ifdef PARANOID
2281  if (result.built())
2282  {
2283  if (result.distributed())
2284  {
2285  throw OomphLibError("The result vector must not be distributed",
2288  }
2289  }
2290 #endif
2291 
2292 
2293  // Locally cache the pointer to the handler.
2294  PitchForkHandler* handler_pt =
2295  static_cast<PitchForkHandler*>(problem_pt->assembly_handler_pt());
2296 
2297  // Switch the handler to "block solver" mode
2298  handler_pt->solve_augmented_block_system();
2299 
2300  // We need to find out the number of dofs in the problem
2301  unsigned n_dof = problem_pt->ndof();
2302 
2303  // create the linear algebra distribution for this solver
2304  // currently only global (non-distributed) distributions are allowed
2305  LinearAlgebraDistribution dist(problem_pt->communicator_pt(), n_dof, false);
2306  this->build_distribution(dist);
2307 
2308  // if the result vector is not setup then rebuild with distribution = global
2309  if (!result.built())
2310  {
2311  result.build(this->distribution_pt(), 0.0);
2312  }
2313 
2314  // Setup storage for temporary vectors
2315  DoubleVector a(this->distribution_pt(), 0.0),
2316  b(this->distribution_pt(), 0.0);
2317 
2318  // Allocate storage for Alpha which can be used in the resolve
2319  if (Alpha_pt != 0)
2320  {
2321  delete Alpha_pt;
2322  }
2323  Alpha_pt = new DoubleVector(this->distribution_pt(), 0.0);
2324 
2325  // We are going to do resolves using the underlying linear solver
2327  // Solve the first system Aa = R
2328  Linear_solver_pt->solve(problem_pt, a);
2329 
2330  // Get the symmetry vector from the handler
2331  DoubleVector psi(this->distribution_pt(), 0.0);
2332  for (unsigned n = 0; n < (n_dof - 1); ++n)
2333  {
2334  psi[n] = handler_pt->Psi[n];
2335  }
2336  // Set the final entry to zero
2337  psi[n_dof - 1] = 0.0;
2338 
2339  // Now resolve to find alpha
2341 
2342  // We can now construct our multipliers
2343  // Prepare to scale
2344  double dof_length = 0.0, a_length = 0.0, alpha_length = 0.0;
2345  for (unsigned n = 0; n < n_dof; n++)
2346  {
2347  if (std::fabs(problem_pt->dof(n)) > dof_length)
2348  {
2349  dof_length = std::fabs(problem_pt->dof(n));
2350  }
2351  if (std::fabs(a[n]) > a_length)
2352  {
2353  a_length = std::fabs(a[n]);
2354  }
2355  if (std::fabs((*Alpha_pt)[n]) > alpha_length)
2356  {
2357  alpha_length = std::fabs((*Alpha_pt)[n]);
2358  }
2359  }
2360 
2361  double a_mult = dof_length / a_length;
2362  double alpha_mult = dof_length / alpha_length;
2363  const double FD_step = 1.0e-8;
2364  a_mult += FD_step;
2365  alpha_mult += FD_step;
2366  a_mult *= FD_step;
2367  alpha_mult *= FD_step;
2368 
2369  // Local storage for the product terms
2370  DoubleVector Jprod_a(this->distribution_pt(), 0.0),
2371  Jprod_alpha(this->distribution_pt(), 0.0);
2372 
2373  // Calculate the product of the jacobian matrices, etc
2374  unsigned long n_element = problem_pt->mesh_pt()->nelement();
2375  for (unsigned long e = 0; e < n_element; e++)
2376  {
2377  GeneralisedElement* elem_pt = problem_pt->mesh_pt()->element_pt(e);
2378  // Loop over the ndofs in each element
2379  unsigned n_var = handler_pt->ndof(elem_pt);
2380  // Get the jacobian matrices
2381  DenseMatrix<double> jac(n_var), jac_a(n_var), jac_alpha(n_var);
2382  // the elemental residual
2383  Vector<double> res_elemental(n_var);
2384  // Get unperturbed jacobian
2385  handler_pt->get_jacobian(elem_pt, res_elemental, jac);
2386 
2387  // Backup the dofs
2388  Vector<double> dof_bac(n_var);
2389  // Perturb the dofs
2390  for (unsigned n = 0; n < n_var; n++)
2391  {
2392  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2393  dof_bac[n] = problem_pt->dof(eqn_number);
2394  // Pertub by vector a
2395  problem_pt->dof(eqn_number) += a_mult * a[eqn_number];
2396  }
2397 
2398  problem_pt->actions_after_change_in_bifurcation_parameter();
2399 
2400  // Now get the new jacobian
2401  handler_pt->get_jacobian(elem_pt, res_elemental, jac_a);
2402 
2403  // Perturb the dofs
2404  for (unsigned n = 0; n < n_var; n++)
2405  {
2406  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2407  problem_pt->dof(eqn_number) = dof_bac[n];
2408  // Pertub by vector a
2409  problem_pt->dof(eqn_number) += alpha_mult * (*Alpha_pt)[eqn_number];
2410  }
2411 
2412  problem_pt->actions_after_change_in_bifurcation_parameter();
2413 
2414  // Now get the new jacobian
2415  handler_pt->get_jacobian(elem_pt, res_elemental, jac_alpha);
2416 
2417  // Reset the dofs
2418  for (unsigned n = 0; n < n_var; n++)
2419  {
2420  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2421  problem_pt->dof(eqn_number) = dof_bac[n];
2422  }
2423 
2424  problem_pt->actions_after_change_in_bifurcation_parameter();
2425 
2426  // OK, now work out the products
2427  for (unsigned n = 0; n < (n_var - 1); n++)
2428  {
2429  unsigned eqn_number = handler_pt->eqn_number(elem_pt, n);
2430  double prod_a = 0.0, prod_alpha = 0.0;
2431  for (unsigned m = 0; m < (n_var - 1); m++)
2432  {
2433  unsigned unknown = handler_pt->eqn_number(elem_pt, m);
2434  prod_a += (jac_a(n, m) - jac(n, m)) * handler_pt->Y[unknown];
2435  prod_alpha += (jac_alpha(n, m) - jac(n, m)) * handler_pt->Y[unknown];
2436  }
2437  Jprod_a[eqn_number] += prod_a / a_mult;
2438  Jprod_alpha[eqn_number] += prod_alpha / alpha_mult;
2439  }
2440  }
2441 
2442  Jprod_alpha[n_dof - 1] = 0.0;
2443  Jprod_a[n_dof - 1] = 0.0;
2444 
2445  // OK, now we can formulate the next vectors
2446  // The assumption here is that the result has been set to the
2447  // residuals.
2448  for (unsigned n = 0; n < n_dof - 1; n++)
2449  {
2450  b[n] = result[n_dof + n] - Jprod_a[n];
2451  }
2452  b[n_dof - 1] = result[2 * n_dof - 1];
2453 
2454 
2455  // Allocate storage for E which can be used in the resolve
2456  if (E_pt != 0)
2457  {
2458  delete E_pt;
2459  }
2460  E_pt = new DoubleVector(this->distribution_pt(), 0.0);
2461 
2462  DoubleVector f(this->distribution_pt(), 0.0);
2463 
2465  Linear_solver_pt->resolve(Jprod_alpha, *E_pt);
2466 
2467  // Calculate the final entry in the vector e
2468  const double e_final = (*E_pt)[n_dof - 1];
2469  // Calculate the final entry in the vector d
2470  const double d_final = -f[n_dof - 1] / e_final;
2471  // Assemble the final corrections
2472  for (unsigned n = 0; n < n_dof - 1; n++)
2473  {
2474  result[n] = a[n] - (*Alpha_pt)[n] * d_final;
2475  result[n_dof + n] = f[n] + (*E_pt)[n] * d_final;
2476  }
2477 
2478  result[n_dof - 1] = a[n_dof - 1] - (*Alpha_pt)[n_dof - 1] * d_final;
2479  result[2 * n_dof - 1] = d_final;
2480 
2481  // The sign of the jacobian is the sign of the final entry in e
2482  problem_pt->sign_of_jacobian() =
2483  static_cast<int>(std::fabs(e_final) / e_final);
2484 
2485 
2486  // Switch things to our block solver
2487  handler_pt->solve_full_system();
2488 
2489  // If we are not storing things, clear the results
2490  if (!Enable_resolve)
2491  {
2492  // We no longer need to store the matrix
2494  delete Alpha_pt;
2495  Alpha_pt = 0;
2496  delete E_pt;
2497  E_pt = 0;
2498  }
2499  // Otherwise also store the pointer to the problem
2500  else
2501  {
2502  Problem_pt = problem_pt;
2503  }
2504  }
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
bool Enable_resolve
Definition: linear_solver.h:73

References a, oomph::Problem::actions_after_change_in_bifurcation_parameter(), Alpha_pt, oomph::Problem::assembly_handler_pt(), b, oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), oomph::Problem::communicator_pt(), oomph::LinearSolver::disable_resolve(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::dof(), e(), E_pt, oomph::Mesh::element_pt(), oomph::LinearSolver::Enable_resolve, oomph::LinearSolver::enable_resolve(), oomph::PitchForkHandler::eqn_number(), f(), boost::multiprecision::fabs(), oomph::BlackBoxFDNewtonSolver::FD_step, oomph::PitchForkHandler::get_jacobian(), Linear_solver_pt, m, oomph::Problem::mesh_pt(), n, oomph::Problem::ndof(), oomph::PitchForkHandler::ndof(), oomph::Mesh::nelement(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Problem_pt, oomph::PitchForkHandler::Psi, oomph::LinearSolver::resolve(), oomph::Problem::sign_of_jacobian(), oomph::LinearSolver::solve(), oomph::PitchForkHandler::solve_augmented_block_system(), oomph::PitchForkHandler::solve_full_system(), and oomph::PitchForkHandler::Y.

Member Data Documentation

◆ Alpha_pt

DoubleVector* oomph::AugmentedBlockPitchForkLinearSolver::Alpha_pt
private

Pointer to the storage for the vector alpha.

Referenced by resolve(), solve(), and ~AugmentedBlockPitchForkLinearSolver().

◆ E_pt

DoubleVector* oomph::AugmentedBlockPitchForkLinearSolver::E_pt
private

Pointer to the storage for the vector e.

Referenced by solve(), and ~AugmentedBlockPitchForkLinearSolver().

◆ Linear_solver_pt

LinearSolver* oomph::AugmentedBlockPitchForkLinearSolver::Linear_solver_pt
private

Pointer to the original linear solver.

Referenced by linear_solver_pt(), resolve(), and solve().

◆ Problem_pt

Problem* oomph::AugmentedBlockPitchForkLinearSolver::Problem_pt
private

Pointer to the problem, used in the resolve.

Referenced by resolve(), and solve().


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