32 #ifndef OOMPH_INTERFACE_ELEMENTS_HEADER 33 #define OOMPH_INTERFACE_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 40 #include "../generic/elements.h" 41 #include "../generic/spines.h" 42 #include "../generic/shape.h" 43 #include "../generic/hijacked_elements.h" 100 if(Wall_unit_normal_fct_pt)
103 (*Wall_unit_normal_fct_pt)(x,normal);
110 "FluidInterfaceBoundingElement::wall_unit_normal()",
111 OOMPH_EXCEPTION_LOCATION);
142 Wall_unit_normal_fct_pt(0), Contact_angle_pt(0),
143 Ca_pt(0), Contact_angle_flag(0) { }
165 const bool &strong=
true);
187 "FluidInterfaceBoundingElement::ca()",
188 OOMPH_EXCEPTION_LOCATION);
198 if(Contact_angle_pt==0)
200 std::string error_message =
"Contact angle not set\n";
202 "Please use FluidInterfaceBoundingElement::set_contact_angle()\n";
204 OOMPH_CURRENT_FUNCTION,
205 OOMPH_EXCEPTION_LOCATION);
235 const unsigned &flag,
245 void output(std::ostream &outfile,
const unsigned &n_plot)
252 void output(FILE* file_pt,
const unsigned &n_plot)
367 if (External_data_number_of_external_pressure<0)
370 OOMPH_CURRENT_FUNCTION,
371 OOMPH_EXCEPTION_LOCATION);
375 Index_of_external_pressure_value);
383 virtual void fill_in_generic_residual_contribution_interface(
409 virtual double compute_surface_derivatives(
const Shape &psi,
const DShape &dpsids,
433 const unsigned &flag,
437 const DShape &dpsifdS_div,
468 fill_in_generic_residual_contribution_interface(
475 const double&
ca()
const {
487 "FluidInterfaceElement::ca()",
488 OOMPH_EXCEPTION_LOCATION);
497 const double &
st()
const {
return *St_pt;}
503 double u(
const unsigned &j,
const unsigned &
i)
521 return Pext_data_pt->
value(Index_of_external_pressure_value);
533 if (external_pressure_data_pt->
nvalue()!=1)
535 std::ostringstream error_message;
537 <<
"External pressure Data must only contain a single value!\n" 538 <<
"This one contains " 539 << external_pressure_data_pt->
nvalue() << std::endl;
542 OOMPH_CURRENT_FUNCTION,
543 OOMPH_EXCEPTION_LOCATION);
548 Pext_data_pt=external_pressure_data_pt;
556 External_data_number_of_external_pressure=this->
nexternal_data()-1;
559 Index_of_external_pressure_value=0;
571 index_of_external_pressure_value)
574 Index_of_external_pressure_value=index_of_external_pressure_value;
577 if (index_of_external_pressure_value>=external_pressure_data_pt->
nvalue())
579 std::ostringstream error_message;
581 <<
"External pressure Data only contains " 582 << external_pressure_data_pt->
nvalue() <<
" values\n" 583 <<
"You have declared value " << index_of_external_pressure_value
584 <<
" to be the value representing the pressure\n" << std::endl;
586 OOMPH_CURRENT_FUNCTION,
587 OOMPH_EXCEPTION_LOCATION);
592 Pext_data_pt=external_pressure_data_pt;
600 External_data_number_of_external_pressure=this->
nexternal_data()-1;
610 OOMPH_CURRENT_FUNCTION,
611 OOMPH_EXCEPTION_LOCATION);
628 void output(std::ostream &outfile,
const unsigned &n_plot);
634 void output(FILE* file_pt,
const unsigned &n_plot);
654 double compute_surface_derivatives(
const Shape &psi,
const DShape &dpsids,
658 DShape &surface_divergence);
679 double compute_surface_derivatives(
const Shape &psi,
const DShape &dpsids,
683 DShape &surface_divergence);
704 double compute_surface_derivatives(
const Shape &psi,
const DShape &dpsids,
708 DShape &surface_divergence);
LineFluidInterfaceBoundingElement()
Constructor.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
static double Default_Physical_Constant_Value
Default value for physical constants.
Specialisation of the interface boundary constraint to a line.
void output(FILE *file_pt)
Overload the C-style output function.
double ca()
Return the value of the capillary number.
Data * Pext_data_pt
Pointer to the Data item that stores the external pressure.
double *& ca_pt()
Access function to the pointer specifying the capillary number.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
virtual void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)=0
Calculate the generic residuals contribution.
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
unsigned Contact_angle_flag
Flag used to determine whether the contact angle is to be used (0 if not), and whether it will be app...
double * Contact_angle_pt
Pointer to the desired value of the contact angle (if any)
void(* WallUnitNormalFctPt)(const Vector< double > &x, Vector< double > &unit_normal)
Function pointer to a wall unit normal function. Returns the unit normal on the wall, at the specified Eulerian coordinate.
void set_external_pressure_data(Data *external_pressure_data_pt)
Set the Data that contains the single pressure value that specifies the "external pressure" for the i...
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
Specialisation of the interface boundary constraint to a point.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
unsigned Index_of_external_pressure_value
Which of the values in Pext_data_pt stores the external pressure.
AxisymmetricDerivatives()
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the residuals by calling the generic residual contribution.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
unsigned & bulk_node_number(const unsigned &n)
Return the bulk node number that corresponds to the n-th local node number.
void output(FILE *file_pt)
Overload the C-style output function.
void reset_in_external_fd(const unsigned &i)
The only external data are these geometric data so We can omit the reset function (relying on the nex...
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
double u(const unsigned &j, const unsigned &i)
Return the i-th velocity component at local node j.
virtual void add_additional_residual_contributions_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const Vector< double > &interpolated_n, const double &W)
Empty helper function to calculate the additional contributions arising from the node update strategy...
unsigned nexternal_data() const
Return the number of external data objects.
double * St_pt
Pointer to the Strouhal number.
void wall_unit_normal(const Vector< double > &x, Vector< double > &normal)
Function that returns the unit normal of the bounding wall directed out of the fluid.
double * Ca_pt
Pointer to the Capillary number.
void output(std::ostream &outfile)
Overload the output function.
PointFluidInterfaceBoundingElement()
Constructor.
Vector< unsigned > U_index_interface_boundary
Index at which the i-th velocity component is stored in the element's nodes.
void output(std::ostream &outfile)
Overload the output function.
double pext() const
Return the value of the external pressure.
void reset_after_external_fd()
We require a final node update in the bulk element after all finite differencing. ...
WallUnitNormalFctPt wall_unit_normal_fct_pt() const
Access function: Pointer to wall unit normal function. Const version.
void update_in_external_fd(const unsigned &i)
The geometric data of the parent element is included as external data and so a (bulk) node update mus...
WallUnitNormalFctPt & wall_unit_normal_fct_pt()
Access function: Pointer to wall unit normal function.
A class that represents a collection of data; each Data object may contain many different individual ...
FluidInterfaceElement()
Constructor, set the default values of the booleans and pointers (null)
const double & st() const
The value of the Strouhal number.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double *& contact_angle_pt()
Access function to the pointer specifying the prescribed contact angle.
double Default_Physical_Constant_Value
Default value for physical constants.
virtual int kinematic_local_eqn(const unsigned &n)=0
Function that is used to determine the local equation number of the kinematic equation associated wit...
Vector< unsigned > & u_index_interface_boundary()
Access for nodal index at which the velocity components are stored.
WallUnitNormalFctPt Wall_unit_normal_fct_pt
Pointer to a wall normal function that returns the wall unit normal as a function of position in glob...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
virtual double sigma(const Vector< double > &s_local)
Virtual function that specifies the non-dimensional surface tension as a function of local position w...
double * Ca_pt
Pointer to the desired value of the capillary number.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
FluidInterfaceBoundingElement()
Constructor.
double *& st_pt()
The pointer to the Strouhal number.
const double & ca() const
The value of the Capillary number.
int pext_local_eqn()
Access function for the local equation number that corresponds to the external pressure.
Vector< unsigned > U_index_interface
Nodal index at which the i-th velocity component is stored.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the residuals.
virtual FluidInterfaceBoundingElement * make_bounding_element(const int &face_index)
Create a bounding element e.g. to apply a contact angle boundary condition.
int External_data_number_of_external_pressure
The Data that contains the external pressure is stored as external Data for the element. Which external Data item is it? (int so it can be initialised to -1, indicating that external pressure hasn't been set).
virtual void add_additional_residual_contributions_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const DShape &dpsifdS, const DShape &dpsifdS_div, const Vector< double > &s, const Vector< double > &interpolated_x, const Vector< double > &interpolated_n, const double &W, const double &J)
Helper function to calculate the additional contributions to the resisuals and Jacobian that arise fr...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
void set_external_pressure_data(Data *external_pressure_data_pt, const unsigned &index_of_external_pressure_value)
Set the Data that contains the pressure value that specifies the "external pressure" for the interfac...
double & contact_angle()
Return value of the contact angle.
void set_contact_angle(double *const &angle_pt, const bool &strong=true)
Set a pointer to the desired contact angle. Optional boolean (defaults to true) chooses strong imposi...
double *& ca_pt()
Pointer to the Capillary number.
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...