oomph::LinearisedNavierStokesEigenfunctionNormalisationElement Class Reference

#include <linearised_navier_stokes_eigenvalue_elements.h>

+ Inheritance diagram for oomph::LinearisedNavierStokesEigenfunctionNormalisationElement:

Public Member Functions

 LinearisedNavierStokesEigenfunctionNormalisationElement (std::complex< double > *const &normalisation_pt)
 
 ~LinearisedNavierStokesEigenfunctionNormalisationElement ()
 Empty destructor. More...
 
Dataeigenvalue_data_pt ()
 Access to Data that contains the traded pressure. More...
 
double eigenvalue (const unsigned &i)
 Return the traded pressure value. More...
 
unsigned index_of_eigenvalue ()
 Return the index of Data object at which the traded pressure is stored. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Fill in the residuals for the volume constraint. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Fill in the residuals and jacobian for the volume constraint. More...
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
- Public Member Functions inherited from oomph::GeneralisedElement
 GeneralisedElement ()
 Constructor: Initialise all pointers and all values to zero. More...
 
virtual ~GeneralisedElement ()
 Virtual destructor to clean up any memory allocated by the object. More...
 
 GeneralisedElement (const GeneralisedElement &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralisedElement &)=delete
 Broken assignment operator. More...
 
Data *& internal_data_pt (const unsigned &i)
 Return a pointer to i-th internal data object. More...
 
Data *const & internal_data_pt (const unsigned &i) const
 Return a pointer to i-th internal data object (const version) More...
 
Data *& external_data_pt (const unsigned &i)
 Return a pointer to i-th external data object. More...
 
Data *const & external_data_pt (const unsigned &i) const
 Return a pointer to i-th external data object (const version) More...
 
unsigned long eqn_number (const unsigned &ieqn_local) const
 
int local_eqn_number (const unsigned long &ieqn_global) const
 
unsigned add_external_data (Data *const &data_pt, const bool &fd=true)
 
bool external_data_fd (const unsigned &i) const
 
void exclude_external_data_fd (const unsigned &i)
 
void include_external_data_fd (const unsigned &i)
 
void flush_external_data ()
 Flush all external data. More...
 
void flush_external_data (Data *const &data_pt)
 Flush the object addressed by data_pt from the external data array. More...
 
unsigned ninternal_data () const
 Return the number of internal data objects. More...
 
unsigned nexternal_data () const
 Return the number of external data objects. More...
 
unsigned ndof () const
 Return the number of equations/dofs in the element. More...
 
void dof_vector (const unsigned &t, Vector< double > &dof)
 Return the vector of dof values at time level t. More...
 
void dof_pt_vector (Vector< double * > &dof_pt)
 Return the vector of pointers to dof values. More...
 
void set_internal_data_time_stepper (const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void complete_setup_of_dependencies ()
 
virtual void get_residuals (Vector< double > &residuals)
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual unsigned self_test ()
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 

Private Member Functions

int eigenvalue_local_eqn (const unsigned &i)
 The local eqn number for the traded pressure. More...
 
void fill_in_generic_contribution_to_residuals_normalisation (Vector< double > &residuals)
 Fill in the residuals for the volume constraint. More...
 

Private Attributes

std::complex< double > * Normalisation_pt
 Pointer to the desired normalisation. More...
 
unsigned External_or_internal_data_index_of_eigenvalue
 Storage for the initial index of the eigenvalue. More...
 
unsigned Index_of_eigenvalue
 Storage for the offset index of the eigenvalue. More...
 

Additional Inherited Members

- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

A class that is used to implement the constraint that the eigenfunction has a particular normalisation. This element stores the two components of the eigenvalue.

Constructor & Destructor Documentation

◆ LinearisedNavierStokesEigenfunctionNormalisationElement()

oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::LinearisedNavierStokesEigenfunctionNormalisationElement ( std::complex< double > *const &  normalisation_pt)

Constructor: Pass pointer to target volume. "Pressure" value that "traded" for the volume contraint is created internally (as a Data item with a single pressure value)

75  {
76  // Store pointer to normalisation
77  Normalisation_pt = normalisation_pt;
78 
79  // Create data, add as internal data and record the index
80  // (gets deleted automatically in destructor of GeneralisedElement)
82  add_internal_data(new Data(3));
83 
84  // ...and stored the "traded pressure" value as first value
86  }
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62
unsigned Index_of_eigenvalue
Storage for the offset index of the eigenvalue.
Definition: linearised_navier_stokes_eigenvalue_elements.h:61
unsigned External_or_internal_data_index_of_eigenvalue
Storage for the initial index of the eigenvalue.
Definition: linearised_navier_stokes_eigenvalue_elements.h:58
std::complex< double > * Normalisation_pt
Pointer to the desired normalisation.
Definition: linearised_navier_stokes_eigenvalue_elements.h:55

References oomph::GeneralisedElement::add_internal_data(), External_or_internal_data_index_of_eigenvalue, Index_of_eigenvalue, and Normalisation_pt.

◆ ~LinearisedNavierStokesEigenfunctionNormalisationElement()

oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::~LinearisedNavierStokesEigenfunctionNormalisationElement ( )
inline

Empty destructor.

Constructor: Pass pointer to target volume, pointer to Data item whose value specified by index_of_traded_pressure represents the "Pressure" value that "traded" for the volume contraint. The Data is stored as external Data for this element.

91 {}

Member Function Documentation

◆ eigenvalue()

double oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue ( const unsigned i)
inline

Return the traded pressure value.

101  {
103  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
double value(const unsigned &i) const
Definition: nodes.h:293
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
Definition: linearised_navier_stokes_eigenvalue_elements.h:94

References eigenvalue_data_pt(), i, Index_of_eigenvalue, and oomph::Data::value().

Referenced by fill_in_generic_contribution_to_residuals_normalisation().

◆ eigenvalue_data_pt()

Data* oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue_data_pt ( )
inline

Access to Data that contains the traded pressure.

95  {
97  }
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622

References External_or_internal_data_index_of_eigenvalue, and oomph::GeneralisedElement::internal_data_pt().

Referenced by eigenvalue(), and oomph::LinearisedNavierStokesEquations::set_eigenfunction_normalisation_element().

◆ eigenvalue_local_eqn()

int oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue_local_eqn ( const unsigned i)
inlineprivate

The local eqn number for the traded pressure.

66  {
67  return this->internal_local_eqn(
69  }
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267

References i, Index_of_eigenvalue, and oomph::GeneralisedElement::internal_local_eqn().

Referenced by fill_in_contribution_to_jacobian(), and fill_in_generic_contribution_to_residuals_normalisation().

◆ fill_in_contribution_to_jacobian()

void oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Fill in the residuals and jacobian for the volume constraint.

Reimplemented from oomph::GeneralisedElement.

121  {
122  // One contribution to jacobian; see comment in that function
124 
125  const int local_eqn = this->eigenvalue_local_eqn(2);
126  if (local_eqn >= 0)
127  {
128  const int local_unknown = this->eigenvalue_local_eqn(0);
129  jacobian(local_eqn, local_unknown) += 1.0;
130  }
131  }
int eigenvalue_local_eqn(const unsigned &i)
The local eqn number for the traded pressure.
Definition: linearised_navier_stokes_eigenvalue_elements.h:65
void fill_in_generic_contribution_to_residuals_normalisation(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
Definition: linearised_navier_stokes_eigenvalue_elements.cc:38

References eigenvalue_local_eqn(), and fill_in_generic_contribution_to_residuals_normalisation().

◆ fill_in_contribution_to_jacobian_and_mass_matrix()

void oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Fill in the residuals, jacobian and mass matrix for the volume constraint.

Reimplemented from oomph::GeneralisedElement.

139  {
140  // No contribution to jacobian or mass matrix; see comment in that
141  // function
143  }

References fill_in_generic_contribution_to_residuals_normalisation().

◆ fill_in_contribution_to_residuals()

void oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

Fill in the residuals for the volume constraint.

Reimplemented from oomph::GeneralisedElement.

114  {
116  }

References fill_in_generic_contribution_to_residuals_normalisation().

◆ fill_in_generic_contribution_to_residuals_normalisation()

void oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_generic_contribution_to_residuals_normalisation ( Vector< double > &  residuals)
private

Fill in the residuals for the volume constraint.

40  {
41  // Note that this element can only be used with our linearised navier
42  // stokes elements
43  // Read part
44  {
45  const int local_eqn = this->eigenvalue_local_eqn(0);
46  if (local_eqn >= 0)
47  {
48  residuals[local_eqn] -= (*Normalisation_pt).real();
49  }
50  }
51  // Imaginary part
52  {
53  const int local_eqn = this->eigenvalue_local_eqn(1);
54  if (local_eqn >= 0)
55  {
56  residuals[local_eqn] -= (*Normalisation_pt).imag();
57  }
58  }
59  // Bifurcation constraint
60  const int local_eqn = this->eigenvalue_local_eqn(2);
61  if (local_eqn >= 0)
62  {
63  residuals[local_eqn] += this->eigenvalue(0);
64  }
65  }
double eigenvalue(const unsigned &i)
Return the traded pressure value.
Definition: linearised_navier_stokes_eigenvalue_elements.h:100

References eigenvalue(), and eigenvalue_local_eqn().

Referenced by fill_in_contribution_to_jacobian(), fill_in_contribution_to_jacobian_and_mass_matrix(), and fill_in_contribution_to_residuals().

◆ index_of_eigenvalue()

unsigned oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::index_of_eigenvalue ( )
inline

Return the index of Data object at which the traded pressure is stored.

107  {
108  return Index_of_eigenvalue;
109  }

References Index_of_eigenvalue.

Referenced by oomph::LinearisedNavierStokesEquations::set_eigenfunction_normalisation_element().

Member Data Documentation

◆ External_or_internal_data_index_of_eigenvalue

unsigned oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::External_or_internal_data_index_of_eigenvalue
private

Storage for the initial index of the eigenvalue.

Referenced by eigenvalue_data_pt(), and LinearisedNavierStokesEigenfunctionNormalisationElement().

◆ Index_of_eigenvalue

unsigned oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::Index_of_eigenvalue
private

Storage for the offset index of the eigenvalue.

Referenced by eigenvalue(), eigenvalue_local_eqn(), index_of_eigenvalue(), and LinearisedNavierStokesEigenfunctionNormalisationElement().

◆ Normalisation_pt

std::complex<double>* oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::Normalisation_pt
private

Pointer to the desired normalisation.

Referenced by LinearisedNavierStokesEigenfunctionNormalisationElement().


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