171 error_stream <<
"There is no bifurcation parameter associated with the "
172 "current assembly handler.\n"
173 <<
"Eigenfunction are only calculated by the Fold, PitchFork "
191 error_stream <<
"There is no eigenfunction associated with the current "
192 "assembly handler.\n"
193 <<
"Eigenfunction are only calculated by the Fold, PitchFork "
287 throw OomphLibError(
"ExplicitTimeSteps should return one matrix",
328 "An eigenproblem does not have a get_residuals function",
340 throw OomphLibError(
"An eigenproblem does not have a get_jacobian function",
359 throw OomphLibError(
"EigenProblems should return two matrices",
375 for (
unsigned i = 0;
i <
n_var;
i++)
377 for (
unsigned j = 0;
j <
n_var;
j++)
414 throw OomphLibError(
"The result vector must not be distributed",
464 for (
unsigned n = 0;
n < (
n_dof - 1); ++
n)
490 for (
unsigned n = 0;
n <
n_var;
n++)
493 for (
unsigned m = 0;
m <
n_var;
m++)
507 for (
unsigned n = 0;
n <
n_dof;
n++)
515 for (
unsigned n = 0;
n <
n_dof;
n++)
533 const double FD_step = 1.0e-8;
544 for (
unsigned long e = 0;
e < n_element;
e++)
559 for (
unsigned n = 0;
n <
n_var;
n++)
564 problem_pt->
dof(eqn_number) +=
a_mult * a[eqn_number];
573 for (
unsigned n = 0;
n <
n_var;
n++)
587 for (
unsigned n = 0;
n <
n_var;
n++)
598 for (
unsigned n = 0;
n < (
n_var - 1);
n++)
602 for (
unsigned m = 0;
m < (
n_var - 1);
m++)
619 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
641 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
683 throw OomphLibError(
"The required vectors have not been stored",
706 throw OomphLibError(
"The result vector must not be distributed",
723 result.build(
rhs.distribution_pt(), 0.0);
731 for (
unsigned n = 0;
n < (
n_dof - 1);
n++)
750 for (
unsigned n = 0;
n <
n_dof;
n++)
763 const double FD_step = 1.0e-8;
785 for (
unsigned n = 0;
n <
n_var;
n++)
790 problem_pt->
dof(eqn_number) +=
a_mult * a[eqn_number];
799 for (
unsigned n = 0;
n <
n_var;
n++)
808 for (
unsigned n = 0;
n < (
n_var - 1);
n++)
812 for (
unsigned m = 0;
m < (
n_var - 1);
m++)
824 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
839 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
866 : Solve_which_system(Full_augmented), Parameter_pt(
parameter_pt)
890 for (
unsigned n = 0;
n <
n_var;
n++)
915 linear_solver_pt->
solve(problem_pt, x);
944 for (
unsigned n = 0;
n <
Ndof;
n++)
952 for (
unsigned n = 0;
n <
Ndof;
n++)
954 problem_pt->
Dof_pt.push_back(&
Y[
n]);
973 : Solve_which_system(Full_augmented), Parameter_pt(
parameter_pt)
997 for (
unsigned n = 0;
n <
n_var;
n++)
1010 for (
unsigned n = 0;
n <
Ndof;
n++)
1018 for (
unsigned n = 0;
n <
Ndof;
n++)
1020 problem_pt->
Dof_pt.push_back(&
Y[
n]);
1040 : Solve_which_system(Full_augmented), Parameter_pt(
parameter_pt)
1064 for (
unsigned n = 0;
n <
n_var;
n++)
1077 for (
unsigned n = 0;
n <
Ndof;
n++)
1085 for (
unsigned n = 0;
n <
Ndof;
n++)
1087 problem_pt->
Dof_pt.push_back(&
Y[
n]);
1126 <<
"The Solve_which_system flag can only take values 0, 1, 2"
1232 <<
"The Solve_which_system flag can only take values 0, 1, 2"
1275 const double FD_step = 1.0e-8;
1334 const double FD_step = 1.0e-8;
1430 <<
"The Solve_which_system flag can only take values 0, 1, 2"
1499 <<
"The Solve_which_system flag can only take values 0, 1, 2"
1519 <<
"This function has not been implemented because it is not required\n";
1522 <<
"If you find that you need it, you will have to implement it!\n\n";
1541 <<
"This function has not been implemented because it is not required\n";
1544 <<
"If you find that you need it, you will have to implement it!\n\n";
1563 for (
unsigned n = 0;
n <
Ndof;
n++)
1662 for (
unsigned n = 0;
n <
Ndof;
n++)
1708 std::cout <<
"Block pitchfork solve" << std::endl;
1799 unsigned offset = 1;
1863 const double C_ = (*C_pt)[
n];
2010 std::cout <<
"Block pitchfork resolve" << std::endl;
2014 throw OomphLibError(
"The required vectors have not been stored",
2156 unsigned offset = 1;
2176 x2 * (*dJy_dparam_pt)[
n];
2278 std::cout <<
"Augmented pitchfork solve" << std::endl;
2283 if (
result.distributed())
2285 throw OomphLibError(
"The result vector must not be distributed",
2332 for (
unsigned n = 0;
n < (
n_dof - 1); ++
n)
2345 for (
unsigned n = 0;
n <
n_dof;
n++)
2363 const double FD_step = 1.0e-8;
2390 for (
unsigned n = 0;
n <
n_var;
n++)
2395 problem_pt->
dof(eqn_number) +=
a_mult * a[eqn_number];
2404 for (
unsigned n = 0;
n <
n_var;
n++)
2409 problem_pt->
dof(eqn_number) +=
alpha_mult * (*Alpha_pt)[eqn_number];
2418 for (
unsigned n = 0;
n <
n_var;
n++)
2427 for (
unsigned n = 0;
n < (
n_var - 1);
n++)
2431 for (
unsigned m = 0;
m < (
n_var - 1);
m++)
2448 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
2472 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
2513 std::cout <<
"Augmented pitchfork resolve" << std::endl;
2517 throw OomphLibError(
"The required vectors have not been stored",
2550 for (
unsigned n = 0;
n <
n_dof;
n++)
2567 for (
unsigned n = 0;
n <
n_dof;
n++)
2580 const double FD_step = 1.0e-8;
2602 for (
unsigned n = 0;
n <
n_var;
n++)
2607 problem_pt->
dof(eqn_number) +=
a_mult * a[eqn_number];
2616 for (
unsigned n = 0;
n <
n_var;
n++)
2625 for (
unsigned n = 0;
n < (
n_var - 1);
n++)
2629 for (
unsigned m = 0;
m < (
n_var - 1);
m++)
2641 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
2654 for (
unsigned n = 0;
n <
n_dof - 1;
n++)
2682 : Solve_which_system(Full_augmented), Sigma(0.0), Parameter_pt(
parameter_pt)
2733 for (
unsigned n = 0;
n <
n_var;
n++)
2789 "The symmetry vector must have the same distribution as the dofs\n",
2830 for (
int d = 0; d <
n_proc; d++)
2966 <<
"The Solve_which_system flag can only take values 0, 1, 2"
2996 "Block Augmented solver not implemented for distributed case\n",
3016 else if (ieqn_local < (2 *
raw_ndof + 1))
3126 <<
"The Solve_which_system flag can only take values 0, 1, 2"
3175 const double FD_step = 1.0e-8;
3243 const double FD_step = 1.0e-8;
3303 <<
"The Solve_which_system flag can only take values 0, 1, 2"
3381 <<
"The Solve_which_system flag can only take values 0, 1, 2"
3402 <<
"This function has not been implemented because it is not required\n";
3405 <<
"If you find that you need it, you will have to implement it!\n\n";
3628 if (
result.distributed())
3630 throw OomphLibError(
"The result vector must not be distributed",
3653 const double FD_step = 1.0e-8;
3668 for (
unsigned n = 0;
n <
n_dof;
n++)
3709 for (
unsigned n = 0;
n <
n_dof;
n++)
3742 for (
unsigned n = 0;
n <
n_dof;
n++)
3789 for (
unsigned n = 0;
n <
n_var;
n++)
3794 problem_pt->
dof(eqn_number) +=
a_mult * (*A_pt)[eqn_number];
3801 for (
unsigned n = 0;
n <
n_var;
n++)
3806 problem_pt->
dof(eqn_number) +=
y1_mult *
y1[eqn_number];
3813 for (
unsigned n = 0;
n <
n_var;
n++)
3820 for (
unsigned n = 0;
n <
n_var;
n++)
3825 for (
unsigned m = 0;
m <
n_var;
m++)
3851 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
3861 for (
unsigned i = 0;
i < 2 * n_dof;
i++)
3870 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
3883 for (
unsigned i = 0;
i < 2 * n_dof;
i++)
3894 for (
unsigned n = 0;
n <
n_dof;
n++)
3922 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
3929 for (
unsigned n = 0;
n <
n_dof;
n++)
3937 sign_of_jacobian *
static_cast<int>(std::fabs(
denom) /
denom);
3975 if (
result.distributed())
3977 throw OomphLibError(
"The result vector must not be distributed",
3986 throw OomphLibError(
"The result2 vector must not be distributed",
4010 if (!result2.
built())
4019 const double FD_step = 1.0e-8;
4034 for (
unsigned n = 0;
n <
n_dof;
n++)
4076 for (
unsigned n = 0;
n <
n_dof;
n++)
4085 for (
unsigned n = 0;
n <
n_dof;
n++)
4119 for (
unsigned n = 0;
n <
n_dof;
n++)
4177 for (
unsigned n = 0;
n <
n_var;
n++)
4182 problem_pt->
dof(eqn_number) +=
a_mult * (*A_pt)[eqn_number];
4189 for (
unsigned n = 0;
n <
n_var;
n++)
4194 problem_pt->
dof(eqn_number) +=
y1_mult *
y1[eqn_number];
4201 for (
unsigned n = 0;
n <
n_var;
n++)
4213 for (
unsigned n = 0;
n <
n_var;
n++)
4220 for (
unsigned n = 0;
n <
n_var;
n++)
4225 for (
unsigned m = 0;
m <
n_var;
m++)
4258 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
4268 for (
unsigned i = 0;
i < 2 * n_dof;
i++)
4275 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
4288 for (
unsigned i = 0;
i < 2 * n_dof;
i++)
4295 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
4301 for (
unsigned i = 0;
i < 2 * n_dof;
i++)
4315 for (
unsigned n = 0;
n <
n_dof;
n++)
4356 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
4363 for (
unsigned n = 0;
n <
n_dof;
n++)
4373 for (
unsigned n = 0;
n < 2 *
n_dof;
n++)
4380 for (
unsigned n = 0;
n <
n_dof;
n++)
4389 sign_of_jacobian *
static_cast<int>(std::fabs(
denom) /
denom);
4420 throw OomphLibError(
"resolve() is not implemented for this solver",
4437 : Solve_which_system(0), Parameter_pt(
parameter_pt), Omega(0.0)
4462 for (
unsigned n = 0;
n <
n_var;
n++)
4487 linear_solver_pt->
solve(problem_pt, x);
4512 for (
unsigned n = 0;
n <
Ndof;
n++)
4521 for (
unsigned n = 0;
n <
Ndof;
n++)
4529 for (
unsigned n = 0;
n <
Ndof;
n += 2)
4545 for (
unsigned n = 0;
n <
Ndof;
n++)
4571 const double& omega,
4574 : Solve_which_system(0), Parameter_pt(
parameter_pt), Omega(omega)
4594 for (
unsigned n = 0;
n <
n_var;
n++)
4603 for (
unsigned n = 0;
n <
Ndof;
n++)
4611 for (
unsigned n = 0;
n <
Ndof;
n++)
4619 for (
unsigned n = 0;
n <
Ndof;
n++)
4684 throw OomphLibError(
"Solve_which_system can only be 0,1 or 2",
4819 const double FD_step = 1.0e-8;
4926 throw OomphLibError(
"Solve_which_system can only be 0,1 or 2",
4998 <<
"This function has not been implemented because it is not required\n";
5001 <<
"If you find that you need it, you will have to implement it!\n\n";
5020 <<
"This function has not been implemented because it is not required\n";
5023 <<
"If you find that you need it, you will have to implement it!\n\n";
5043 for (
unsigned n = 0;
n <
Ndof;
n++)
5082 for (
unsigned n = 0;
n <
Ndof;
n++)
5108 for (
unsigned n = 0;
n <
Ndof;
n++)
5112 for (
unsigned n = 0;
n <
Ndof;
n++)
A class that is used to define the functions used to assemble the elemental contributions to the resi...
virtual unsigned ndof(GeneralisedElement *const &elem_pt)
Return the number of degrees of freedom in the element elem_pt.
virtual void get_inner_product_vectors(GeneralisedElement *const &elem_pt, Vector< unsigned > const &history_index, Vector< Vector< double > > &inner_product_vector)
Compute the vectors that when taken as a dot product with other history values give the inner product...
virtual void get_hessian_vector_products(GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Calculate the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenv...
virtual void get_dresiduals_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam)
Calculate the derivative of the residuals with respect to a parameter.
virtual double * bifurcation_parameter_pt() const
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
virtual void get_inner_products(GeneralisedElement *const &elem_pt, Vector< std::pair< unsigned, unsigned > > const &history_index, Vector< double > &inner_product)
Compute the inner products of the given vector of pairs of history values over the element.
virtual void get_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tra...
virtual void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Return the contribution to the residuals of the element elem_pt.
virtual unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Return the global equation number of the local unknown ieqn_local in elem_pt.
virtual void get_all_vectors_and_matrices(GeneralisedElement *const &elem_pt, Vector< Vector< double > > &vec, Vector< DenseMatrix< double > > &matrix)
Calculate all desired vectors and matrices provided by the element elem_pt.
virtual double & local_problem_dof(Problem *const &problem_pt, const unsigned &t, const unsigned &i)
Return the t-th level of storage associated with the i-th (local) dof stored in the problem.
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.
virtual void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable" for elem_pt.
virtual void get_djacobian_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Calculate the derivative of the residuals and jacobian with respect to a parameter.
virtual void dof_pt_vector(GeneralisedElement *const &elem_pt, Vector< double * > &dof_pt)
Return vector of pointers to dofs in the element elem_pt.
A custom linear solver class that is used to solve a block-factorised version of the Fold bifurcation...
void solve(Problem *const &problem_pt, DoubleVector &result)
The solve function uses the block factorisation.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
DoubleVector * E_pt
Pointer to the storage for the vector e.
void resolve(const DoubleVector &rhs, DoubleVector &result)
The resolve function also uses the block factorisation.
~AugmentedBlockFoldLinearSolver()
Destructor: clean up the allocated memory.
DoubleVector * Alpha_pt
Pointer to the storage for the vector alpha.
A custom linear solver class that is used to solve a block-factorised version of the PitchFork bifurc...
void solve(Problem *const &problem_pt, DoubleVector &result)
The solve function uses the block factorisation.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
void resolve(const DoubleVector &rhs, DoubleVector &result)
The resolve function also uses the block factorisation.
DoubleVector * Alpha_pt
Pointer to the storage for the vector alpha.
DoubleVector * E_pt
Pointer to the storage for the vector e.
~AugmentedBlockPitchForkLinearSolver()
Destructor: clean up the allocated memory.
Problem * Problem_pt
Pointer to the problem, used in the resolve.
A custom linear solver class that is used to solve a block-factorised version of the Hopf bifurcation...
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
void resolve(const DoubleVector &rhs, DoubleVector &result)
The resolve function also uses the block factorisation.
DoubleVector * A_pt
Pointer to the storage for the vector a.
void solve(Problem *const &problem_pt, DoubleVector &result)
The solve function uses the block factorisation.
Problem * Problem_pt
Pointer to the problem, used in the resolve.
~BlockHopfLinearSolver()
Destructor: clean up the allocated memory.
void solve_for_two_rhs(Problem *const &problem_pt, DoubleVector &result, const DoubleVector &rhs2, DoubleVector &result2)
Solve for two right hand sides.
DoubleVector * E_pt
Pointer to the storage for the vector e (0 to n-1)
DoubleVector * G_pt
Pointer to the storage for the vector g (0 to n-1)
A custom linear solver class that is used to solve a block-factorised version of the PitchFork bifurc...
DoubleVector * D_pt
Pointer to the storage for the vector d.
DoubleVector * dJy_dparam_pt
Pointer to the storage for the vector of derivatives with respect to the bifurcation parameter.
~BlockPitchForkLinearSolver()
Destructor: clean up the allocated memory.
DoubleVector * B_pt
Pointer to the storage for the vector b.
Problem * Problem_pt
Pointer to the problem, used in the resolve.
void resolve(const DoubleVector &rhs, DoubleVector &result)
The resolve function also uses the block factorisation.
DoubleVector * C_pt
Pointer to the storage for the vector c.
void solve(Problem *const &problem_pt, DoubleVector &result)
The solve function uses the block factorisation.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
void build_halo_scheme(DoubleVectorHaloScheme *const &halo_scheme_pt)
Construct the halo scheme and storage for the halo data.
void synchronise()
Synchronise the halo data.
void sum_all_halo_and_haloed_values()
Sum all the data, store in the master (haloed) data and then synchronise.
double & global_value(const unsigned &i)
Direct access to global entry.
A vector in the mathematical sense, initially developed for linear algebra type applications....
void build(const DoubleVector &old_vector)
Just copys the argument DoubleVector.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Return the contribution to the residuals of the element elem_pt This is deliberately broken in our ei...
double Sigma_real
Storage for the real shift.
void get_all_vectors_and_matrices(GeneralisedElement *const &elem_pt, Vector< Vector< double > > &vec, Vector< DenseMatrix< double > > &matrix)
Calculate all desired vectors and matrices provided by the element elem_pt.
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable" for elem_pt. Again deliberately bro...
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Return the global equation number of the local unknown ieqn_local in elem_pt.
unsigned ndof(GeneralisedElement *const &elem_pt)
Return the number of degrees of freedom in the element elem_pt.
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Return the global equation number of the local unknown ieqn_local in elem_pt.
unsigned ndof(GeneralisedElement *const &elem_pt)
Return the number of degrees of freedom in the element elem_pt.
void get_all_vectors_and_matrices(GeneralisedElement *const &elem_pt, Vector< Vector< double > > &vec, Vector< DenseMatrix< double > > &matrix)
Calculate all desired vectors and matrices provided by the element elem_pt.
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable" for elem_pt. Again deliberately bro...
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Return the contribution to the residuals of the element elem_pt This is deliberately broken in our ei...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
A class that is used to assemble the augmented system that defines a fold (saddle-node) or limit poin...
Problem * Problem_pt
Pointer to the problem.
Vector< int > Count
A vector that is used to determine how many elements contribute to a particular equation....
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Get the global equation number of the local unknown.
void solve_full_system()
Solve non-block system.
void get_djacobian_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks.
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities....
void solve_augmented_block_system()
Set to solve the augmented block system.
Vector< double > Phi
A constant vector used to ensure that the null vector is not trivial.
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
void get_hessian_vector_products(GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Overload the hessian vector product function so that it breaks.
~FoldHandler()
Destructor, return the problem to its original state before the augmented system was added.
void solve_block_system()
Set to solve the block system.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Get the residuals.
Vector< double > Y
Storage for the null vector.
void get_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tra...
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
void get_dresiduals_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam)
Overload the derivatives of the residuals with respect to a parameter to apply to the augmented syste...
FoldHandler(Problem *const &problem_pt, double *const ¶meter_pt)
Constructor: initialise the fold handler, by setting initial guesses for Y, Phi and calculating count...
double * Parameter_pt
Storage for the pointer to the parameter.
unsigned ndof(GeneralisedElement *const &elem_pt)
Get the number of elemental degrees of freedom.
A Generalised Element class.
bool is_halo() const
Is this element a halo?
void dof_vector(const unsigned &t, Vector< double > &dof)
Return the vector of dof values at time level t.
virtual void get_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Calculate the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenv...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
virtual void get_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double > > &inner_product_vector)
Compute the vectors that when taken as a dot product with other history values give the inner product...
virtual void get_inner_products(Vector< std::pair< unsigned, unsigned > > const &history_index, Vector< double > &inner_product)
Return the vector of inner product of the given pairs of history values.
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
virtual void get_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Calculate the residuals and the elemental "mass" matrix, the matrix that multiplies the time derivati...
virtual void get_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Calculate the derivatives of the residuals with respect to a parameter.
void dof_pt_vector(Vector< double * > &dof_pt)
Return the vector of pointers to dof values.
virtual void get_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Calculate the derivatives of the elemental Jacobian matrix mass matrix and residuals with respect to ...
virtual void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
virtual void get_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Calculate the derivatives of the elemental Jacobian matrix and residuals with respect to a parameter.
virtual void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Calculate the residuals and jacobian and elemental "mass" matrix, the matrix that multiplies the time...
A class that is used to assemble the augmented system that defines a Hopf bifurcation....
Vector< double > Phi
The real part of the null vector.
Vector< int > Count
A vector that is used to determine how many elements contribute to a particular equation....
double Omega
The critical frequency of the bifurcation.
void get_dresiduals_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam)
Overload the derivatives of the residuals with respect to a parameter to apply to the augmented syste...
~HopfHandler()
Destructor, return the problem to its original state, before the augmented system was added.
void solve_full_system()
Solve non-block system.
void get_djacobian_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Get the residuals.
void get_hessian_vector_products(GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Overload the hessian vector product function so that it breaks.
unsigned ndof(GeneralisedElement *const &elem_pt)
Get the number of elemental degrees of freedom.
Vector< double > C
A constant vector used to ensure that the null vector is not trivial.
void get_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tra...
Vector< double > Psi
The imaginary part of the null vector.
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Get the global equation number of the local unknown.
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities....
Problem * Problem_pt
Pointer to the problem.
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
HopfHandler(Problem *const &problem_pt, double *const ¶meter_pt)
Constructor.
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
void solve_complex_system()
Set to solve the complex system.
void solve_standard_system()
Set to solve the standard system.
double * Parameter_pt
Pointer to the parameter.
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
unsigned first_row() const
access function for the first row on this processor. If not distributed then this is just zero.
void build(const OomphCommunicator *const comm_pt, const unsigned &first_row, const unsigned &nrow_local, const unsigned &nrow=0)
Sets the distribution. Takes first_row, nrow_local and nrow as arguments. If nrow is not provided or ...
unsigned nrow_local() const
access function for the num of local rows on this processor. If no MPI then Nrow is returned.
Base class for all linear solvers. This merely defines standard interfaces for linear solvers,...
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
virtual void enable_resolve()
Enable resolve (i.e. store matrix and/or LU decomposition, say) Virtual so it can be overloaded to pe...
virtual void resolve(const DoubleVector &rhs, DoubleVector &result)
Resolve the system defined by the last assembled jacobian and the rhs vector. Solution is returned in...
bool Enable_resolve
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be st...
virtual void disable_resolve()
Disable resolve (i.e. store matrix and/or LU decomposition, say) This function simply resets an inter...
bool is_resolve_enabled() const
Boolean flag indicating if resolves are enabled.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nelement() const
Return number of elements in the mesh.
An OomphLibError object which should be thrown when an run-time error is encountered....
A class that is used to assemble the augmented system that defines a pitchfork (symmetry-breaking) bi...
LinearAlgebraDistribution * Dof_distribution_pt
Store the original dof distribution.
Problem * Problem_pt
Pointer to the problem.
void synchronise()
Function that is used to perform any synchronisation required during the solution.
void solve_full_system()
Solve non-block system.
DoubleVectorWithHaloEntries Y
Storage for the null vector.
AssemblyHandler * Assembly_handler_pt
Pointer to the underlying (original) assembly handler.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Get the residuals.
double Sigma
A slack variable used to specify the amount of antisymmetry in the solution.
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities....
void get_dresiduals_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam)
Overload the derivatives of the residuals with respect to a parameter to apply to the augmented syste...
~PitchForkHandler()
Destructor, return the problem to its original state, before the augmented system was added.
void get_hessian_vector_products(GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Overload the hessian vector product function so that it breaks.
DoubleVectorWithHaloEntries C
A constant vector used to ensure that the null vector is not trivial.
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
PitchForkHandler(Problem *const &problem_pt, AssemblyHandler *const &assembly_handler_pt, double *const ¶meter_pt, const DoubleVector &symmetry_vector)
Constructor, initialise the systems.
void get_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tra...
DoubleVectorWithHaloEntries Psi
A constant vector that is specifies the symmetry being broken.
double * Parameter_pt
Storage for the pointer to the parameter.
void get_djacobian_dparameter(GeneralisedElement *const &elem_pt, double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks.
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Get the global equation number of the local unknown.
bool Distributed
Boolean to indicate whether the problem is distributed.
unsigned global_eqn_number(const unsigned &i)
Function that is used to return map the global equations using the simplistic numbering scheme into t...
Vector< unsigned > Global_eqn_number
A vector that is used to map the global equations to their actual location in a distributed problem.
void solve_augmented_block_system()
Set to solve the augmented block system.
void solve_block_system()
Set to solve the block system.
DoubleVectorWithHaloEntries Count
A vector that is used to determine how many elements contribute to a particular equation....
unsigned ndof(GeneralisedElement *const &elem_pt)
Get the number of elemental degrees of freedom.
LinearAlgebraDistribution * Augmented_dof_distribution_pt
The augmented distribution.
////////////////////////////////////////////////////////////////// //////////////////////////////////...
double * global_dof_pt(const unsigned &i)
Return a pointer to the dof, indexed by global equation number which may be haloed or stored locally....
DoubleVectorHaloScheme * Halo_scheme_pt
Pointer to the halo scheme for any global vectors that have the Dof_distribution.
void setup_dof_halo_scheme()
Function that is used to setup the halo scheme.
unsigned long ndof() const
Return the number of dofs.
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
double & dof(const unsigned &i)
i-th dof in the problem
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
the number of elements in each row of a compressed matrix in the previous matrix assembly.
virtual void actions_after_change_in_bifurcation_parameter()
Actions that are to be performed after a change in the parameter that is being varied as part of the ...
virtual void get_residuals(DoubleVector &residuals)
Return the fully-assembled residuals Vector for the problem: Virtual so it can be overloaded in for m...
double *& dof_pt(const unsigned &i)
Pointer to i-th dof in the problem.
Vector< double * > Dof_pt
Vector of pointers to dofs.
void get_hessian_vector_products(DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
Return the product of the global hessian (derivative of Jacobian matrix with respect to all variables...
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
LinearAlgebraDistribution * Dof_distribution_pt
The distribution of the DOFs in this problem. This object is created in the Problem constructor and s...
Mesh *& mesh_pt()
Return a pointer to the global mesh.
virtual void actions_before_newton_convergence_check()
Any actions that are to be performed before the residual is checked in the Newton method,...
AssemblyHandler *& assembly_handler_pt()
Return a pointer to the assembly handler object.
int & sign_of_jacobian()
Access function for the sign of the global jacobian matrix. This will be set by the linear solver,...
void get_derivative_wrt_global_parameter(double *const ¶meter_pt, DoubleVector &result)
Get the derivative of the entire residuals vector wrt a global parameter, used in continuation proble...
bool distributed() const
If we have MPI return the "problem has been distributed" flag, otherwise it can't be distributed so r...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).