34 #include "../generic/integral.h"   113   unsigned n_dim = parent_pt->
dim();
   134   for(
unsigned i=0;
i<spatial_dim;
i++) 
   135    {dot += unit_normal[
i]*wall_normal[
i];}
   146     wall_tangent[0] = - wall_normal[1];
   147     wall_tangent[1] = wall_normal[0];
   150     double ca_local = 
ca();
   153     for(
unsigned i=0;
i<2;
i++)
   158         residuals[local_eqn] += 
   176     double ca_local = 
ca();
   181     for(
unsigned i=0;
i<2;
i++)
   186         residuals[local_eqn] += (sigma_local/ca_local)*m[i];
   256   unsigned n_dim = parent_pt->
dim();
   262   unsigned n_node = this->
nnode();
   269   for(
unsigned ipt=0;ipt<n_intpt;++ipt)
   283     for(
unsigned n=0;n<n_node;n++)
   285       const double psi_local = psi(n);
   286       const double dpsi_local = dpsids(n,0);
   287       for(
unsigned i=0;
i<spatial_dim;
i++)
   290         interpolated_t1[
i] += pos*dpsi_local;
   291         x[
i] += pos*psi_local;
   296     double t_length = 0.0;
   297     for(
unsigned i=0;
i<spatial_dim;++
i) 
   298      {t_length += interpolated_t1[
i]*interpolated_t1[
i];}
   313       for(
unsigned i=0;
i<spatial_dim;
i++) 
   314        {dot += unit_normal[
i]*wall_normal[
i];}
   318       for(
unsigned i=0;
i<spatial_dim;
i++)
   319        {binorm[
i] = unit_normal[
i] - dot*wall_normal[
i];}
   322       const double sigma_local =
   326       const double ca_local = 
ca();
   334       for(
unsigned l=0;l<n_node;l++)
   337         for(
unsigned i=0;
i<3;
i++)
   346             residuals[local_eqn] +=  (sigma_local/ca_local)*
   347              (sin(theta)*wall_normal[
i]
   348               + cos(theta)*binorm[
i])*psi(l)*
W;
   365       const double sigma_local = 
   370       const double ca_local = 
ca();
   373       for(
unsigned l=0;l<n_node;l++)
   376         for(
unsigned i=0;
i<3;
i++)
   385             residuals[local_eqn] +=  m[
i]*(sigma_local/ca_local)*psi(l)*
W;
   405       for(
unsigned i=0;
i<spatial_dim;
i++) 
   406        {dot += unit_normal[
i]*wall_normal[
i];}
   409       for(
unsigned l=0;l<n_node;l++)
   419           residuals[local_eqn] += 
   429      residuals,jacobian,flag,psi,dpsids,unit_normal,W);
   461   double interpolated_u = 0.0;
   464   for(
unsigned l=0;l<n_node;l++) {interpolated_u += u(l,i)*psi(l);}
   466   return(interpolated_u);
   479   unsigned n_node = this->
nnode();
   485   const unsigned el_dim = this->
dim();
   487   DShape dpsifds(n_node,el_dim);
   499   DShape dpsifdS(n_node,n_dim);
   500   DShape dpsifdS_div(n_node,n_dim);
   512   double p_ext = pext();
   515   int local_eqn=0, local_unknown=0;
   521   for(
unsigned ipt=0;ipt<n_intpt;ipt++)
   539     for(
unsigned l=0;l<n_node;l++)
   541       const double psi_ = psif(l);
   543       for(
unsigned i=0;
i<n_dim;
i++)
   552         for(
unsigned j=0;j<el_dim;j++)
   558         interpolated_u[
i]  += u(l,
i)*psi_;
   566      this->compute_surface_derivatives(psif,dpsifds,
   578     double Sigma = this->sigma(s);
   581     for(
unsigned l=0;l<n_node;l++)
   584       for(
unsigned i=0;
i<n_dim;
i++)
   593           residuals[local_eqn] -= (Sigma/Ca)*dpsifdS_div(l,i)*J*
W;
   599             residuals[local_eqn] -= p_ext*interpolated_n[
i]*psif(l)*J*
W;
   606               local_unknown = pext_local_eqn();
   607               if(local_unknown >= 0)
   609                 jacobian(local_eqn,local_unknown) -=
   610                  interpolated_n[
i]*psif(l)*J*
W;
   624         for(
unsigned k=0;k<n_dim;k++)
   626           residuals[local_eqn] += 
   627            (interpolated_u[k] - St*interpolated_dx_dt[k])
   628            *interpolated_n[k]*psif(l)*J*
W;
   635           for(
unsigned l2=0;l2<n_node;l2++)
   638             for(
unsigned i2=0;i2<n_dim;i2++)
   643               if(local_unknown >= 0)
   645                 jacobian(local_eqn,local_unknown) +=
   646                  psif(l2)*interpolated_n[i2]*psif(l)*J*
W;
   657     add_additional_residual_contributions_interface(residuals,
   677  output(std::ostream &outfile, 
const unsigned &n_plot)
   679   const unsigned el_dim = this->
dim();
   681   const unsigned n_velocity = this->U_index_interface.size();
   690   for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   697     for(
unsigned i=0;
i<n_velocity;
i++) outfile << interpolated_u(s,
i) << 
" ";      
   700     outfile << 0.0 << 
"\n";
   714  output(FILE* file_pt, 
const unsigned &n_plot)
   716   const unsigned el_dim = this->
dim();
   718   const unsigned n_velocity = this->U_index_interface.size();
   727   for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   733     for(
unsigned i=0;
i<n_dim;
i++) 
   739     for(
unsigned i=0;
i<n_velocity;
i++) 
   741       fprintf(file_pt,
"%g ",interpolated_u(s,
i));
   745     fprintf(file_pt,
"%g \n",0.0);
   747   fprintf(file_pt,
"\n");
   770   const unsigned n_shape = psi.
nindex1();
   771   const unsigned n_dim = 2;
   775   double a11 = interpolated_t(0,0)*interpolated_t(0,0) + 
   776    interpolated_t(0,1)*interpolated_t(0,1);
   779   for(
unsigned l=0;l<n_shape;l++)
   781     for(
unsigned i=0;
i<n_dim;
i++)
   783       dpsidS(l,
i) = dpsids(l,0)*interpolated_t(0,
i)/a11;
   811   const unsigned n_shape = psi.
nindex1();
   812   const unsigned n_dim = 2;
   816   double a11 = interpolated_t(0,0)*interpolated_t(0,0) + 
   817    interpolated_t(0,1)*interpolated_t(0,1);
   820   for(
unsigned l=0;l<n_shape;l++)
   822     for(
unsigned i=0;
i<n_dim;
i++)
   824       dpsidS(l,
i) = dpsids(l,0)*interpolated_t(0,
i)/a11;
   826       dpsidS_div(l,
i) = dpsidS(l,
i);
   830   const double r = interpolated_x[0];
   834   for(
unsigned l=0;l<n_shape;l++)
   836     dpsidS_div(l,0) += psi(l)/r;
   858   const unsigned n_shape = psi.
nindex1();
   859   const unsigned n_dim = 3;
   864   for(
unsigned al=0;al<2;al++)
   866     for(
unsigned be=0;be<2;be++)
   871       for(
unsigned i=0;
i<n_dim;
i++)
   873         amet[al][be] += interpolated_t(al,
i)*interpolated_t(be,
i);
   879   double det_a = amet[0][0]*amet[1][1] - amet[0][1]*amet[1][0];
   882   aup[0][0] = amet[1][1]/det_a;
   883   aup[0][1] = -amet[0][1]/det_a;
   884   aup[1][0] = -amet[1][0]/det_a;
   885   aup[1][1] = amet[0][0]/det_a;
   889   for(
unsigned l=0;l<n_shape;l++)
   892     const double dpsi_temp[2] =
   893      {aup[0][0]*dpsids(l,0) + aup[0][1]*dpsids(l,1),
   894       aup[1][0]*dpsids(l,0) + aup[1][1]*dpsids(l,1)};
   896     for(
unsigned i=0;
i<n_dim;
i++)
   898       dpsidS(l,
i) = dpsi_temp[0]*interpolated_t(0,
i)
   899        + dpsi_temp[1]*interpolated_t(1,
i);
 virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
 
static double Default_Physical_Constant_Value
Default value for physical constants. 
 
double ca()
Return the value of the capillary number. 
 
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
 
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
 
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==1) the Jacobian – this functio...
 
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate. 
 
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) 
 
A general Finite Element class. 
 
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...
 
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations. 
 
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point. 
 
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Calculate the vector of local coordinate in the bulk element given the local coordinates in this Face...
 
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
 
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...
 
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. 
 
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element. 
 
void output(std::ostream &outfile)
Overload the output function. 
 
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
 
Vector< unsigned > U_index_interface_boundary
Index at which the i-th velocity component is stored in the element's nodes. 
 
Integral *const  & integral_pt() const
Return the pointer to the integration scheme (const version) 
 
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point. 
 
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
 
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==true) the Jacobian – this func...
 
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
 
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations. 
 
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...
 
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations. 
 
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
 
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
 
double dot(const Vector< double > &a, const Vector< double > &b)
Probably not always best/fastest because not optimised for dimension but useful... 
 
double interpolated_u(const Vector< double > &s, const unsigned &i)
Calculate the i-th velocity component at the local coordinate s. 
 
virtual unsigned nweight() const =0
Return the number of integration points of the scheme. 
 
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element. 
 
unsigned nindex1() const
Return the range of index 1 of the shape function object. 
 
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. 
 
unsigned nnode() const
Return the number of nodes. 
 
virtual void fill_in_generic_residual_contribution_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Helper function to calculate the residuals and (if flag==1) the Jacobian of the equations. This is implemented generically using the surface divergence information that is overloaded in each element i.e. axisymmetric, two- or three-dimensional. 
 
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
 
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...
 
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node...