34 #ifndef OOMPH_ASSEMBLY_HANDLER_CLASS_HEADER 35 #define OOMPH_ASSEMBLY_HANDLER_CLASS_HEADER 39 #include <oomph-lib-config.h> 50 class GeneralisedElement;
93 const unsigned &ieqn_local);
114 double*
const ¶meter_pt,
120 double*
const ¶meter_pt,
150 Vector<std::pair<unsigned,unsigned> >
151 const &history_index,
159 &inner_product_vector);
194 const unsigned &ieqn_local);
242 const unsigned &ieqn_local);
283 Assembly_handler_pt(assembly_handler_pt) {}
288 {
return Assembly_handler_pt->
ndof(elem_pt);}
293 const unsigned &ieqn_local)
294 {
return Assembly_handler_pt->
eqn_number(elem_pt,ieqn_local);}
309 {Assembly_handler_pt->
get_jacobian(elem_pt,residuals,jacobian);}
347 double*
const ¶meter_pt) :
348 Parameter_pt(parameter_pt), Assembly_handler_pt(assembly_handler_pt)
354 {
return Assembly_handler_pt->
ndof(elem_pt);}
359 const unsigned &ieqn_local)
360 {
return Assembly_handler_pt->
eqn_number(elem_pt,ieqn_local);}
377 residuals,jacobian);}
406 : Linear_solver_pt(linear_solver_pt), Problem_pt(0), Alpha_pt(0), E_pt(0) {}
421 "Linear-algebra interface does not make sense for this linear solver\n",
422 OOMPH_CURRENT_FUNCTION,
423 OOMPH_EXCEPTION_LOCATION);
433 "Linear-algebra interface does not make sense for this linear solver\n",
434 OOMPH_CURRENT_FUNCTION,
435 OOMPH_EXCEPTION_LOCATION);
505 double*
const ¶meter_pt);
510 double*
const ¶meter_pt,
516 double*
const ¶meter_pt,
530 const unsigned &ieqn_local);
545 double*
const ¶meter_pt,
551 double*
const ¶meter_pt,
568 {
return Parameter_pt;}
575 void solve_augmented_block_system();
578 void solve_block_system();
581 void solve_full_system();
616 : Linear_solver_pt(linear_solver_pt), Problem_pt(0),
617 B_pt(0), C_pt(0), D_pt(0), dJy_dparam_pt(0) {}
632 "Linear-algebra interface does not make sense for this linear solver\n",
633 OOMPH_CURRENT_FUNCTION,
634 OOMPH_EXCEPTION_LOCATION);
644 "Linear-algebra interface does not make sense for this linear solver\n",
645 OOMPH_CURRENT_FUNCTION,
646 OOMPH_EXCEPTION_LOCATION);
683 : Linear_solver_pt(linear_solver_pt), Problem_pt(0),
684 Alpha_pt(0), E_pt(0) {}
699 "Linear-algebra interface does not make sense for this linear solver\n",
700 OOMPH_CURRENT_FUNCTION,
701 OOMPH_EXCEPTION_LOCATION);
711 "Linear-algebra interface does not make sense for this linear solver\n",
712 OOMPH_CURRENT_FUNCTION,
713 OOMPH_EXCEPTION_LOCATION);
825 return Global_eqn_number[
i];
840 double*
const ¶meter_pt,
854 const unsigned &ieqn_local);
869 double*
const ¶meter_pt,
875 double*
const ¶meter_pt,
894 {
return Parameter_pt;}
908 void solve_augmented_block_system();
911 void solve_block_system();
914 void solve_full_system();
943 : Linear_solver_pt(linear_solver_pt), Problem_pt(0),
944 A_pt(0), E_pt(0), G_pt(0) {}
950 void solve_for_two_rhs(
Problem*
const &problem_pt,
965 "Linear-algebra interface does not make sense for this linear solver\n",
966 OOMPH_CURRENT_FUNCTION,
967 OOMPH_EXCEPTION_LOCATION);
977 "Linear-algebra interface does not make sense for this linear solver\n",
978 OOMPH_CURRENT_FUNCTION,
979 OOMPH_EXCEPTION_LOCATION);
1070 const unsigned &ieqn_local);
1085 double*
const ¶meter_pt,
1091 double*
const ¶meter_pt,
1109 {
return Parameter_pt;}
1116 const double &
omega()
const {
return Omega;}
1119 void solve_standard_system();
1122 void solve_complex_system();
1125 void solve_full_system();
A Generalised Element class.
DoubleVectorWithHaloEntries Count
A vector that is used to determine how many elements contribute to a particular equation. It is used to ensure that the global system is correctly formulated. This should really be an integer, but its double so that the distribution can be used.
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. Overloaded to return ...
double Sigma
A slack variable used to specify the amount of antisymmetry in the solution.
AssemblyHandler * Assembly_handler_pt
Pointer to the underlying (original) assembly handler.
DoubleVector * E_pt
Pointer to the storage for the vector e (0 to n-1)
DoubleVector * A_pt
Pointer to the storage for the vector a.
AssemblyHandler * Assembly_handler_pt
The original assembly handler.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
Vector< int > Count
A vector that is used to determine how many elements contribute to a particular equation. It is used to ensure that the global system is correctly formulated.
Problem * Problem_pt
Pointer to the problem.
const double & omega() const
Return the frequency of the bifurcation.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
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...
double * bifurcation_parameter_pt() const
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
BlockPitchForkLinearSolver(LinearSolver *const linear_solver_pt)
Constructor, inherits the original linear solver.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Return the contribution to the residuals of the element elem_pt by using the derivatives.
Vector< int > Count
A vector that is used to determine how many elements contribute to a particular equation. It is used to ensure that the global system is correctly formulated.
A class that is used to assemble the residuals in parallel by overloading the get_all_vectors_and_mat...
Problem * Problem_pt
Pointer to the problem, used in the resolve.
Vector< double > Phi
A constant vector used to ensure that the null vector is not trivial.
virtual ~AssemblyHandler()
Empty virtual destructor.
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 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...
DoubleVector * dJy_dparam_pt
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
The linear-algebra-type solver does not make sense.
double * Parameter_pt
Pointer to the parameter.
virtual void synchronise()
Function that is used to perform any synchronisation required during the solution.
DoubleVector * G_pt
Pointer to the storage for the vector g (0 to n-1)
DoubleVector * E_pt
Pointer to the storage for the vector e.
Problem * Problem_pt
Pointer to the problem, used in the resolve.
Vector< double > C
A constant vector used to ensure that the null vector is not trivial.
LinearAlgebraDistribution * Augmented_dof_distribution_pt
The augmented distribution.
~EigenProblemHandler()
Empty virtual destructor.
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.
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities. The full augmented system (0), the non-augmented jacobian system (1), a system in which the jacobian is augmented by 1 row and column to ensure that it is non-singular (2). See the enum above.
double * bifurcation_parameter_pt() const
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
double * Parameter_pt
The value of the parameter.
void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Use underlying AssemblyHandler to return the contribution to the residuals of the element elem_pt...
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
ParallelResidualsHandler(AssemblyHandler *const &assembly_handler_pt)
Constructor, set the original assembly handler.
DoubleVector * Alpha_pt
Pointer to the storage for the vector alpha.
AugmentedBlockPitchForkLinearSolver(LinearSolver *const linear_solver_pt)
Constructor, inherits the original linear solver.
LinearAlgebraDistribution * Dof_distribution_pt
Store the original dof distribution.
double * bifurcation_parameter_pt() const
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
Vector< double > Y
Storage for the null vector.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
DoubleVectorWithHaloEntries C
A constant vector used to ensure that the null vector is not trivial.
unsigned ndof(GeneralisedElement *const &elem_pt)
Use underlying assembly handler to return the number of degrees of freedom in the element elem_pt...
double Sigma_real
Storage for the real shift.
DoubleVector * B_pt
Pointer to the storage for the vector b.
virtual void get_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tra...
DoubleVector * C_pt
Pointer to the storage for the vector c.
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
ParameterDerivativeHandler(AssemblyHandler *const &assembly_handler_pt, double *const ¶meter_pt)
Store the original assembly handler and parameter.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
DoubleVectorWithHaloEntries Y
Storage for the null vector.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
bool Distributed
Boolean to indicate whether the problem is distributed.
virtual unsigned ndof(GeneralisedElement *const &elem_pt)
Return the number of degrees of freedom in the element elem_pt.
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
int bifurcation_type() const
Indicate that we are tracking a fold bifurcation by returning 1.
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.Pass through to the orig...
virtual double * bifurcation_parameter_pt() const
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
~ParallelResidualsHandler()
Empty virtual destructor.
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...
LinearSolver * linear_solver_pt() const
Access function to the original linear solver.
double * Parameter_pt
Storage for the pointer to the parameter.
~ExplicitTimeStepHandler()
Empty virtual destructor.
DoubleVector * E_pt
Pointer to the storage for the vector e.
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.
unsigned long eqn_number(GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
Use underlying AssemblyHandler to return the global equation number of the local unknown ieqn_local i...
virtual void dof_pt_vector(GeneralisedElement *const &elem_pt, Vector< double *> &dof_pt)
Return vector of pointers to dofs in the element elem_pt.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
DoubleVector * D_pt
Pointer to the storage for the vector d.
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities. The full augmented system (0), the non-augmented jacobian system (1), a system in which the jacobian is augmented by 1 row and column to ensure that it is non-singular (2). See the enum above.
DoubleVector * Alpha_pt
Pointer to the storage for the vector alpha.
AssemblyHandler()
Empty constructor.
AugmentedBlockFoldLinearSolver(LinearSolver *const linear_solver_pt)
Constructor, inherits the original linear solver.
A class that is used to define the functions used to assemble the elemental contributions to the mass...
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 int bifurcation_type() const
Return an unsigned integer to indicate whether the handler is a bifurcation tracking handler...
int bifurcation_type() const
Indicate that we are tracking a pitchfork bifurcation by returning 2.
A class that is used to define the functions used to assemble the elemental contributions to the resi...
unsigned Solve_which_system
Integer flag to indicate which system should be assembled. There are three possibilities. The full augmented system (0), the non-augmented jacobian system (1), and complex system (2), where the matrix is a combination of the jacobian and mass matrices.
virtual void get_residuals(GeneralisedElement *const &elem_pt, Vector< double > &residuals)
Return the contribution to the residuals of the element elem_pt.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
Problem * Problem_pt
Pointer to the problem, used in the resolve.
AssemblyHandler * Assembly_handler_pt
The original assembly handler.
A class that is used to define the functions used when assembling the derivatives of the residuals wi...
Problem * Problem_pt
Pointer to the problem.
unsigned ndof(GeneralisedElement *const &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.
Problem * Problem_pt
Pointer to the problem.
double * Parameter_pt
Storage for the pointer to the parameter.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
DoubleVectorWithHaloEntries Psi
A constant vector that is specifies the symmetry being broken.
LinearSolver * Linear_solver_pt
Pointer to the original linear solver.
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.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result)
The linear-algebra-type solver does not make sense.
Vector< unsigned > Global_eqn_number
A vector that is used to map the global equations to their actual location in a distributed problem...
double Omega
The critical frequency of the bifurcation.
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
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< double > Phi
The real part of the null vector.
A class that is used to define the functions used to assemble and invert the mass matrix when taking ...
EigenProblemHandler(const double &sigma_real)
Constructor, sets the value of the real shift.
ExplicitTimeStepHandler()
Empty Constructor.
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 This function calls only t...
LinearSolver * linear_solver_pt() const
Access function to the original linear solver.
Abstract base class for matrices of doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors.
LinearSolver * linear_solver_pt() const
Access function to the original linear solver.
unsigned Ndof
Store the number of degrees of freedom in the non-augmented problem.
Vector< double > Psi
The imaginary part of the null vector.
BlockHopfLinearSolver(LinearSolver *const linear_solver_pt)
Constructor, inherits the original linear solver.
LinearSolver * linear_solver_pt() const
Access function to the original linear solver.
int bifurcation_type() const
Indicate that we are tracking a Hopf bifurcation by returning 3.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
The linear-algebra-type solver does not make sense. The interface is deliberately broken...
void get_jacobian(GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use underlying AssemblyHandler to Calculate the elemental Jacobian matrix "d equation / d variable" ...
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.