oomph::NavierStokesWomersleyPressureControlElement Class Reference

#include <womersley_elements.h>

+ Inheritance diagram for oomph::NavierStokesWomersleyPressureControlElement:

Public Member Functions

 NavierStokesWomersleyPressureControlElement (TemplateFreeWomersleyImpedanceTubeBase *womersley_tube_pt)
 
 ~NavierStokesWomersleyPressureControlElement ()
 Destructor should not delete anything. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 This function returns the residuals. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
Datavolume_flux_data_pt () const
 
void add_pressure_data (Data *pressure_data_pt)
 
unsigned ndof_types () const
 
void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- 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)
 

Protected Member Functions

void fill_in_generic_residual_contribution_pressure_control (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
 
- 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_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, 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)
 

Private Attributes

DataVolume_flux_data_pt
 
TemplateFreeWomersleyImpedanceTubeBaseWomersley_tube_pt
 Pointer to the Womersley impedance tube. More...
 
unsigned Pressure_data_id
 Id of external Data object whose single value is the pressure. More...
 
unsigned Volume_flux_data_id
 

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
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

/////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// An element to impose a fluid pressure obtained from a Womersley impedance tube at a boundary. This element is used in conjunction with a NetFluxControlElementForWomersleyPressureControl element, and is passed to the NetFluxControlElementForWomersleyPressureControl element's constructor. The volume flux across the boundary is then an unknown of the problem. The constructor argument for this element is a suitable Womersley impedance tube to give the pressure via its get_response(...) function.

Note: the NavierStokesWomersleyPressureControlElement element calculates Jacobian entries BOTH for itself AND for the NetFluxControlElementForWomersleyPressureControl with respect to the unknowns in this (NavierStokesWomersleyPressureControlElement) element.

Constructor & Destructor Documentation

◆ NavierStokesWomersleyPressureControlElement()

oomph::NavierStokesWomersleyPressureControlElement::NavierStokesWomersleyPressureControlElement ( TemplateFreeWomersleyImpedanceTubeBase womersley_tube_pt)
inline

Constructor takes a pointer to a suitable Womersley impedance tube which defines the pressure via get_response(...)

2584  : Womersley_tube_pt(womersley_tube_pt)
2585  {
2586  // Create the new Data which contains the volume flux.
2587  Volume_flux_data_pt = new Data(1);
2588 
2589  // Add new Data to internal data
2591  }
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62
TemplateFreeWomersleyImpedanceTubeBase * Womersley_tube_pt
Pointer to the Womersley impedance tube.
Definition: womersley_elements.h:2702
unsigned Volume_flux_data_id
Definition: womersley_elements.h:2709
Data * Volume_flux_data_pt
Definition: womersley_elements.h:2699

References oomph::GeneralisedElement::add_internal_data(), Volume_flux_data_id, and Volume_flux_data_pt.

◆ ~NavierStokesWomersleyPressureControlElement()

oomph::NavierStokesWomersleyPressureControlElement::~NavierStokesWomersleyPressureControlElement ( )
inline

Destructor should not delete anything.

2594 {}

Member Function Documentation

◆ add_pressure_data()

void oomph::NavierStokesWomersleyPressureControlElement::add_pressure_data ( Data pressure_data_pt)
inline

Function to add to external data the Data object whose single value is the pressure applied at the boundary

2626  {
2627  Pressure_data_id = add_external_data(pressure_data_pt);
2628  }
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
unsigned Pressure_data_id
Id of external Data object whose single value is the pressure.
Definition: womersley_elements.h:2705

References oomph::GeneralisedElement::add_external_data(), and Pressure_data_id.

Referenced by oomph::NetFluxControlElementForWomersleyPressureControl::NetFluxControlElementForWomersleyPressureControl().

◆ fill_in_contribution_to_jacobian()

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

This function returns the residuals and the Jacobian, plus the Jacobian contribution for the NetFluxControlElementForWomersleyPressureControl with respect to unknowns in this element

Reimplemented from oomph::GeneralisedElement.

2610  {
2611  // Call the generic routine
2613  residuals, jacobian, 1);
2614  }
void fill_in_generic_residual_contribution_pressure_control(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Definition: womersley_elements.h:2661

References fill_in_generic_residual_contribution_pressure_control().

◆ fill_in_contribution_to_residuals()

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

This function returns the residuals.

Reimplemented from oomph::GeneralisedElement.

2598  {
2599  // Call the generic residuals function using a dummy matrix argument
2601  residuals, GeneralisedElement::Dummy_matrix, 0);
2602  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227

References oomph::GeneralisedElement::Dummy_matrix, and fill_in_generic_residual_contribution_pressure_control().

◆ fill_in_generic_residual_contribution_pressure_control()

void oomph::NavierStokesWomersleyPressureControlElement::fill_in_generic_residual_contribution_pressure_control ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned flag 
)
inlineprotected

This function returns the residuals. flag=1(or 0): do (or don't) compute the Jacobian as well. Note that this function also calculates the Jacobian contribution for the NetFluxControlElementForWomersleyPressureControl

2665  {
2666  // Get Womersley pressure and derivative with respect to the flux
2667  double womersley_pressure = 0.0;
2668  double d_womersley_pressure_d_q = 0.0;
2669 
2670  // Get response of impedance tube
2671  Womersley_tube_pt->get_response(womersley_pressure,
2672  d_womersley_pressure_d_q);
2673 
2674  // Get the current pressure
2675  double pressure = external_data_pt(Pressure_data_id)->value(0);
2676 
2677  // Get equation number of the volume flux unknown
2678  int local_eq = internal_local_eqn(Volume_flux_data_id, 0);
2679 
2680  // Calculate residuals
2681  residuals[local_eq] += pressure - womersley_pressure;
2682 
2683  // Calculate Jacobian contributions if required
2684  if (flag)
2685  {
2686  // Get equation number of the pressure data unknown
2687  int local_unknown = external_local_eqn(Pressure_data_id, 0);
2688 
2689  // Add the Jacobian contriburions
2690  jacobian(local_eq, local_eq) -= d_womersley_pressure_d_q;
2691  jacobian(local_eq, local_unknown) += 1.0;
2692  jacobian(local_unknown, local_eq) += 1.0;
2693  }
2694  }
double value(const unsigned &i) const
Definition: nodes.h:293
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
virtual void get_response(double &p_in, double &dp_in_dq)=0

References oomph::GeneralisedElement::external_data_pt(), oomph::GeneralisedElement::external_local_eqn(), oomph::TemplateFreeWomersleyImpedanceTubeBase::get_response(), oomph::GeneralisedElement::internal_local_eqn(), Pressure_data_id, oomph::Data::value(), Volume_flux_data_id, and Womersley_tube_pt.

Referenced by fill_in_contribution_to_jacobian(), and fill_in_contribution_to_residuals().

◆ get_dof_numbers_for_unknowns()

void oomph::NavierStokesWomersleyPressureControlElement::get_dof_numbers_for_unknowns ( std::list< std::pair< unsigned long, unsigned >> &  dof_lookup_list) const
inlinevirtual

Create a list of pairs for all unknowns in this element, so that the first entry in each pair contains the global equation number of the unknown, while the second one contains the number of the "DOF type" that this unknown is associated with. (Function can obviously only be called if the equation numbering scheme has been set up.)

Reimplemented from oomph::GeneralisedElement.

2645  {
2646  // pair to store dof lookup prior to being added to list
2647  std::pair<unsigned, unsigned> dof_lookup;
2648 
2649  dof_lookup.first = this->eqn_number(0);
2650  dof_lookup.second = 0;
2651 
2652  // add to list
2653  dof_lookup_list.push_front(dof_lookup);
2654  }
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704

References oomph::GeneralisedElement::eqn_number().

◆ ndof_types()

unsigned oomph::NavierStokesWomersleyPressureControlElement::ndof_types ( ) const
inlinevirtual

The number of "DOF types" that degrees of freedom in this element are sub-divided into - set to 1

Reimplemented from oomph::GeneralisedElement.

2633  {
2634  return 1;
2635  }

◆ volume_flux_data_pt()

Data* oomph::NavierStokesWomersleyPressureControlElement::volume_flux_data_pt ( ) const
inline

Function to return a pointer to the Data object whose single value is the flux degree of freedom

2619  {
2620  return Volume_flux_data_pt;
2621  }

References Volume_flux_data_pt.

Member Data Documentation

◆ Pressure_data_id

unsigned oomph::NavierStokesWomersleyPressureControlElement::Pressure_data_id
private

Id of external Data object whose single value is the pressure.

Referenced by add_pressure_data(), and fill_in_generic_residual_contribution_pressure_control().

◆ Volume_flux_data_id

unsigned oomph::NavierStokesWomersleyPressureControlElement::Volume_flux_data_id
private

Id of internal Data object whose single value is the volume flux

Referenced by fill_in_generic_residual_contribution_pressure_control(), and NavierStokesWomersleyPressureControlElement().

◆ Volume_flux_data_pt

Data* oomph::NavierStokesWomersleyPressureControlElement::Volume_flux_data_pt
private

Data object whose single value is the volume flux applied by the elements in the Flux_control_mesh_pt

Referenced by NavierStokesWomersleyPressureControlElement(), and volume_flux_data_pt().

◆ Womersley_tube_pt

TemplateFreeWomersleyImpedanceTubeBase* oomph::NavierStokesWomersleyPressureControlElement::Womersley_tube_pt
private

Pointer to the Womersley impedance tube.

Referenced by fill_in_generic_residual_contribution_pressure_control().


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