![]() |
|
#include <navier_stokes_elements_with_singularity.h>
Public Types | |
typedef Vector< double >(* | NavierStokesVelocitySingularFctPt) (const Vector< double > &x) |
Function pointer to the velocity singular function: More... | |
typedef Vector< Vector< double > >(* | NavierStokesGradVelocitySingularFctPt) (const Vector< double > &x) |
Function pointer to the gradient of the velocity singular function: More... | |
typedef double(* | NavierStokesPressureSingularFctPt) (const Vector< double > &x) |
Function pointer to the pressure singular function: More... | |
typedef Vector< double >(* | NavierStokesGradPressureSingularFctPt) (const Vector< double > &x) |
Function pointer to the gradient of the pressure singular function: More... | |
Public Member Functions | |
SingularNavierStokesSolutionElement () | |
Constructor. More... | |
bool & | singular_function_satisfies_stokes_equation () |
double | c () const |
Find the value of the unknown amplitude C. More... | |
void | set_c (const double &value) |
Find the value of the unknown amplitude C. More... | |
void | pin_c () |
Pin the value of the unknown amplitude C. More... | |
void | unpin_c () |
Unpin the value of the unknown amplitude C. More... | |
void | set_wrapped_navier_stokes_element_pt (WRAPPED_NAVIER_STOKES_ELEMENT *wrapped_navier_stokes_el_pt, const Vector< double > &s, unsigned *direction_pt) |
NavierStokesVelocitySingularFctPt & | velocity_singular_fct_pt () |
Access function to pointer to velocity singular function. More... | |
NavierStokesGradVelocitySingularFctPt & | grad_velocity_singular_fct_pt () |
Access function to pointer to gradient of velocity singular function. More... | |
NavierStokesPressureSingularFctPt & | pressure_singular_fct_pt () |
Access function to pointer to pressure singular function. More... | |
NavierStokesGradPressureSingularFctPt & | grad_pressure_singular_fct_pt () |
Access function to pointer to gradient of pressure singular function. More... | |
Vector< double > | velocity_singular_function (const Vector< double > &x) const |
Evaluate velocity singular function at Eulerian position x. More... | |
Vector< Vector< double > > | grad_velocity_singular_function (const Vector< double > &x) const |
double | pressure_singular_function (const Vector< double > &x) const |
Evaluate pressure singular function at Eulerian position x. More... | |
Vector< double > | grad_pressure_singular_function (const Vector< double > &x) const |
Evaluate gradient of pressure singular function at Eulerian position x. More... | |
Vector< double > | u_bar (const Vector< double > &x) |
Vector< Vector< double > > | grad_u_bar (const Vector< double > &x) |
double | p_bar (const Vector< double > &x) |
Vector< double > | grad_p_bar (const Vector< double > &x) |
void | fill_in_contribution_to_residuals (Vector< double > &residual) |
Compute residual. More... | |
void | fill_in_contribution_to_jacobian (Vector< double > &residual, DenseMatrix< double > &jacobian) |
![]() | |
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 ¤t_string) const |
virtual void | describe_local_dofs (std::ostream &out, const std::string ¤t_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 ¶meter_pt, Vector< double > &dres_dparam) |
virtual void | get_djacobian_dparameter (double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam) |
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) |
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 | |
void | fill_in_generic_contribution_to_residuals (Vector< double > &residual, DenseMatrix< double > &jacobian, const unsigned &flag) |
Compute local residual, and, if flag=1, local jacobian matrix. More... | |
Private Attributes | |
WRAPPED_NAVIER_STOKES_ELEMENT * | Wrapped_navier_stokes_el_pt |
Pointer to wrapped Navier-Stokes element. More... | |
NavierStokesVelocitySingularFctPt | Velocity_singular_fct_pt |
Pointer to velocity singular function. More... | |
NavierStokesGradVelocitySingularFctPt | Grad_velocity_singular_fct_pt |
NavierStokesPressureSingularFctPt | Pressure_singular_fct_pt |
Pointer to pressure singular function. More... | |
NavierStokesGradPressureSingularFctPt | Grad_pressure_singular_fct_pt |
Pointer to gradient of pressure singular function. More... | |
Vector< double > | S_in_wrapped_navier_stokes_element |
Local coordinates of singulariity in wrapped Navier-Stokes element. More... | |
unsigned * | Direction_pt |
Direction of the derivative used for the residual of the element. More... | |
bool | Singular_function_satisfies_stokes_equation |
We consider a singularity in the solution at the point O.
This class defines the singular functions.
velocity_singularity:
u_bar = C*velocity_singular_function
pressure_singularity:
p_bar = C*pressure_singular_function
and their gradients
The class also defines the function that computes the residual associated to C which is:
R_C = \frac{\partial p_FE}{\partial x_i} (O)
and thus regularises the FE solution by setting the pressure gradient in the coordinate direction x_i to zero. If the amplitude of the singular solution is known, pin C.
typedef Vector<double>(* oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::NavierStokesGradPressureSingularFctPt) (const Vector< double > &x) |
Function pointer to the gradient of the pressure singular function:
typedef Vector<Vector<double> >(* oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::NavierStokesGradVelocitySingularFctPt) (const Vector< double > &x) |
Function pointer to the gradient of the velocity singular function:
typedef double(* oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::NavierStokesPressureSingularFctPt) (const Vector< double > &x) |
Function pointer to the pressure singular function:
typedef Vector<double>(* oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::NavierStokesVelocitySingularFctPt) (const Vector< double > &x) |
Function pointer to the velocity singular function:
|
inline |
Constructor.
References oomph::GeneralisedElement::add_internal_data(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Direction_pt, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_pressure_singular_fct_pt, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_velocity_singular_fct_pt, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Pressure_singular_fct_pt, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Singular_function_satisfies_stokes_equation, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Velocity_singular_fct_pt, and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt.
|
inline |
Find the value of the unknown amplitude C.
References oomph::GeneralisedElement::internal_data_pt(), and oomph::Data::value().
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_p_bar(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_u_bar(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::p_bar(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::u_bar().
|
inlinevirtual |
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this function will NOT initialise the residuals vector or the jacobian matrix. It must be called after the residuals vector and jacobian matrix have been initialised to zero. The default is to use finite differences to calculate the jacobian
Reimplemented from oomph::GeneralisedElement.
|
inlinevirtual |
Compute residual.
Reimplemented from oomph::GeneralisedElement.
References oomph::GeneralisedElement::Dummy_matrix, and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_generic_contribution_to_residuals().
|
inlineprivate |
Compute local residual, and, if flag=1, local jacobian matrix.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Direction_pt, oomph::GeneralisedElement::eqn_number(), oomph::GeneralisedElement::internal_local_eqn(), j, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::S_in_wrapped_navier_stokes_element, and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_contribution_to_jacobian(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_contribution_to_residuals().
|
inline |
Evaluate gradient of pressure singular function (including its amplitude): grad_p_bar = C * grad_pressure_singular
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::c(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_pressure_singular_function(), oomph::GeneralisedElement::internal_data_pt(), oomph::Data::value(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt, and plotDoE::x.
|
inline |
Access function to pointer to gradient of pressure singular function.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_pressure_singular_fct_pt.
|
inline |
Evaluate gradient of pressure singular function at Eulerian position x.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_pressure_singular_fct_pt, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and plotDoE::x.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_p_bar().
|
inline |
Evaluate gradient of velocity singular function (including its amplitude): grad_u_bar = C * grad_velocity_singular; grad[i][j] = du_i/dx_j
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::c(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_velocity_singular_function(), i, oomph::GeneralisedElement::internal_data_pt(), oomph::Data::value(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt, and plotDoE::x.
|
inline |
Access function to pointer to gradient of velocity singular function.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_velocity_singular_fct_pt.
|
inline |
Evaluate gradient of velocity singular function at Eulerian position x. grad[i][j] = du_i/dx_j
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Grad_velocity_singular_fct_pt, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and plotDoE::x.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_u_bar().
|
inline |
Evaluate pressure singular function (including its amplitude): p_bar = C * pressure_singular
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::c(), oomph::GeneralisedElement::internal_data_pt(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::pressure_singular_function(), oomph::Data::value(), and plotDoE::x.
|
inline |
Pin the value of the unknown amplitude C.
References oomph::GeneralisedElement::internal_data_pt(), and oomph::Data::pin().
|
inline |
Access function to pointer to pressure singular function.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Pressure_singular_fct_pt.
|
inline |
Evaluate pressure singular function at Eulerian position x.
References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Pressure_singular_fct_pt, and plotDoE::x.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::p_bar().
|
inline |
Find the value of the unknown amplitude C.
References oomph::GeneralisedElement::internal_data_pt(), oomph::Data::set_value(), and Eigen::value.
|
inline |
Set pointer to associated wrapped Navier-Stokes element which contains the singularity (at local coordinate s). Also specify the direction in which the slope of the FE part of the pressure is set to zero. (Could also set a velocity derivative to zero but this needs to be done with a separate function. Write it if you need it...)
References oomph::GeneralisedElement::add_external_data(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Direction_pt, j, s, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::S_in_wrapped_navier_stokes_element, and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt.
|
inline |
Assert that singular function satisfies the Stokes equations by setting this to true or false.
|
inline |
Evaluate velocity singular function (including its amplitude): u_bar = C * velocity_singular
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::c(), oomph::GeneralisedElement::internal_data_pt(), oomph::Data::value(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::velocity_singular_function(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Wrapped_navier_stokes_el_pt, and plotDoE::x.
|
inline |
Unpin the value of the unknown amplitude C.
References oomph::GeneralisedElement::internal_data_pt(), and oomph::Data::unpin().
|
inline |
Access function to pointer to velocity singular function.
References oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Velocity_singular_fct_pt.
|
inline |
Evaluate velocity singular function at Eulerian position x.
References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::Velocity_singular_fct_pt, and plotDoE::x.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::u_bar().
|
private |
Direction of the derivative used for the residual of the element.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_generic_contribution_to_residuals(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::set_wrapped_navier_stokes_element_pt(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement().
|
private |
Pointer to gradient of pressure singular function.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_pressure_singular_fct_pt(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_pressure_singular_function(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement().
|
private |
Pointer to gradient of velocity singular function; grad[i][j] = du_i/dx_j
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_velocity_singular_fct_pt(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_velocity_singular_function(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement().
|
private |
Pointer to pressure singular function.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::pressure_singular_fct_pt(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::pressure_singular_function(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement().
|
private |
Local coordinates of singulariity in wrapped Navier-Stokes element.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_generic_contribution_to_residuals(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::set_wrapped_navier_stokes_element_pt().
|
private |
|
private |
Pointer to velocity singular function.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::velocity_singular_fct_pt(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::velocity_singular_function().
|
private |
Pointer to wrapped Navier-Stokes element.
Referenced by oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::fill_in_generic_contribution_to_residuals(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_p_bar(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::grad_u_bar(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::set_wrapped_navier_stokes_element_pt(), oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::SingularNavierStokesSolutionElement(), and oomph::SingularNavierStokesSolutionElement< WRAPPED_NAVIER_STOKES_ELEMENT >::u_bar().