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"    65                                       Vector<double> &unit_normal);
   100    if(Wall_unit_normal_fct_pt)
   103      (*Wall_unit_normal_fct_pt)(x,normal);
   109       OomphLibError(
"Wall unit normal fct has not been set",
   110                     "FluidInterfaceBoundingElement::wall_unit_normal()",
   111                     OOMPH_EXCEPTION_LOCATION);
   122    bulk_element_pt()->node_update();
   135    bulk_element_pt()->node_update();
   142   Wall_unit_normal_fct_pt(0), Contact_angle_pt(0),
   143    Ca_pt(0), Contact_angle_flag(0) { } 
   165                          const bool &strong=
true);
   186       OomphLibError(
"Capillary number has not been set",
   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";
   203      throw OomphLibError(error_message,
   204                          OOMPH_CURRENT_FUNCTION,
   205                          OOMPH_EXCEPTION_LOCATION);
   216     residuals,GeneralisedElement::Dummy_matrix,0);
   221    Vector<double> &residuals,  DenseMatrix<double> &jacobian, 
   233    Vector<double> &residuals, 
   234    DenseMatrix<double> &jacobian,
   235    const unsigned &flag,
   237    const DShape &dpsifds,
   238    const Vector<double> &interpolated_n, 
   242   void output(std::ostream &outfile) {FiniteElement::output(outfile);}
   245   void output(std::ostream &outfile, 
const unsigned &n_plot)
   246   {FiniteElement::output(outfile,n_plot);}
   249   void output(FILE* file_pt) {FiniteElement::output(file_pt);}
   252   void output(FILE* file_pt, 
const unsigned &n_plot)
   253   {FiniteElement::output(file_pt,n_plot);}
   273    Vector<double> &residuals, 
   274    DenseMatrix<double> &jacobian, 
   300    Vector<double> &residuals, 
   301    DenseMatrix<double> &jacobian, 
   367    if (External_data_number_of_external_pressure<0)
   369      throw OomphLibError(
"No external pressure has been set\n",
   370                          OOMPH_CURRENT_FUNCTION,
   371                          OOMPH_EXCEPTION_LOCATION);
   374    return external_local_eqn(External_data_number_of_external_pressure,
   375                              Index_of_external_pressure_value);
   383   virtual void fill_in_generic_residual_contribution_interface(
   384    Vector<double> &residuals, 
   385    DenseMatrix<double> &jacobian, 
   409   virtual double compute_surface_derivatives(
const Shape &psi, 
const DShape &dpsids,
   410                                              const DenseMatrix<double> &interpolated_t,
   411                                              const Vector<double> &interpolated_x,
   413                                              DShape &dpsidS_div)=0;
   431    Vector<double> &residuals, 
   432    DenseMatrix<double> &jacobian,
   433    const unsigned &flag,
   435    const DShape &dpsifds,
   436    const DShape &dpsifdS,
   437    const DShape &dpsifdS_div,
   438    const Vector<double> &s,
   439    const Vector<double> &interpolated_x, 
   440    const Vector<double> &interpolated_n, 
   454     St_pt = &Default_Physical_Constant_Value;
   462   virtual double sigma(
const Vector<double> &s_local) { 
return 1.0; }
   468    fill_in_generic_residual_contribution_interface(
   469     residuals,GeneralisedElement::Dummy_matrix,0);
   475   const double& 
ca()
 const {
   486       OomphLibError(
"Capillary number has not been set",
   487                     "FluidInterfaceElement::ca()",
   488                     OOMPH_EXCEPTION_LOCATION);
   497   const double &
st()
 const {
return *St_pt;}
   503   double u(
const unsigned &j, 
const unsigned &i)
   504   {
return node_pt(j)->value(U_index_interface[i]);}
   507   double interpolated_u(
const Vector<double> &s, 
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;
   541      throw OomphLibError(error_message.str(),
   542                          OOMPH_CURRENT_FUNCTION,
   543                          OOMPH_EXCEPTION_LOCATION);
   548    Pext_data_pt=external_pressure_data_pt;
   552    this->add_external_data(Pext_data_pt,
false);
   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;
   585      throw OomphLibError(error_message.str(),
   586                          OOMPH_CURRENT_FUNCTION,
   587                          OOMPH_EXCEPTION_LOCATION);
   592    Pext_data_pt=external_pressure_data_pt;
   596    this->add_external_data(Pext_data_pt,
false);
   600    External_data_number_of_external_pressure=this->nexternal_data()-1;
   607    const int &face_index)
   609    throw OomphLibError(
"Virtual function not yet implemented",
   610                        OOMPH_CURRENT_FUNCTION,
   611                        OOMPH_EXCEPTION_LOCATION);
   621   virtual void hijack_kinematic_conditions(
const Vector<unsigned> 
   622                                            &bulk_node_number)=0;
   625   void output(std::ostream &outfile) {FiniteElement::output(outfile);}
   628   void output(std::ostream &outfile, 
const unsigned &n_plot);
   631   void output(FILE* file_pt) {FiniteElement::output(file_pt);}
   634   void output(FILE* file_pt, 
const unsigned &n_plot);
   654   double compute_surface_derivatives(
const Shape &psi, 
const DShape &dpsids,
   655                                      const DenseMatrix<double> &interpolated_t,
   656                                      const Vector<double> &interpolated_x,
   657                                      DShape &surface_gradient,
   658                                      DShape &surface_divergence);
   679   double compute_surface_derivatives(
const Shape &psi, 
const DShape &dpsids,
   680                                      const DenseMatrix<double> &interpolated_t,
   681                                      const Vector<double> &interpolated_x,
   682                                      DShape &surface_gradient,
   683                                      DShape &surface_divergence);
   704   double compute_surface_derivatives(
const Shape &psi, 
const DShape &dpsids,
   705                                      const DenseMatrix<double> &interpolated_t,
   706                                      const Vector<double> &interpolated_x,
   707                                      DShape &surface_gradient,
   708                                      DShape &surface_divergence);
 LineFluidInterfaceBoundingElement()
Constructor. 
 
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 fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)=0
Calculate the generic residuals contribution. 
 
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...
 
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. 
 
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...
 
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...
 
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. 
 
FluidInterfaceElement()
Constructor, set the default values of the booleans and pointers (null) 
 
const double & st() const
The value of the Strouhal number. 
 
double *& contact_angle_pt()
Access function to the pointer specifying the prescribed contact angle. 
 
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...
 
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...
 
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.