young_laplace_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-2023 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 YoungLaplace elements
27 #ifndef OOMPH_YOUNGLAPLACE_ELEMENTS_HEADER
28 #define OOMPH_YOUNGLAPLACE_ELEMENTS_HEADER
29 
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 
37 // OOMPH-LIB headers
38 #include "../generic/nodes.h"
39 #include "../generic/Qelements.h"
40 
41 
42 namespace oomph
43 {
44  //=============================================================
45  /// A class for all isoparametric elements that solve the
46  /// YoungLaplace equations.
47  /// \f[ div (\frac{1}{W} \nabla u) = \kappa \f]
48  /// with
49  /// \f[ W^2=1+\|\nabla u\|^2 \f]
50  /// These equations can either be solved in the above (cartesian)
51  /// form, or in a parametric representation using the method
52  /// of spines. See the theory write-up in the documentation for
53  /// details.
54  /// This class contains the generic maths. Shape functions, geometric
55  /// mapping etc. must get implemented in derived class.
56  //=============================================================
57  class YoungLaplaceEquations : public virtual FiniteElement
58  {
59  public:
60  /// Function pointer to "spine base" function
61  typedef void (*SpineBaseFctPt)(const Vector<double>& x,
62  Vector<double>& spine_base,
63  Vector<Vector<double>>& dspine_base);
64 
65  /// Function pointer to "spine" function
66  typedef void (*SpineFctPt)(const Vector<double>& x,
67  Vector<double>& spine,
68  Vector<Vector<double>>& dspine);
69 
70  /// Constructor: Initialise pointers to NULL, so by default
71  /// prescribed kappa evaluates to zero, and no spines are used.
73  {
74  }
75 
76  /// Broken copy constructor
78 
79  /// Broken assignment operator
80  void operator=(const YoungLaplaceEquations&) = delete;
81 
82  /// Access function: Nodal function value at local node n
83  /// Uses suitably interpolated value for hanging nodes.
84  virtual inline double u(const unsigned& n) const
85  {
86  return nodal_value(n, 0);
87  }
88 
89  /// Output with default number of plot points
90  void output(std::ostream& outfile)
91  {
92  unsigned n_plot = 5;
93  output(outfile, n_plot);
94  }
95 
96  /// Output FE representation of soln
97  /// at n_plot^2 plot points
98  void output(std::ostream& outfile, const unsigned& n_plot);
99 
100 
101  /// Output exact soln at n_plot^2 plot points
102  void output_fct(std::ostream& outfile,
103  const unsigned& n_plot,
105 
106 
107  /// Output exact soln at
108  /// n_plot^2 plot points (dummy time-dependent version to
109  /// keep intel compiler happy)
110  virtual void output_fct(
111  std::ostream& outfile,
112  const unsigned& n_plot,
113  const double& time,
115  {
116  throw OomphLibError("These equations are steady => no time dependence",
117  OOMPH_CURRENT_FUNCTION,
118  OOMPH_EXCEPTION_LOCATION);
119  }
120 
121 
122  /// Get error against and norm of exact solution
123  void compute_error(std::ostream& outfile,
125  double& error,
126  double& norm);
127 
128  /// Dummy, time dependent error checker
129  void compute_error(std::ostream& outfile,
131  const double& time,
132  double& error,
133  double& norm)
134  {
135  throw OomphLibError("These equations are steady => no time dependence",
136  OOMPH_CURRENT_FUNCTION,
137  OOMPH_EXCEPTION_LOCATION);
138  }
139 
140 
141  /// Access function: Pointer Data object that stores kappa (const
142  /// version -- kappa must be set with set_kappa() which also ensures
143  /// that the Data object is added to the element's external Data.
145  {
146  return Kappa_pt;
147  }
148 
149  /// Use spines or not? (Based on availability of function pointers
150  /// to to spine and spine base vector fields)
151  bool use_spines() const
152  {
153  return (Spine_fct_pt != 0);
154  }
155 
156  /// Access function to function pointer that specifies spine base
157  /// vector field
159  {
160  return Spine_base_fct_pt;
161  }
162 
163 
164  /// Access function to function pointer that specifies spine
165  /// vector field
167  {
168  return Spine_fct_pt;
169  }
170 
171  /// Set curvature data (and add it to the element's external Data)
173  {
174 #ifdef PARANOID
175  if (kappa_pt->nvalue() != 1)
176  {
177  throw OomphLibError("kappa must only store a single value!",
178  OOMPH_CURRENT_FUNCTION,
179  OOMPH_EXCEPTION_LOCATION);
180  }
181 #endif
182 
183  // Make a local copy
184  Kappa_pt = kappa_pt;
185 
186  // Add to external data and store index in this storage scheme
188  }
189 
190 
191  /// Get curvature
192  double get_kappa() const
193  {
194  /// No kappa has been set: return zero (the default)
195  if (Kappa_pt == 0)
196  {
197  return 0.0;
198  }
199  else
200  {
201  // Get prescribed kappa value
202  return Kappa_pt->value(0);
203  }
204  }
205 
206 
207  /// Get flux: flux[i] = du/dx_i: Mainly used for error estimation.
208  void get_flux(const Vector<double>& s, Vector<double>& flux) const
209  {
210  // Find out how many nodes there are in the element
211  unsigned n_node = nnode();
212 
213  // Set up memory for the shape (same as test functions)
214  Shape psi(n_node);
215  DShape dpsidx(n_node, 2);
216 
217  // Call the derivatives of the shape (same as test functions)
218  dshape_eulerian(s, psi, dpsidx);
219 
220  // Initialise to zero
221  for (unsigned j = 0; j < 2; j++)
222  {
223  flux[j] = 0.0;
224  }
225 
226  // Loop over nodes
227  for (unsigned l = 0; l < n_node; l++)
228  {
229  // Loop over derivative directions
230  for (unsigned j = 0; j < 2; j++)
231  {
232  flux[j] += u(l) * dpsidx(l, j);
233  }
234  }
235  }
236 
237 
238  /// Get spine base vector field: Defaults to standard cartesian
239  /// representation if no spine base fct pointers have been set.
240  /// dspine_B[i][j] = d spine_B[j] / dx_i
241  inline virtual void get_spine_base(
242  const Vector<double>& x,
243  Vector<double>& spine_base,
244  Vector<Vector<double>>& dspine_base) const
245  {
246  // If no spine function has been set, default to vertical spines
247  // emanating from x[0](,x[1])
248  if (Spine_base_fct_pt == 0)
249  {
250  for (unsigned i = 0; i < 3; i++)
251  {
252  spine_base[i] = x[i];
253  for (unsigned j = 0; j < 2; j++)
254  {
255  dspine_base[i][j] = 0.0;
256  }
257  }
258  }
259  else
260  {
261  // Get spine
262  (*Spine_base_fct_pt)(x, spine_base, dspine_base);
263  }
264  }
265 
266  /// Get spine vector field: Defaults to standard cartesian
267  /// representation if no spine base fct pointers have been set.
268  /// dspine[i][j] = d spine[j] / dx_i
269  inline void get_spine(const Vector<double>& x,
270  Vector<double>& spine,
271  Vector<Vector<double>>& dspine) const
272  {
273  // If no spine function has been set, default to vertical spines
274  // emanating from x[0](,x[1])
275  if (Spine_fct_pt == 0)
276  {
277  // Initialise all to zero
278  for (unsigned i = 0; i < 3; i++)
279  {
280  spine[i] = 0.0;
281  for (unsigned j = 0; j < 2; j++)
282  {
283  dspine[i][j] = 0.0;
284  }
285  }
286  // Overwrite vertical component
287  spine[2] = 1.0;
288  }
289  else
290  {
291  // Get spine
292  (*Spine_fct_pt)(x, spine, dspine);
293  }
294  }
295 
296  /// Get position vector to meniscus at local coordinate s
297  void position(const Vector<double>& s, Vector<double>& r) const;
298 
299  /// Get exact position vector to meniscus at local coordinate s
300  void exact_position(const Vector<double>& s,
301  Vector<double>& r,
303 
304  /// Add the element's contribution to its residual vector
306 
307 
308  /// Return FE representation of function value u(s) at local coordinate s
309  inline double interpolated_u(const Vector<double>& s) const
310  {
311  // Find number of nodes
312  unsigned n_node = nnode();
313 
314  // Local shape function
315  Shape psi(n_node);
316 
317  // Find values of shape function
318  shape(s, psi);
319 
320  // Initialise value of u
321  double interpolated_u = 0.0;
322 
323  // Loop over the local nodes and sum
324  for (unsigned l = 0; l < n_node; l++)
325  {
326  interpolated_u += u(l) * psi[l];
327  }
328 
329  return (interpolated_u);
330  }
331 
332 
333  /// Self-test: Return 0 for OK
334  unsigned self_test();
335 
336 
337  /// Helper fct: Allocate storage for a vector of vectors of doubles
338  /// to v(n_rows,n_cols) and initialise each component to 0.0.
339  static void allocate_vector_of_vectors(unsigned n_rows,
340  unsigned n_cols,
342  {
343  v.resize(n_rows);
344  for (unsigned i = 0; i < n_rows; i++)
345  {
346  v[i].resize(n_cols);
347  for (unsigned j = 0; j < n_cols; j++)
348  {
349  v[i][j] = 0.0;
350  }
351  }
352  }
353 
354  /// Multiply a vector by a scalar
355  static void scalar_times_vector(const double& lambda,
356  const Vector<double>& v,
357  Vector<double>& lambda_times_v)
358  {
359  unsigned n = v.size();
360  for (unsigned i = 0; i < n; i++)
361  {
362  lambda_times_v[i] = lambda * v[i];
363  }
364  }
365 
366 
367  /// 2-norm of a vector
368  static double two_norm(const Vector<double>& v)
369  {
370  double norm = 0.0;
371  unsigned n = v.size();
372  for (unsigned i = 0; i < n; i++)
373  {
374  norm += v[i] * v[i];
375  }
376  return sqrt(norm);
377  }
378 
379 
380  /// Scalar product between two vectors
381  static double scalar_product(const Vector<double>& v1,
382  const Vector<double>& v2)
383  {
384  double scalar = 0.0;
385  unsigned n = v1.size();
386  for (unsigned i = 0; i < n; i++)
387  {
388  scalar += v1[i] * v2[i];
389  }
390  return scalar;
391  }
392 
393  /// Cross-product: v_cross= v1 x v2
394  static void cross_product(const Vector<double>& v1,
395  const Vector<double>& v2,
396  Vector<double>& v_cross)
397  {
398 #ifdef PARANOID
399  if ((v1.size() != v2.size()) || (v1.size() != 3))
400  {
401  throw OomphLibError("Vectors must be of dimension 3 for cross-product!",
402  OOMPH_CURRENT_FUNCTION,
403  OOMPH_EXCEPTION_LOCATION);
404  }
405 #endif
406  v_cross[0] = v1[1] * v2[2] - v1[2] * v2[1];
407  v_cross[1] = v1[2] * v2[0] - v1[0] * v2[2];
408  v_cross[2] = v1[0] * v2[1] - v1[1] * v2[0];
409  }
410 
411  /// Vectorial sum of two vectors
412  static void vector_sum(const Vector<double>& v1,
413  const Vector<double>& v2,
414  Vector<double>& vs)
415  {
416  unsigned n = v1.size();
417  for (unsigned i = 0; i < n; i++)
418  {
419  vs[i] = v1[i] + v2[i];
420  }
421  }
422 
423  protected:
424  /// Get the local equation number of the (one and only) unknown
425  /// stored at local node n (returns -1 if value is pinned).
426  /// Can be overloaded in derived multiphysics elements.
427  virtual inline int u_local_eqn(const unsigned& n)
428  {
429  return nodal_local_eqn(n, 0);
430  }
431 
432  /// Index of Kappa_pt in the element's storage of external Data
433  unsigned Kappa_index;
434 
435  /// Pointer to spine base function:
437 
438  /// Pointer to spine function:
440 
441  private:
442  /// Pointer to Data item that stores kappa as its first value
443  /// -- private to ensure that it must be set with
444  /// set_kappa(...) which adds the Data to the element's internal
445  /// Data!
447  };
448 
449 
450  /// ////////////////////////////////////////////////////////////////////////
451  /// ////////////////////////////////////////////////////////////////////////
452  /// ////////////////////////////////////////////////////////////////////////
453 
454 
455  //======================================================================
456  /// QYoungLaplaceElement elements are linear/quadrilateral/brick-shaped
457  /// YoungLaplace elements with isoparametric interpolation for the function.
458  //======================================================================
459  template<unsigned NNODE_1D>
460  class QYoungLaplaceElement : public virtual QElement<2, NNODE_1D>,
461  public virtual YoungLaplaceEquations
462  {
463  private:
464  /// Static array of ints to hold number of variables at
465  /// nodes: Initial_Nvalue[n]
466  static const unsigned Initial_Nvalue[];
467 
468  public:
469  /// Constructor: Call constructors for QElement and
470  /// YoungLaplace equations
472 
473  /// Broken copy constructor
475 
476  /// Broken assignment operator
478 
479  /// Required # of `values' (pinned or dofs)
480  /// at node n
481  inline unsigned required_nvalue(const unsigned& n) const
482  {
483  return Initial_Nvalue[n];
484  }
485 
486  /// Output function
487  void output(std::ostream& outfile)
488  {
490  }
491 
492 
493  /// Output function at n_plot^2 plot points
494  void output(std::ostream& outfile, const unsigned& n_plot)
495  {
496  YoungLaplaceEquations::output(outfile, n_plot);
497  }
498 
499 
500  /// Output function for an exact solutio at n_plot^2 plot points
501  void output_fct(std::ostream& outfile,
502  const unsigned& n_plot,
504  {
505  YoungLaplaceEquations::output_fct(outfile, n_plot, exact_soln_pt);
506  }
507 
508 
509  /// Output function for a time-dependent exact solution
510  /// at n_plot^2 plot points (calls the steady version)
511  void output_fct(std::ostream& outfile,
512  const unsigned& n_plot,
513  const double& time,
515  {
516  YoungLaplaceEquations::output_fct(outfile, n_plot, time, exact_soln_pt);
517  }
518  };
519 
520 
521  /// /////////////////////////////////////////////////////////////////////
522  /// /////////////////////////////////////////////////////////////////////
523  /// /////////////////////////////////////////////////////////////////////
524 
525 
526  //=======================================================================
527  /// Face geometry for the QYoungLaplaceElement elements: The spatial
528  /// dimension of the face elements is one lower than that of the
529  /// bulk element but they have the same number of points
530  /// along their 1D edges.
531  //=======================================================================
532  template<unsigned NNODE_1D>
534  : public virtual QElement<1, NNODE_1D>
535  {
536  public:
537  /// Constructor: Call the constructor for the
538  /// appropriate lower-dimensional QElement
539  FaceGeometry() : QElement<1, NNODE_1D>() {}
540  };
541 
542 
543  /// /////////////////////////////////////////////////////////////////////
544  /// /////////////////////////////////////////////////////////////////////
545  /// /////////////////////////////////////////////////////////////////////
546 
547 
548  //========================================================================
549  /// Height control element for YoungLaplace equations: Prescribe
550  /// displacement along a spine (i.e. the "height of the meniscus"
551  /// in exchange for treating the curvature as an unknown. Very
552  /// similar to the DisplacementControlElement used in solid
553  /// mechanics problems.
554  //========================================================================
556  {
557  public:
558  /// Constructor: Pass pointer to node at which the height is controlled
559  /// and pointer to double that stores the prescribed height at that
560  /// node.
561  HeightControlElement(Node* control_node_pt, double* prescribed_height_pt)
563  {
564  // Store pointer to prescribed height value
565  Prescribed_height_pt = prescribed_height_pt;
566 
567  // Store pointer to Node at which the height is controlled
568  Control_node_pt = control_node_pt;
569 
570  // Create curvature Data, add it as internal data, and store
571  // its number with the internal data storage scheme
572  // (i.e. internal_data_pt(Curvature_data_index) will return
573  // the pointer to it...).
575 
576  // Add control_node_pt as external data
577  add_external_data(static_cast<Data*>(control_node_pt));
578  }
579 
580  /// Access function to the pointer to the Data object that
581  /// stores the curvature.
583  {
585  }
586 
587  /// Setup local equation number for the height-control equation
589  {
590  // Get equation number from generic scheme: The height control
591  // equation is "the equation for the curvature" which is
592  // stored as internal data in the element and has been
593  // numbered as such...
595  }
596 
597 
598  /// Add the element's contribution to its residual vector:
599  /// The height constraint. [Note: Jacobian is computed
600  /// automatically by finite-differencing]
602  {
603  residuals[Height_ctrl_local_eqn] =
604  Control_node_pt->value(0) - (*Prescribed_height_pt);
605  }
606 
607  private:
608  /// Pointer to value that stores the controlled height
610 
611  /// Pointer to node at which the height is controlled
613 
614  /// In which component (in the vector of the element's internal
615  /// Data) is the unknown curvature stored?
617 
618  /// Local equation number of the height-control equation
620  };
621 
622 
623 } // namespace oomph
624 
625 
626 #endif
static char t char * s
Definition: cfortran.h:568
cstr elem_len * i
Definition: cfortran.h:603
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Definition: shape.h:278
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:86
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
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 ...
Definition: nodes.h:293
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition: elements.h:4998
A general Finite Element class.
Definition: elements.h:1313
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
Definition: elements.h:2593
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...
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.
Definition: elements.h:1432
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Definition: elements.h:1759
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
Definition: elements.cc:3298
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
Definition: elements.h:1765
A Generalised Element class.
Definition: elements.h:73
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
Definition: elements.cc:62
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
Definition: elements.h:267
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
Definition: elements.cc:307
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
void assign_additional_local_eqn_numbers()
Setup local equation number for the height-control equation.
unsigned Curvature_data_index
In which component (in the vector of the element's internal Data) is the unknown curvature stored?
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector: The height constraint. [Note: Jacobian is comp...
Node * Control_node_pt
Pointer to node at which the height is controlled.
double * Prescribed_height_pt
Pointer to value that stores the controlled height.
HeightControlElement(Node *control_node_pt, double *prescribed_height_pt)
Constructor: Pass pointer to node at which the height is controlled and pointer to double that stores...
Data *& kappa_pt()
Access function to the pointer to the Data object that stores the curvature.
unsigned Height_ctrl_local_eqn
Local equation number of the height-control equation.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:906
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
Definition: nodes.cc:2408
An OomphLibError object which should be thrown when an run-time error is encountered....
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
Definition: Qelements.h:459
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
QYoungLaplaceElement()
Constructor: Call constructors for QElement and YoungLaplace equations.
QYoungLaplaceElement(const QYoungLaplaceElement< NNODE_1D > &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function at n_plot^2 plot points.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solutio at n_plot^2 plot points.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at nodes: Initial_Nvalue[n].
void operator=(const QYoungLaplaceElement< NNODE_1D > &)=delete
Broken assignment operator.
unsigned required_nvalue(const unsigned &n) const
Required # of ‘values’ (pinned or dofs) at node n.
void output(std::ostream &outfile)
Output function.
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output function for a time-dependent exact solution at n_plot^2 plot points (calls the steady version...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition: shape.h:76
A class for all isoparametric elements that solve the YoungLaplace equations.
SpineBaseFctPt & spine_base_fct_pt()
Access function to function pointer that specifies spine base vector field.
static double two_norm(const Vector< double > &v)
2-norm of a vector
static void scalar_times_vector(const double &lambda, const Vector< double > &v, Vector< double > &lambda_times_v)
Multiply a vector by a scalar.
void(* SpineBaseFctPt)(const Vector< double > &x, Vector< double > &spine_base, Vector< Vector< double >> &dspine_base)
Function pointer to "spine base" function.
void set_kappa(Data *kappa_pt)
Set curvature data (and add it to the element's external Data)
static double scalar_product(const Vector< double > &v1, const Vector< double > &v2)
Scalar product between two vectors.
double interpolated_u(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output exact soln at n_plot^2 plot points (dummy time-dependent version to keep intel compiler happy)
unsigned self_test()
Self-test: Return 0 for OK.
static void allocate_vector_of_vectors(unsigned n_rows, unsigned n_cols, Vector< Vector< double >> &v)
Helper fct: Allocate storage for a vector of vectors of doubles to v(n_rows,n_cols) and initialise ea...
virtual int u_local_eqn(const unsigned &n)
Get the local equation number of the (one and only) unknown stored at local node n (returns -1 if val...
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln at n_plot^2 plot points.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
SpineFctPt & spine_fct_pt()
Access function to function pointer that specifies spine vector field.
void output(std::ostream &outfile)
Output with default number of plot points.
void exact_position(const Vector< double > &s, Vector< double > &r, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Get exact position vector to meniscus at local coordinate s.
void(* SpineFctPt)(const Vector< double > &x, Vector< double > &spine, Vector< Vector< double >> &dspine)
Function pointer to "spine" function.
YoungLaplaceEquations()
Constructor: Initialise pointers to NULL, so by default prescribed kappa evaluates to zero,...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector.
virtual void get_spine_base(const Vector< double > &x, Vector< double > &spine_base, Vector< Vector< double >> &dspine_base) const
Get spine base vector field: Defaults to standard cartesian representation if no spine base fct point...
virtual double u(const unsigned &n) const
Access function: Nodal function value at local node n Uses suitably interpolated value for hanging no...
double get_kappa() const
Get curvature.
void get_spine(const Vector< double > &x, Vector< double > &spine, Vector< Vector< double >> &dspine) const
Get spine vector field: Defaults to standard cartesian representation if no spine base fct pointers h...
bool use_spines() const
Use spines or not? (Based on availability of function pointers to to spine and spine base vector fiel...
void position(const Vector< double > &s, Vector< double > &r) const
Get position vector to meniscus at local coordinate s.
unsigned Kappa_index
Index of Kappa_pt in the element's storage of external Data.
static void cross_product(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &v_cross)
Cross-product: v_cross= v1 x v2.
Data * Kappa_pt
Pointer to Data item that stores kappa as its first value – private to ensure that it must be set wit...
SpineFctPt Spine_fct_pt
Pointer to spine function:
void operator=(const YoungLaplaceEquations &)=delete
Broken assignment operator.
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: flux[i] = du/dx_i: Mainly used for error estimation.
SpineBaseFctPt Spine_base_fct_pt
Pointer to spine base function:
Data * kappa_pt()
Access function: Pointer Data object that stores kappa (const version – kappa must be set with set_ka...
YoungLaplaceEquations(const YoungLaplaceEquations &dummy)=delete
Broken copy constructor.
static void vector_sum(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &vs)
Vectorial sum of two vectors.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...