young_laplace_contact_angle_elements.h
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for elements that are used to apply contact angle
27 // BC for Young Laplace eqns
28 
29 #ifndef OOMPH_YOUNGLAPLACE_FLUX_ELEMENTS_HEADER
30 #define OOMPH_YOUNGLAPLACE_FLUX_ELEMENTS_HEADER
31 
32 
33 // Config header generated by autoconfig
34 #ifdef HAVE_CONFIG_H
35 #include <oomph-lib-config.h>
36 #endif
37 
38 
39 // oomph-lib ncludes
40 #include "../generic/Qelements.h"
41 
42 namespace oomph
43 {
44  //======================================================================
49  //======================================================================
50  template<class ELEMENT>
51  class YoungLaplaceContactAngleElement : public virtual FaceGeometry<ELEMENT>,
52  public virtual FaceElement
53  {
54  public:
58  const int& face_index);
59 
62  {
63  throw OomphLibError(
64  "Don't call empty constructor for YoungLaplaceContactAngleElement",
67  }
68 
71  const YoungLaplaceContactAngleElement& dummy) = delete;
72 
75 
78  double* prescribed_cos_gamma_pt() const
79  {
81  }
82 
83 
86  {
88  }
89 
90 
93 
97  inline int u_local_eqn(const unsigned& n)
98  {
99  // Local equation number is the first value stored at the node
100  return nodal_local_eqn(n, 0);
101  }
102 
103 
109  double zeta_nodal(const unsigned& n,
110  const unsigned& k,
111  const unsigned& i) const
112  {
113  return FaceElement::zeta_nodal(n, k, i);
114  }
115 
118  void output(std::ostream& outfile)
119  {
120  FiniteElement::output(outfile);
121  }
122 
125  void output(std::ostream& outfile, const unsigned& n_plot)
126  {
127  FiniteElement::output(outfile, n_plot);
128  }
129 
132  void output(FILE* file_pt)
133  {
134  FiniteElement::output(file_pt);
135  }
136 
140  void output(FILE* file_pt, const unsigned& n_plot)
141  {
142  FiniteElement::output(file_pt, n_plot);
143  }
144 
147 
150  Vector<double>& tangent,
152  {
153  // Dummy
154  double norm_of_drds;
155  Vector<double> spine(3);
156  contact_line_vectors(s, tangent, normal, spine, norm_of_drds);
157  }
158 
163  Vector<double>& tangent,
165  double& norm_of_drds)
166  {
167  // Dummy
168  Vector<double> spine(3);
169  contact_line_vectors(s, tangent, normal, spine, norm_of_drds);
170  }
171 
172 
178  Vector<double>& tangent,
180  Vector<double>& spine,
181  double& norm_of_drds);
182 
183  protected:
188  double& u(const unsigned int& n)
189  {
190  return *this->node_pt(n)->value_pt(0);
191  }
192 
195  {
196  // If the function pointer is zero return zero
197  if (Prescribed_cos_gamma_pt == 0)
198  {
199  return 0.0;
200  }
201  // Otherwise de-reference pointer
202  else
203  {
204  return *Prescribed_cos_gamma_pt;
205  }
206  }
207 
208 
209  private:
212  };
213 
214 
215 } // namespace oomph
216 
217 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
double * value_pt(const unsigned &i) const
Definition: nodes.h:324
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
Definition: elements.h:4998
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
Definition: oomph_definitions.h:222
Definition: young_laplace_contact_angle_elements.h:53
int u_local_eqn(const unsigned &n)
Definition: young_laplace_contact_angle_elements.h:97
void operator=(const YoungLaplaceContactAngleElement &)=delete
Broken assignment operator.
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: young_laplace_contact_angle_elements.h:125
double actual_cos_contact_angle(const Vector< double > &s)
Compute cosinus of actual contact angle.
Definition: young_laplace_contact_angle_elements.cc:154
YoungLaplaceContactAngleElement(const YoungLaplaceContactAngleElement &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt)
Definition: young_laplace_contact_angle_elements.h:132
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector.
Definition: young_laplace_contact_angle_elements.cc:70
double * prescribed_cos_gamma_pt() const
Definition: young_laplace_contact_angle_elements.h:78
double prescribed_cos_gamma()
Function to calculate the cos of the prescribed contact angle.
Definition: young_laplace_contact_angle_elements.h:194
double *& prescribed_cos_gamma_pt()
Access function for the pointer to the prescribed contact angle.
Definition: young_laplace_contact_angle_elements.h:85
double & u(const unsigned int &n)
Definition: young_laplace_contact_angle_elements.h:188
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: young_laplace_contact_angle_elements.h:109
YoungLaplaceContactAngleElement()
Broken empty constructor.
Definition: young_laplace_contact_angle_elements.h:61
void contact_line_vectors(const Vector< double > &s, Vector< double > &tangent, Vector< double > &normal)
Get unit tangent and normal vectors to contact line.
Definition: young_laplace_contact_angle_elements.h:149
void contact_line_vectors(const Vector< double > &s, Vector< double > &tangent, Vector< double > &normal, double &norm_of_drds)
Definition: young_laplace_contact_angle_elements.h:162
double * Prescribed_cos_gamma_pt
Pointer to prescribed cos gamma.
Definition: young_laplace_contact_angle_elements.h:211
void output(FILE *file_pt, const unsigned &n_plot)
Definition: young_laplace_contact_angle_elements.h:140
void output(std::ostream &outfile)
Definition: young_laplace_contact_angle_elements.h:118
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86