discontinuous_galerkin_spacetime_fluid_traction_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 elements that are used to integrate fluid tractions
27 // This includes the guts (i.e. equations) because we want to inline them
28 // for faster operation, although it slows down the compilation!
29 #ifndef OOMPH_DISCONTINUOUS_GALERKIN_SPACETIME_FLUID_TRACTION_ELEMENTS_HEADER
30 #define OOMPH_DISCONTINUOUS_GALERKIN_SPACETIME_FLUID_TRACTION_ELEMENTS_HEADER
31 
32 // Config header generated by autoconfig
33 #ifdef HAVE_CONFIG_H
34 #include <oomph-lib-config.h>
35 #endif
36 
37 // OOMPH-LIB headers
38 #include "generic/Qelements.h"
39 #include "generic/Telements.h"
40 
41 namespace oomph
42 {
43  //======================================================================
44  /// A class for elements that allow the imposition of an applied traction
45  /// to the Navier--Stokes equations
46  /// The geometrical information can be read from the FaceGeometry<ELEMENT>
47  /// class and and thus, we can be generic enough without the need to have
48  /// a separate equations class
49  //======================================================================
50  template<class ELEMENT>
51  class NavierStokesSpaceTimeTractionElement
52  : public virtual FaceGeometry<ELEMENT>,
53  public virtual FaceElement
54  {
55  private:
56  /// Pointer to an imposed traction function
57  void (*Traction_fct_pt)(const double& time,
58  const Vector<double>& x,
59  const Vector<double>& n,
60  Vector<double>& result);
61 
62  public:
63  /// Constructor, which takes a "bulk" element and the value of the index
64  /// and its limit
66  FiniteElement* const& element_pt,
67  const int& face_index,
68  const bool& called_from_refineable_constructor = false)
69  : FaceGeometry<ELEMENT>(), FaceElement()
70  {
71  // Attach the geometrical information to the element. N.B. This function
72  // also assigns nbulk_value from the required_nvalue of the bulk element
73  element_pt->build_face_element(face_index, this);
74 
75 #ifdef PARANOID
76  {
77  // Check that the element is not a refineable 3D element
78  if (!called_from_refineable_constructor)
79  {
80  // If it's 3D
81  if (element_pt->dim() == 3)
82  {
83  // Is it refineable
84  RefineableElement* ref_el_pt =
85  dynamic_cast<RefineableElement*>(element_pt);
86 
87  // If the upcast was successful
88  if (ref_el_pt != 0)
89  {
90  // If there are any hanging nodes
91  if (this->has_hanging_nodes())
92  {
93  // Create an output stream
94  std::ostringstream error_message_stream;
95 
96  // Create an error message
97  error_message_stream
98  << "This flux element will not work correctly "
99  << "if nodes are hanging" << std::endl;
100 
101  // Throw the error message
102  throw OomphLibError(error_message_stream.str(),
103  OOMPH_CURRENT_FUNCTION,
104  OOMPH_EXCEPTION_LOCATION);
105  }
106  } // if (ref_el_pt!=0)
107  } // if (element_pt->dim()==3)
108  } // if (!called_from_refineable_constructor)
109  }
110 #endif
111 
112  // Set the body force function pointer to zero
113  Traction_fct_pt = 0;
114 
115  // Set the dimension from the dimension of the first node
116  Dim = this->node_pt(0)->ndim();
117  } // End of NavierStokesSpaceTimeTractionElement
118 
119 
120  /// Destructor should not delete anything
122 
123 
124  /// Access function for the imposed traction pointer
125  void (*&traction_fct_pt())(const double& t,
126  const Vector<double>& x,
127  const Vector<double>& n,
128  Vector<double>& result)
129  {
130  // Return the function pointer
131  return Traction_fct_pt;
132  } // End of traction_fct_pt
133 
134 
135  /// This function returns just the residuals
137  {
138  // Call the generic residuals function with flag set to 0
139  // using a dummy matrix argument
141  residuals, GeneralisedElement::Dummy_matrix, 0);
142  }
143 
144 
145  /// This function returns the residuals and the jacobian
147  DenseMatrix<double>& jacobian)
148  {
149  // Call the generic routine with the flag set to 1
151  residuals, jacobian, 1);
152  }
153 
154 
155  /// Overload the output function
156  void output(std::ostream& outfile)
157  {
158  FiniteElement::output(outfile);
159  }
160 
161 
162  /// Output function: x,y,[z],u,v,[w],p in tecplot format
163  void output(std::ostream& outfile, const unsigned& nplot)
164  {
165  FiniteElement::output(outfile, nplot);
166  }
167 
168  protected:
169  /// This function returns the residuals for the traction function.
170  /// flag=1(or 0): do (or don't) compute the Jacobian as well.
172  Vector<double>& residuals,
173  DenseMatrix<double>& jacobian,
174  const unsigned& flag);
175 
176 
177  /// The "global" intrinsic coordinate of the element when
178  /// viewed as part of a geometric object should be given by
179  /// the FaceSpaceTimeElement representation, by default
180  double zeta_nodal(const unsigned& n,
181  const unsigned& k,
182  const unsigned& i) const
183  {
184  return FaceElement::zeta_nodal(n, k, i);
185  } // End of zeta_nodal
186 
187 
188  /// Access function that returns the local equation numbers
189  /// for velocity components.
190  /// u_local_eqn(n,i)=local equation number or < 0 if pinned.
191  /// The default is to asssume that n is the local node number
192  /// and the i-th velocity component is the i-th unknown stored at the node.
193  virtual inline int u_local_eqn(const unsigned& n, const unsigned& i)
194  {
195  return nodal_local_eqn(n, i);
196  }
197 
198  /// Function to compute the shape and test functions and to return
199  /// the Jacobian of mapping
200  inline double shape_and_test_at_knot(const unsigned& ipt,
201  Shape& psi,
202  Shape& test) const
203  {
204  //--------------------------
205  // Call the shape functions:
206  //--------------------------
207  // Calculate the shape functions
208  shape_at_knot(ipt, psi);
209 
210  //-------------------------
211  // Call the test functions:
212  //-------------------------
213  // Find the dimension of the element
214  const unsigned el_dim = dim();
215 
216  // Storage for the local coordinates of the integration point
217  Vector<double> s(el_dim);
218 
219  // Set the local coordinate
220  for (unsigned i = 0; i < el_dim; i++)
221  {
222  // Get the i-th local coordinate associated with the ipt-th knot point
223  s[i] = integral_pt()->knot(ipt, i);
224  }
225 
226  // Sanity check
227  if (el_dim != 2)
228  {
229  // Throw an error
230  throw OomphLibError(
231  "Can only deal with 2D space-time traction elements!",
232  OOMPH_CURRENT_FUNCTION,
233  OOMPH_EXCEPTION_LOCATION);
234  }
235 
236  //--------start_of_shape------------------------------------------------
237  // Number of nodes in each direction
238  const unsigned nnode_1d = 3;
239 
240  // Local storage
241  double test_values[2][nnode_1d];
242 
243  // Call the OneDimensional shape function (for x or y) with quadratic
244  // interpolation
245  OneDimLagrange::shape<3>(s[0], test_values[0]);
246 
247  // Call the OneDimensional shape function. NOTE: The second local
248  // coordinate will always be time for a space-time element!
249  OneDimDiscontinuousGalerkin::shape<3>(s[1], test_values[1]);
250 
251  // Index for the shape functions
252  unsigned index = 0;
253 
254  // Loop over the first local coordinate direction
255  for (unsigned j = 0; j < nnode_1d; j++)
256  {
257  // Loop over the first local coordinate direction
258  for (unsigned i = 0; i < nnode_1d; i++)
259  {
260  // Multiply the two 1D functions together to get the 2D function
261  test[index] = test_values[0][i] * test_values[1][j];
262 
263  // Increment the index
264  index++;
265  }
266  } // for (unsigned j=0;j<nnode_1d;j++)
267  //--------end_of_shape--------------------------------------------------
268 
269  // Return the value of the jacobian
270  return J_eulerian_at_knot(ipt);
271  } // End of shape_and_test_at_knot
272 
273 
274  /// Function to calculate the traction applied to the fluid
275  void get_traction(const double& time,
276  const Vector<double>& x,
277  const Vector<double>& n,
278  Vector<double>& result)
279  {
280  // If the function pointer is zero return zero
281  if (Traction_fct_pt == 0)
282  {
283  // Loop over the (spatial) dimensions
284  for (unsigned i = 0; i < Dim - 1; i++)
285  {
286  // Set the i-th traction component to zero
287  result[i] = 0.0;
288  }
289  }
290  // If the traction function pointer has been set
291  else
292  {
293  // Call the function pointer
294  (*Traction_fct_pt)(time, x, n, result);
295  } // if (Traction_fct_pt==0)
296  } // End of get_traction
297 
298 
299  /// The highest dimension of the problem
300  unsigned Dim;
301  };
302 
303  /// ////////////////////////////////////////////////////////////////////
304  /// ////////////////////////////////////////////////////////////////////
305  /// ////////////////////////////////////////////////////////////////////
306 
307  //=========================================================================
308  /// Function that returns the residuals for the imposed traction
309  /// Navier-Stokes equations
310  //=========================================================================
311  template<class ELEMENT>
314  Vector<double>& residuals,
315  DenseMatrix<double>& jacobian,
316  const unsigned& flag)
317  {
318  // Find out how many nodes there are
319  unsigned n_node = nnode();
320 
321  // Set up memory for the shape functions
322  Shape psif(n_node);
323 
324  // Set up memory for the test functions
325  Shape testf(n_node);
326 
327  // Number of integration points
328  unsigned n_intpt = integral_pt()->nweight();
329 
330  // Integers to store local equation numbers
331  int local_eqn = 0;
332 
333  // Loop over the integration points
334  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
335  {
336  // Get the integral weight
337  double w = integral_pt()->weight(ipt);
338 
339  // Find the shape and test functions and return the Jacobian
340  // of the mapping
341  double J = shape_and_test_at_knot(ipt, psif, testf);
342 
343  // Premultiply the weights and the Jacobian
344  double W = w * J;
345 
346  // Get continuous time
347  double interpolated_t = 0.0;
348 
349  // Need to find position to feed into traction function
350  Vector<double> interpolated_x(Dim - 1, 0.0);
351 
352  // Allocate space for the outer unit normal
353  Vector<double> interpolated_spacetime_n(Dim, 0.0);
354 
355  // Allocate space for the outer unit normal (in the given time slice)
356  Vector<double> interpolated_n(Dim - 1, 0.0);
357 
358  // Allocate space for the traction vector
359  Vector<double> traction(Dim - 1, 0.0);
360 
361  // Calculate velocities and derivatives
362  for (unsigned l = 0; l < n_node; l++)
363  {
364  // Update the interpolated time value
365  interpolated_t += raw_nodal_position(l, Dim - 1) * psif(l);
366 
367  // Loop over velocity components
368  for (unsigned i = 0; i < Dim - 1; i++)
369  {
370  // Update the i-th interpolated coordinate value
371  interpolated_x[i] += nodal_position(l, i) * psif(l);
372  }
373  } // for (unsigned l=0;l<n_node;l++)
374 
375  // Calculate the outer unit normal
376  outer_unit_normal(ipt, interpolated_spacetime_n);
377 
378 #ifdef PARANOID
379  // Sanity check: Make sure the normal component in the time-direction is
380  // zero. If it isn't then something has gone wrong...
381  if (std::fabs(interpolated_spacetime_n[Dim - 1]) > 1.0e-15)
382  {
383  // Create an output stream
384  std::ostringstream error_message_stream;
385 
386  // Create the error message
387  error_message_stream
388  << "The component of the outer unit normal in the "
389  << "time-direction\nshould be zero but the actual "
390  << "value is: " << interpolated_spacetime_n[Dim - 1] << std::endl;
391 
392  // Throw the error message
393  throw OomphLibError(error_message_stream.str(),
394  OOMPH_CURRENT_FUNCTION,
395  OOMPH_EXCEPTION_LOCATION);
396  }
397 #endif
398 
399  // Loop over spatial coordinates
400  for (unsigned i = 0; i < Dim - 1; i++)
401  {
402  // Copy the i-th normal component over
403  interpolated_n[i] = interpolated_spacetime_n[i];
404  }
405 
406  // Get the user-defined traction
407  get_traction(interpolated_t, interpolated_x, interpolated_n, traction);
408 
409  // Now add to the appropriate equations:
410 
411  // Loop over the test functions
412  for (unsigned l = 0; l < n_node; l++)
413  {
414  // Loop over the velocity components
415  for (unsigned i = 0; i < Dim - 1; i++)
416  {
417  // Get the local equation number associated with this unknown and node
418  local_eqn = u_local_eqn(l, i);
419 
420  // If it's not a boundary condition
421  if (local_eqn >= 0)
422  {
423  // Add the user-defined traction terms
424  residuals[local_eqn] += traction[i] * testf[l] * W;
425 
426  // Assuming the traction DOES NOT depend upon velocities
427  // or pressures, the jacobian is always zero, so no jacobian
428  // terms are required
429  }
430  } // for (unsigned i=0;i<Dim;i++)
431  } // for (unsigned l=0;l<n_node;l++)
432  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
433  } // End of fill_in_generic_residual_contribution_fluid_traction
434 
435  /// //////////////////////////////////////////////////////////////////////
436  /// //////////////////////////////////////////////////////////////////////
437  /// //////////////////////////////////////////////////////////////////////
438 
439  //======================================================================
440  /// A class for elements that allow the imposition of an applied traction
441  /// to the Navier--Stokes equations
442  /// The geometrical information can be read from the FaceGeometry<ELEMENT>
443  /// class and and thus, we can be generic enough without the need to have
444  /// a separate equations class.
445  ///
446  /// THIS IS THE REFINEABLE VERSION.
447  //======================================================================
448  template<class ELEMENT>
449  class RefineableNavierStokesSpaceTimeTractionElement
450  : public virtual NavierStokesSpaceTimeTractionElement<ELEMENT>,
451  public virtual NonRefineableElementWithHangingNodes
452  {
453  public:
454  /// Constructor, which takes a "bulk" element and the face index
456  FiniteElement* const& element_pt, const int& face_index)
457  : // we're calling this from the constructor of the refineable version.
459  element_pt, face_index, true)
460  {
461  }
462 
463 
464  /// Destructor should not delete anything
466 
467 
468  /// Number of continuously interpolated values are the
469  /// same as those in the bulk element.
470  unsigned ncont_interpolated_values() const
471  {
472  return dynamic_cast<ELEMENT*>(this->bulk_element_pt())
474  }
475 
476  /// This function returns just the residuals
478  {
479  // Call the generic residuals function using a dummy matrix argument
481  residuals, GeneralisedElement::Dummy_matrix, 0);
482  }
483 
484  /// This function returns the residuals and the Jacobian
486  DenseMatrix<double>& jacobian)
487  {
488  // Call the generic routine
490  residuals, jacobian, 1);
491  }
492 
493 
494  protected:
495  /// This function returns the residuals for the traction function.
496  /// flag=1(or 0): do (or don't) compute the Jacobian as well.
498  Vector<double>& residuals,
499  DenseMatrix<double>& jacobian,
500  const unsigned& flag);
501  };
502 
503  /// ////////////////////////////////////////////////////////////////////
504  /// ////////////////////////////////////////////////////////////////////
505  /// ////////////////////////////////////////////////////////////////////
506 
507  //============================================================================
508  /// Function that returns the residuals for the imposed traction Navier_Stokes
509  /// equations
510  //============================================================================
511  template<class ELEMENT>
514  Vector<double>& residuals,
515  DenseMatrix<double>& jacobian,
516  const unsigned& flag)
517  {
518  // Get the indices at which the velocity components are stored
519  unsigned u_nodal_index[this->Dim - 1];
520 
521  // Loop over the velocity components
522  for (unsigned i = 0; i < this->Dim - 1; i++)
523  {
524  // Get the i-th velocity component index
525  u_nodal_index[i] =
526  dynamic_cast<ELEMENT*>(this->bulk_element_pt())->u_index_nst(i);
527  }
528 
529  // Find out how many nodes there are
530  unsigned n_node = nnode();
531 
532  // Set up memory for the shape functions
533  Shape psif(n_node);
534 
535  // Set up memory for the test functions
536  Shape testf(n_node);
537 
538  // Number of integration points
539  unsigned n_intpt = integral_pt()->nweight();
540 
541  // Integers to store local equation numbers
542  int local_eqn = 0;
543 
544  // Loop over the integration points
545  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
546  {
547  // Get the integral weight
548  double w = integral_pt()->weight(ipt);
549 
550  // Find the shape and test functions and return the Jacobian
551  // of the mapping
552  double J = this->shape_and_test_at_knot(ipt, psif, testf);
553 
554  // Premultiply the weights and the Jacobian
555  double W = w * J;
556 
557  // Get continuous time
558  double interpolated_t = 0.0;
559 
560  // Need to find position to feed into traction function
561  Vector<double> interpolated_x(this->Dim - 1, 0.0);
562 
563  // Allocate space for the outer unit normal
564  Vector<double> interpolated_spacetime_n(this->Dim, 0.0);
565 
566  // Allocate space for the outer unit normal (in the given time slice)
567  Vector<double> interpolated_n(this->Dim - 1, 0.0);
568 
569  // Allocate space for the traction vector
570  Vector<double> traction(this->Dim - 1, 0.0);
571 
572  // Calculate velocities and derivatives
573  for (unsigned l = 0; l < n_node; l++)
574  {
575  // Update the interpolated time value
576  interpolated_t += raw_nodal_position(l, this->Dim - 1) * psif(l);
577 
578  // Loop over velocity components
579  for (unsigned i = 0; i < this->Dim - 1; i++)
580  {
581  // Update the i-th interpolated coordinate value
582  interpolated_x[i] += this->nodal_position(l, i) * psif(l);
583  }
584  } // for (unsigned l=0;l<n_node;l++)
585 
586  // Calculate the outer unit normal
587  this->outer_unit_normal(ipt, interpolated_spacetime_n);
588 
589 #ifdef PARANOID
590  // Sanity check: Make sure the normal component in the time-direction is
591  // zero. If it isn't then something has gone wrong...
592  if (std::fabs(interpolated_n[this->Dim - 1]) > 1.0e-15)
593  {
594  // Create an output stream
595  std::ostringstream error_message_stream;
596 
597  // Create the error message
598  error_message_stream << "The component of the outer unit normal in the "
599  << "time-direction\nshould be zero but the actual "
600  << "value is: " << interpolated_n[this->Dim - 1]
601  << std::endl;
602 
603  // Throw the error message
604  throw OomphLibError(error_message_stream.str(),
605  OOMPH_CURRENT_FUNCTION,
606  OOMPH_EXCEPTION_LOCATION);
607  }
608 #endif
609 
610  // Loop over spatial coordinates
611  for (unsigned i = 0; i < this->Dim - 1; i++)
612  {
613  // Copy the i-th normal component over
614  interpolated_n[i] = interpolated_spacetime_n[i];
615  }
616 
617  // Get the user-defined traction
618  this->get_traction(
619  interpolated_t, interpolated_x, interpolated_n, traction);
620 
621  // Now add to the appropriate equations:
622 
623  // Number of master nodes and storage for the weight of the shape function
624  unsigned n_master = 1;
625 
626  // The weight of the shape function
627  double hang_weight = 1.0;
628 
629  // Pointer to hang info object
630  HangInfo* hang_info_pt = 0;
631 
632  // Loop over the nodes for the test functions/equations
633  //-----------------------------------------------------
634  for (unsigned l = 0; l < n_node; l++)
635  {
636  // Local boolean to indicate whether the node is hanging
637  bool is_node_hanging = this->node_pt(l)->is_hanging();
638 
639  // If the node is hanging
640  if (is_node_hanging)
641  {
642  // Get the HangInfo pointer associated with this hanging node
643  hang_info_pt = this->node_pt(l)->hanging_pt();
644 
645  // Read out number of master nodes from hanging data
646  n_master = hang_info_pt->nmaster();
647  }
648  // Otherwise the node is its own master
649  else
650  {
651  // If it's not hanging then it is its (one and only) master node
652  n_master = 1;
653  }
654 
655  // Loop over the master nodes
656  for (unsigned m = 0; m < n_master; m++)
657  {
658  // Loop over velocity components for equations
659  for (unsigned i = 0; i < this->Dim - 1; i++)
660  {
661  // Get the equation number:
662 
663  // If the node is hanging
664  if (is_node_hanging)
665  {
666  // Get the equation number from the master node
667  local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
668  u_nodal_index[i]);
669 
670  // Get the hang weight from the master node
671  hang_weight = hang_info_pt->master_weight(m);
672  }
673  // If the node is not hanging
674  else
675  {
676  // Local equation number
677  local_eqn = this->nodal_local_eqn(l, u_nodal_index[i]);
678 
679  // Node contributes with full weight
680  hang_weight = 1.0;
681  }
682 
683  // If it's not a boundary condition...
684  if (local_eqn >= 0)
685  {
686  // Add the user-defined traction terms
687  residuals[local_eqn] += traction[i] * testf[l] * W * hang_weight;
688 
689  // Assuming the the traction DOES NOT depend upon velocities
690  // or pressures, the jacobian is always zero, so no jacobian
691  // terms are required.
692  }
693  } // for (unsigned i=0;i<this->Dim-1;i++)
694  } // for (unsigned m=0;m<n_master;m++)
695  } // for (unsigned l=0;l<n_node;l++)
696  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
697  } // End of refineable_fill_in_generic_residual_contribution_fluid_traction
698 } // End of namespace oomph
699 
700 #endif
static char t char * s
Definition: cfortran.h:568
cstr elem_len * i
Definition: cfortran.h:603
char t
Definition: cfortran.h:568
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
Definition: elements.h:4338
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
Definition: elements.h:4626
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
Definition: elements.h:4497
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
Definition: elements.h:4735
double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point O...
Definition: elements.cc:5328
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition: elements.h:4998
A general Finite Element class.
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)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
Definition: elements.h:3050
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 dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
Definition: elements.h:2611
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement....
Definition: elements.cc:5132
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
Definition: elements.h:2218
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
Definition: elements.cc:3220
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
Definition: elements.h:2470
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
Definition: elements.h:227
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
A class for elements that allow the imposition of an applied traction to the Navier–Stokes equations ...
virtual int u_local_eqn(const unsigned &n, const unsigned &i)
Access function that returns the local equation numbers for velocity components. u_local_eqn(n,...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
NavierStokesSpaceTimeTractionElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
Constructor, which takes a "bulk" element and the value of the index and its limit.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
double shape_and_test_at_knot(const unsigned &ipt, Shape &psi, Shape &test) const
Function to compute the shape and test functions and to return the Jacobian of mapping.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the jacobian.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
void fill_in_generic_residual_contribution_fluid_traction(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
This function returns the residuals for the traction function. flag=1(or 0): do (or don't) compute th...
void(* Traction_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Pointer to an imposed traction function.
void get_traction(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Function to calculate the traction applied to the fluid.
void(*&)(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &result) traction_fct_pt()
Access function for the imposed traction pointer.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the Jacobian.
RefineableNavierStokesSpaceTimeTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the face index.
void refineable_fill_in_generic_residual_contribution_fluid_traction(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
This function returns the residuals for the traction function. flag=1(or 0): do (or don't) compute th...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values are the same as those in the bulk element.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition: shape.h:76
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in ...
Definition: multi_domain.cc:60
void shape< 3 >(const double &s, double *Psi)
1D shape functions specialised to quadratic order (3 Nodes)
Definition: shape.h:810
void shape< 3 >(const double &s, double *Psi)
1D shape functions specialised to quadratic order (3 Nodes)
Definition: shape.h:635
//////////////////////////////////////////////////////////////////// ////////////////////////////////...