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