generalised_newtonian_Tnavier_stokes_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-2026 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 triangular/tetrahedaral Navier Stokes elements
27
28#ifndef OOMPH_GENERALISED_NEWTONIAN_TNAVIER_STOKES_ELEMENTS_HEADER
29#define OOMPH_GENERALISED_NEWTONIAN_TNAVIER_STOKES_ELEMENTS_HEADER
30
31// Config header
32#ifdef HAVE_CONFIG_H
33#include <oomph-lib-config.h>
34#endif
35
36
37// OOMPH-LIB headers
38#include "generic/Telements.h"
41
42namespace oomph
43{
44 //////////////////////////////////////////////////////////////////////////////
45 //////////////////////////////////////////////////////////////////////////////
46 // NOTE: TRI/TET CROZIER RAVIARTS REQUIRE BUBBLE FUNCTIONS! THEY'RE NOT
47 // STRAIGHTFORWARD GENERALISATIONS OF THE Q-EQUIVALENTS (WHICH ARE
48 // LBB UNSTABLE!)
49 //////////////////////////////////////////////////////////////////////////////
50 //////////////////////////////////////////////////////////////////////////////
51
52
53 //==========================================================================
54 /// TCrouzeix_Raviart elements are Navier--Stokes elements with quadratic
55 /// interpolation for velocities and positions enriched by a single cubic
56 /// bubble function, but a discontinuous linear
57 /// pressure interpolation
58 //==========================================================================
59 template<unsigned DIM>
61 : public virtual TBubbleEnrichedElement<DIM, 3>,
63 public virtual ElementWithZ2ErrorEstimator
64 {
65 protected:
66 /// Internal index that indicates at which internal datum the pressure is
67 /// stored
69
70
71 /// Velocity shape and test functions and their derivs
72 /// w.r.t. to global coords at local coordinate s (taken from geometry)
73 /// Return Jacobian of mapping between local and global coordinates.
75 Shape& psi,
77 Shape& test,
78 DShape& dtestdx) const;
79
80 /// Velocity shape and test functions and their derivs
81 /// w.r.t. to global coords at ipt-th integation point (taken from geometry)
82 /// Return Jacobian of mapping between local and global coordinates.
83 inline double dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
84 Shape& psi,
86 Shape& test,
87 DShape& dtestdx) const;
88
89 /// Shape/test functions and derivs w.r.t. to global coords at
90 /// integration point ipt; return Jacobian of mapping (J). Also compute
91 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
93 const unsigned& ipt,
94 Shape& psi,
97 Shape& test,
101
102 /// Pressure shape and test functions and their derivs
103 /// w.r.t. to global coords at local coordinate s (taken from geometry)
104 /// Return Jacobian of mapping between local and global coordinates.
106 Shape& ppsi,
108 Shape& ptest,
109 DShape& dptestdx) const;
110
111 public:
112 /// Pressure shape functions at local coordinate s
113 inline void pshape_nst(const Vector<double>& s, Shape& psi) const;
114
115 /// Pressure shape and test functions at local coordinte s
116 inline void pshape_nst(const Vector<double>& s,
117 Shape& psi,
118 Shape& test) const;
119
120 /// Unpin all internal pressure dofs
122
123 /// Return the local equation numbers for the pressure values.
124 inline int p_local_eqn(const unsigned& n) const
125 {
126 return this->internal_local_eqn(P_nst_internal_index, n);
127 }
128
129 public:
130 /// Constructor, there are DIM+1 internal values (for the pressure)
134 {
135 // Allocate and a single internal datum with DIM+1 entries for the
136 // pressure
138 }
139
140 /// Broken copy constructor
143
144 /// Broken assignment operator
145 // Commented out broken assignment operator because this can lead to a
146 // conflict warning when used in the virtual inheritence hierarchy.
147 // Essentially the compiler doesn't realise that two separate
148 // implementations of the broken function are the same and so, quite
149 // rightly, it shouts.
150 /*void operator=(const GeneralisedNewtonianTCrouzeixRaviartElement<DIM>&) =
151 delete;*/
152
153
154 /// Number of values (pinned or dofs) required at local node n.
155 inline virtual unsigned required_nvalue(const unsigned& n) const
156 {
157 return DIM;
158 }
159
160
161 /// Return the pressure values at internal dof i_internal
162 /// (Discontinous pressure interpolation -- no need to cater for hanging
163 /// nodes).
164 double p_nst(const unsigned& i) const
165 {
166 return this->internal_data_pt(P_nst_internal_index)->value(i);
167 }
168
169 /// Return the pressure values at internal dof i_internal
170 /// (Discontinous pressure interpolation -- no need to cater for hanging
171 /// nodes).
172 double p_nst(const unsigned& t, const unsigned& i) const
173 {
174 return this->internal_data_pt(P_nst_internal_index)->value(t, i);
175 }
176
177 /// Return number of pressure values
178 unsigned npres_nst() const
179 {
180 return DIM + 1;
181 }
182
183 /// Pin p_dof-th pressure dof and set it to value specified by p_value.
184 void fix_pressure(const unsigned& p_dof, const double& p_value)
185 {
186 this->internal_data_pt(P_nst_internal_index)->pin(p_dof);
187 this->internal_data_pt(P_nst_internal_index)->set_value(p_dof, p_value);
188 }
189
190
191 /// Add to the set paired_load_data
192 /// pairs of pointers to data objects and unsignedegers that
193 /// index the values in the data object that affect the load (traction),
194 /// as specified in the get_load() function.
196 std::set<std::pair<Data*, unsigned>>& paired_load_data);
197
198 /// Add to the set \c paired_pressure_data pairs
199 /// containing
200 /// - the pointer to a Data object
201 /// and
202 /// - the index of the value in that Data object
203 /// .
204 /// for all pressure values that affect the
205 /// load computed in the \c get_load(...) function.
207 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
208
209 /// Redirect output to NavierStokesEquations output
214
215 /// Redirect output to NavierStokesEquations output
216 void output(std::ostream& outfile, const unsigned& nplot)
217 {
219 }
220
221 /// Redirect output to NavierStokesEquations output
226
227 /// Redirect output to NavierStokesEquations output
232
233
234 /// Order of recovery shape functions for Z2 error estimation:
235 /// Same order as unenriched shape functions.
237 {
238 return 2;
239 }
240
241 /// Number of vertex nodes in the element
242 unsigned nvertex_node() const
243 {
244 return DIM + 1;
245 }
246
247 /// Pointer to the j-th vertex node in the element
248 Node* vertex_node_pt(const unsigned& j) const
249 {
250 return node_pt(j);
251 }
252
253 /// Number of 'flux' terms for Z2 error estimation
255 {
256 // DIM diagonal strain rates, DIM(DIM -1) /2 off diagonal rates
257 return DIM + (DIM * (DIM - 1)) / 2;
258 }
259
260 /// Get 'flux' for Z2 error recovery: Upper triangular entries
261 /// in strain rate tensor.
263 {
264#ifdef PARANOID
265 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
266 if (flux.size() < num_entries)
267 {
268 std::ostringstream error_message;
269 error_message << "The flux vector has the wrong number of entries, "
270 << flux.size() << ", whereas it should be at least "
271 << num_entries << std::endl;
272 throw OomphLibError(error_message.str(),
275 }
276#endif
277
278 // Get strain rate matrix
280 this->strain_rate(s, strainrate);
281
282 // Pack into flux Vector
283 unsigned icount = 0;
284
285 // Start with diagonal terms
286 for (unsigned i = 0; i < DIM; i++)
287 {
288 flux[icount] = strainrate(i, i);
289 icount++;
290 }
291
292 // Off diagonals row by row
293 for (unsigned i = 0; i < DIM; i++)
294 {
295 for (unsigned j = i + 1; j < DIM; j++)
296 {
297 flux[icount] = strainrate(i, j);
298 icount++;
299 }
300 }
301 }
302
303
304 /// Full output function:
305 /// x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation
306 /// in tecplot format. Default number of plot points
311
312 /// Full output function:
313 /// x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation
314 /// in tecplot format. nplot points in each coordinate direction
315 void full_output(std::ostream& outfile, const unsigned& nplot)
316 {
318 nplot);
319 }
320
321 /// The number of "DOF types" that degrees of freedom in this element
322 /// are sub-divided into: Velocity and pressure.
323 unsigned ndof_types() const
324 {
325 return DIM + 1;
326 }
327
328 /// Create a list of pairs for all unknowns in this element,
329 /// so that the first entry in each pair contains the global equation
330 /// number of the unknown, while the second one contains the number
331 /// of the "DOF types" that this unknown is associated with.
332 /// (Function can obviously only be called if the equation numbering
333 /// scheme has been set up.) Velocity=0; Pressure=1
335 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const;
336 };
337
338 // Inline functions
339
340 //=======================================================================
341 /// Derivatives of the shape functions and test functions w.r.t. to global
342 /// (Eulerian) coordinates. Return Jacobian of mapping between
343 /// local and global coordinates.
344 //=======================================================================
345 template<unsigned DIM>
346 inline double GeneralisedNewtonianTCrouzeixRaviartElement<
347 DIM>::dshape_and_dtest_eulerian_nst(const Vector<double>& s,
348 Shape& psi,
349 DShape& dpsidx,
350 Shape& test,
351 DShape& dtestdx) const
352 {
353 // Call the geometrical shape functions and derivatives
354 double J = this->dshape_eulerian(s, psi, dpsidx);
355 // The test functions are equal to the shape functions
356 test.shallow_copy_from(psi);
357 dtestdx.shallow_copy_from(dpsidx);
358 // Return the jacobian
359 return J;
360 }
361
362
363 //=======================================================================
364 /// Derivatives of the shape functions and test functions w.r.t. to global
365 /// (Eulerian) coordinates. Return Jacobian of mapping between
366 /// local and global coordinates.
367 //=======================================================================
368 template<unsigned DIM>
370 DIM>::dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
371 Shape& psi,
372 DShape& dpsidx,
373 Shape& test,
374 DShape& dtestdx) const
375 {
376 // Call the geometrical shape functions and derivatives
377 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
378 // The test functions are the shape functions
379 test.shallow_copy_from(psi);
380 dtestdx.shallow_copy_from(dpsidx);
381 // Return the jacobian
382 return J;
383 }
384
385
386 //=======================================================================
387 /// 2D
388 /// Define the shape functions (psi) and test functions (test) and
389 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
390 /// and return Jacobian of mapping (J). Additionally compute the
391 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
392 ///
393 /// Galerkin: Test functions = shape functions
394 //=======================================================================
395 template<unsigned DIM>
398 const unsigned& ipt,
399 Shape& psi,
400 DShape& dpsidx,
402 Shape& test,
406 {
407 // Call the geometrical shape functions and derivatives
408 const double J = this->dshape_eulerian_at_knot(
410
411 // Set the test functions equal to the shape functions
412 test.shallow_copy_from(psi);
413 dtestdx.shallow_copy_from(dpsidx);
414 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
415
416 // Return the jacobian
417 return J;
418 }
419
420
421 //=======================================================================
422 /// 2D :
423 /// Pressure shape functions
424 //=======================================================================
425 template<>
427 const Vector<double>& s, Shape& psi) const
428 {
429 psi[0] = 1.0;
430 psi[1] = s[0];
431 psi[2] = s[1];
432 }
433
434 //=======================================================================
435 /// Pressure shape and test functions
436 //=======================================================================
437 template<>
439 const Vector<double>& s, Shape& psi, Shape& test) const
440 {
441 // Call the pressure shape functions
442 this->pshape_nst(s, psi);
443 // The test functions are the shape functions
444 test.shallow_copy_from(psi);
445 }
446
447
448 //=======================================================================
449 /// 3D :
450 /// Pressure shape functions
451 //=======================================================================
452 template<>
454 const Vector<double>& s, Shape& psi) const
455 {
456 psi[0] = 1.0;
457 psi[1] = s[0];
458 psi[2] = s[1];
459 psi[3] = s[2];
460 }
461
462
463 //=======================================================================
464 /// Pressure shape and test functions
465 //=======================================================================
466 template<>
468 const Vector<double>& s, Shape& psi, Shape& test) const
469 {
470 // Call the pressure shape functions
471 this->pshape_nst(s, psi);
472 // The test functions are the shape functions
473 test.shallow_copy_from(psi);
474 }
475
476
477 //==========================================================================
478 /// 2D :
479 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
480 /// Return Jacobian of mapping between local and global coordinates.
481 //==========================================================================
482 template<>
484 2>::dpshape_and_dptest_eulerian_nst(const Vector<double>& s,
485 Shape& ppsi,
487 Shape& ptest,
488 DShape& dptestdx) const
489 {
490 // Initalise with shape fcts and derivs. w.r.t. to local coordinates
491 ppsi[0] = 1.0;
492 ppsi[1] = s[0];
493 ppsi[2] = s[1];
494
495 dppsidx(0, 0) = 0.0;
496 dppsidx(1, 0) = 1.0;
497 dppsidx(2, 0) = 0.0;
498
499 dppsidx(0, 1) = 0.0;
500 dppsidx(1, 1) = 0.0;
501 dppsidx(2, 1) = 1.0;
502
503
504 // Get the values of the shape functions and their local derivatives
505 Shape psi(7);
506 DShape dpsi(7, 2);
507 dshape_local(s, psi, dpsi);
508
509 // Allocate memory for the inverse 2x2 jacobian
511
512 // Now calculate the inverse jacobian
513 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
514
515 // Now set the values of the derivatives to be derivs w.r.t. to the
516 // Eulerian coordinates
517 transform_derivatives(inverse_jacobian, dppsidx);
518
519 // The test functions are equal to the shape functions
520 ptest.shallow_copy_from(ppsi);
521 dptestdx.shallow_copy_from(dppsidx);
522
523 // Return the determinant of the jacobian
524 return det;
525 }
526
527
528 //==========================================================================
529 /// 3D :
530 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
531 /// Return Jacobian of mapping between local and global coordinates.
532 //==========================================================================
533 template<>
535 3>::dpshape_and_dptest_eulerian_nst(const Vector<double>& s,
536 Shape& ppsi,
538 Shape& ptest,
539 DShape& dptestdx) const
540 {
541 // Initalise with shape fcts and derivs. w.r.t. to local coordinates
542 ppsi[0] = 1.0;
543 ppsi[1] = s[0];
544 ppsi[2] = s[1];
545 ppsi[3] = s[2];
546
547 dppsidx(0, 0) = 0.0;
548 dppsidx(1, 0) = 1.0;
549 dppsidx(2, 0) = 0.0;
550 dppsidx(3, 0) = 0.0;
551
552 dppsidx(0, 1) = 0.0;
553 dppsidx(1, 1) = 0.0;
554 dppsidx(2, 1) = 1.0;
555 dppsidx(3, 1) = 0.0;
556
557 dppsidx(0, 2) = 0.0;
558 dppsidx(1, 2) = 0.0;
559 dppsidx(2, 2) = 0.0;
560 dppsidx(3, 2) = 1.0;
561
562
563 // Get the values of the shape functions and their local derivatives
564 Shape psi(11);
565 DShape dpsi(11, 3);
566 dshape_local(s, psi, dpsi);
567
568 // Allocate memory for the inverse 3x3 jacobian
570
571 // Now calculate the inverse jacobian
572 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
573
574 // Now set the values of the derivatives to be derivs w.r.t. to the
575 // Eulerian coordinates
576 transform_derivatives(inverse_jacobian, dppsidx);
577
578 // The test functions are equal to the shape functions
579 ptest.shallow_copy_from(ppsi);
580 dptestdx.shallow_copy_from(dppsidx);
581
582 // Return the determinant of the jacobian
583 return det;
584 }
585
586
587 //=======================================================================
588 /// Face geometry of the 2D Crouzeix_Raviart elements
589 //=======================================================================
590 template<>
592 : public virtual TElement<1, 3>
593 {
594 public:
595 FaceGeometry() : TElement<1, 3>() {}
596 };
597
598 //=======================================================================
599 /// Face geometry of the 3D Crouzeix_Raviart elements
600 //=======================================================================
601 template<>
603 : public virtual TBubbleEnrichedElement<2, 3>
604 {
605 public:
607 };
608
609
610 //=======================================================================
611 /// Face geometry of the FaceGeometry of the 2D CrouzeixRaviart elements
612 //=======================================================================
613 template<>
616 : public virtual PointElement
617 {
618 public:
620 };
621
622
623 //=======================================================================
624 /// Face geometry of the FaceGeometry of the 3D Crouzeix_Raviart elements
625 //=======================================================================
626 template<>
629 : public virtual TElement<1, 3>
630 {
631 public:
632 FaceGeometry() : TElement<1, 3>() {}
633 };
634
635
636 //=============================================================================
637 /// Create a list of pairs for all unknowns in this element,
638 /// so that the first entry in each pair contains the global equation
639 /// number of the unknown, while the second one contains the number
640 /// of the DOF that this unknown is associated with.
641 /// (Function can obviously only be called if the equation numbering
642 /// scheme has been set up.)
643 //=============================================================================
644 template<unsigned DIM>
647 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
648 {
649 // number of nodes
650 unsigned n_node = this->nnode();
651
652 // number of pressure values
653 unsigned n_press = this->npres_nst();
654
655 // temporary pair (used to store dof lookup prior to being added to list)
656 std::pair<unsigned, unsigned> dof_lookup;
657
658 // pressure dof number
659 unsigned pressure_dof_number = DIM;
660
661 // loop over the pressure values
662 for (unsigned n = 0; n < n_press; n++)
663 {
664 // determine local eqn number
665 int local_eqn_number = this->p_local_eqn(n);
666
667 // ignore pinned values - far away degrees of freedom resulting
668 // from hanging nodes can be ignored since these are be dealt
669 // with by the element containing their master nodes
670 if (local_eqn_number >= 0)
671 {
672 // store dof lookup in temporary pair: First entry in pair
673 // is global equation number; second entry is dof type
674 dof_lookup.first = this->eqn_number(local_eqn_number);
676
677 // add to list
678 dof_lookup_list.push_front(dof_lookup);
679 }
680 }
681
682 // loop over the nodes
683 for (unsigned n = 0; n < n_node; n++)
684 {
685 // find the number of values at this node
686 unsigned nv = this->node_pt(n)->nvalue();
687
688 // loop over these values
689 for (unsigned v = 0; v < nv; v++)
690 {
691 // determine local eqn number
692 int local_eqn_number = this->nodal_local_eqn(n, v);
693
694 // ignore pinned values
695 if (local_eqn_number >= 0)
696 {
697 // store dof lookup in temporary pair: First entry in pair
698 // is global equation number; second entry is dof type
699 dof_lookup.first = this->eqn_number(local_eqn_number);
700 dof_lookup.second = v;
701
702 // add to list
703 dof_lookup_list.push_front(dof_lookup);
704 }
705 }
706 }
707 }
708
709 ////////////////////////////////////////////////////////////////////////////
710 ////////////////////////////////////////////////////////////////////////////
711 ////////////////////////////////////////////////////////////////////////////
712
713
714 //=======================================================================
715 /// Taylor--Hood elements are Navier--Stokes elements
716 /// with quadratic interpolation for velocities and positions and
717 /// continous linear pressure interpolation
718 //=======================================================================
719 template<unsigned DIM>
721 : public virtual TElement<DIM, 3>,
723 public virtual ElementWithZ2ErrorEstimator
724
725 {
726 private:
727 /// Static array of ints to hold number of variables at node
728 static const unsigned Initial_Nvalue[];
729
730 protected:
731 /// Static array of ints to hold conversion from pressure
732 /// node numbers to actual node numbers
733 static const unsigned Pconv[];
734
735 /// Velocity shape and test functions and their derivs
736 /// w.r.t. to global coords at local coordinate s (taken from geometry)
737 /// Return Jacobian of mapping between local and global coordinates.
739 Shape& psi,
740 DShape& dpsidx,
741 Shape& test,
742 DShape& dtestdx) const;
743
744 /// Velocity shape and test functions and their derivs
745 /// w.r.t. to global coords at local coordinate s (taken from geometry)
746 /// Return Jacobian of mapping between local and global coordinates.
747 inline double dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
748 Shape& psi,
749 DShape& dpsidx,
750 Shape& test,
751 DShape& dtestdx) const;
752
753 /// Shape/test functions and derivs w.r.t. to global coords at
754 /// integration point ipt; return Jacobian of mapping (J). Also compute
755 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
757 const unsigned& ipt,
758 Shape& psi,
759 DShape& dpsidx,
761 Shape& test,
765
766 /// Compute the pressure shape and test functions and derivatives
767 /// w.r.t. global coords at local coordinate s.
768 /// Return Jacobian of mapping between local and global coordinates.
770 Shape& ppsi,
772 Shape& ptest,
773 DShape& dptestdx) const;
774
775 /// Unpin all pressure dofs
777
778 /// Pin all nodal pressure dofs
780
781 /// Unpin the proper nodal pressure dofs
783
784
785 public:
786 /// Constructor, no internal data points
791
792
793 /// Broken copy constructor
796
797 /// Broken assignment operator
798 /*void operator=(const GeneralisedNewtonianTTaylorHoodElement<DIM>&) =
799 delete;*/
800
801 /// Number of values (pinned or dofs) required at node n. Can
802 /// be overwritten for hanging node version
803 inline virtual unsigned required_nvalue(const unsigned& n) const
804 {
805 return Initial_Nvalue[n];
806 }
807
808 /// Test whether the pressure dof p_dof hanging or not?
809 // bool pressure_dof_is_hanging(const unsigned& p_dof)
810 // {return this->node_pt(Pconv[p_dof])->is_hanging(DIM);}
811
812
813 /// Pressure shape functions at local coordinate s
814 inline void pshape_nst(const Vector<double>& s, Shape& psi) const;
815
816 /// Pressure shape and test functions at local coordinte s
817 inline void pshape_nst(const Vector<double>& s,
818 Shape& psi,
819 Shape& test) const;
820
821 /// Which nodal value represents the pressure?
822 unsigned p_index_nst()
823 {
824 return DIM;
825 }
826
827 /// Pointer to n_p-th pressure node
828 // Node* pressure_node_pt(const unsigned &n_p)
829 //{return this->Node_pt[Pconv[n_p]];}
830
831 /// Return the local equation numbers for the pressure values.
832 inline int p_local_eqn(const unsigned& n) const
833 {
834 return this->nodal_local_eqn(Pconv[n], DIM);
835 }
836
837 /// Access function for the pressure values at local pressure
838 /// node n_p (const version)
839 double p_nst(const unsigned& n_p) const
840 {
841 return this->nodal_value(Pconv[n_p], DIM);
842 }
843
844 /// Access function for the pressure values at local pressure
845 /// node n_p (const version)
846 double p_nst(const unsigned& t, const unsigned& n_p) const
847 {
848 return this->nodal_value(t, Pconv[n_p], DIM);
849 }
850
851 /// Set the value at which the pressure is stored in the nodes
853 {
854 return static_cast<int>(DIM);
855 }
856
857 /// Return number of pressure values
858 unsigned npres_nst() const;
859
860 /// Pin p_dof-th pressure dof and set it to value specified by p_value.
861 void fix_pressure(const unsigned& p_dof, const double& p_value)
862 {
863 this->node_pt(Pconv[p_dof])->pin(DIM);
864 this->node_pt(Pconv[p_dof])->set_value(DIM, p_value);
865 }
866
867
868 /// Add to the set \c paired_load_data pairs containing
869 /// - the pointer to a Data object
870 /// and
871 /// - the index of the value in that Data object
872 /// .
873 /// for all values (pressures, velocities) that affect the
874 /// load computed in the \c get_load(...) function.
876 std::set<std::pair<Data*, unsigned>>& paired_load_data);
877
878 /// Add to the set \c paired_pressure_data pairs
879 /// containing
880 /// - the pointer to a Data object
881 /// and
882 /// - the index of the value in that Data object
883 /// .
884 /// for all pressure values that affect the
885 /// load computed in the \c get_load(...) function.
887 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
888
889 /// Redirect output to NavierStokesEquations output
894
895 /// Redirect output to NavierStokesEquations output
896 void output(std::ostream& outfile, const unsigned& nplot)
897 {
899 }
900
901 /// Redirect output to NavierStokesEquations output
906
907 /// Redirect output to NavierStokesEquations output
912
913 /// Order of recovery shape functions for Z2 error estimation:
914 /// Same order as shape functions.
916 {
917 return 2;
918 }
919
920 /// Number of vertex nodes in the element
921 unsigned nvertex_node() const
922 {
923 return DIM + 1;
924 }
925
926 /// Pointer to the j-th vertex node in the element
927 Node* vertex_node_pt(const unsigned& j) const
928 {
929 return node_pt(j);
930 }
931
932
933 /// Number of 'flux' terms for Z2 error estimation
935 {
936 // DIM diagonal strain rates, DIM(DIM -1) /2 off diagonal rates
937 return DIM + (DIM * (DIM - 1)) / 2;
938 }
939
940 /// Get 'flux' for Z2 error recovery: Upper triangular entries
941 /// in strain rate tensor.
943 {
944#ifdef PARANOID
945 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
946 if (flux.size() < num_entries)
947 {
948 std::ostringstream error_message;
949 error_message << "The flux vector has the wrong number of entries, "
950 << flux.size() << ", whereas it should be at least "
951 << num_entries << std::endl;
952 throw OomphLibError(error_message.str(),
955 }
956#endif
957
958 // Get strain rate matrix
960 this->strain_rate(s, strainrate);
961
962 // Pack into flux Vector
963 unsigned icount = 0;
964
965 // Start with diagonal terms
966 for (unsigned i = 0; i < DIM; i++)
967 {
968 flux[icount] = strainrate(i, i);
969 icount++;
970 }
971
972 // Off diagonals row by row
973 for (unsigned i = 0; i < DIM; i++)
974 {
975 for (unsigned j = i + 1; j < DIM; j++)
976 {
977 flux[icount] = strainrate(i, j);
978 icount++;
979 }
980 }
981 }
982
983 /// The number of "DOF types" that degrees of freedom in this element
984 /// are sub-divided into: Velocity and pressure.
985 unsigned ndof_types() const
986 {
987 return DIM + 1;
988 }
989
990 /// Create a list of pairs for all unknowns in this element,
991 /// so that the first entry in each pair contains the global equation
992 /// number of the unknown, while the second one contains the number
993 /// of the "DOF type" that this unknown is associated with.
994 /// (Function can obviously only be called if the equation numbering
995 /// scheme has been set up.) Velocity=0; Pressure=1
997 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
998 {
999 // number of nodes
1000 unsigned n_node = this->nnode();
1001
1002 // temporary pair (used to store dof lookup prior to being added to list)
1003 std::pair<unsigned, unsigned> dof_lookup;
1004
1005 // loop over the nodes
1006 for (unsigned n = 0; n < n_node; n++)
1007 {
1008 // find the number of Navier Stokes values at this node
1009 unsigned nv = this->required_nvalue(n);
1010
1011 // loop over these values
1012 for (unsigned v = 0; v < nv; v++)
1013 {
1014 // determine local eqn number
1015 int local_eqn_number = this->nodal_local_eqn(n, v);
1016
1017 // ignore pinned values - far away degrees of freedom resulting
1018 // from hanging nodes can be ignored since these are be dealt
1019 // with by the element containing their master nodes
1020 if (local_eqn_number >= 0)
1021 {
1022 // store dof lookup in temporary pair: Global equation number
1023 // is the first entry in pair
1024 dof_lookup.first = this->eqn_number(local_eqn_number);
1025
1026 // set dof numbers: Dof number is the second entry in pair
1027 dof_lookup.second = v;
1028
1029 // add to list
1030 dof_lookup_list.push_front(dof_lookup);
1031 }
1032 }
1033 }
1034 }
1035 };
1036
1037
1038 // Inline functions
1039
1040 //==========================================================================
1041 /// 2D :
1042 /// Number of pressure values
1043 //==========================================================================
1044 template<>
1046 {
1047 return 3;
1048 }
1049
1050 //==========================================================================
1051 /// 3D :
1052 /// Number of pressure values
1053 //==========================================================================
1054 template<>
1056 {
1057 return 4;
1058 }
1059
1060
1061 //==========================================================================
1062 /// 2D :
1063 /// Derivatives of the shape functions and test functions w.r.t to
1064 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1065 /// local and global coordinates.
1066 //==========================================================================
1067 template<unsigned DIM>
1069 DIM>::dshape_and_dtest_eulerian_nst(const Vector<double>& s,
1070 Shape& psi,
1071 DShape& dpsidx,
1072 Shape& test,
1073 DShape& dtestdx) const
1074 {
1075 // Call the geometrical shape functions and derivatives
1076 double J = this->dshape_eulerian(s, psi, dpsidx);
1077 // Test functions are the shape functions
1078 test.shallow_copy_from(psi);
1079 dtestdx.shallow_copy_from(dpsidx);
1080 // Return the jacobian
1081 return J;
1082 }
1083
1084
1085 //==========================================================================
1086 /// Derivatives of the shape functions and test functions w.r.t to
1087 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1088 /// local and global coordinates.
1089 //==========================================================================
1090 template<unsigned DIM>
1092 DIM>::dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
1093 Shape& psi,
1094 DShape& dpsidx,
1095 Shape& test,
1096 DShape& dtestdx) const
1097 {
1098 // Call the geometrical shape functions and derivatives
1099 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
1100 // Test functions are the shape functions
1101 test.shallow_copy_from(psi);
1102 dtestdx.shallow_copy_from(dpsidx);
1103 // Return the jacobian
1104 return J;
1105 }
1106
1107 //==========================================================================
1108 /// 2D :
1109 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1110 /// Return Jacobian of mapping between local and global coordinates.
1111 //==========================================================================
1112 template<>
1114 2>::dpshape_and_dptest_eulerian_nst(const Vector<double>& s,
1115 Shape& ppsi,
1116 DShape& dppsidx,
1117 Shape& ptest,
1118 DShape& dptestdx) const
1119 {
1120 ppsi[0] = s[0];
1121 ppsi[1] = s[1];
1122 ppsi[2] = 1.0 - s[0] - s[1];
1123
1124 dppsidx(0, 0) = 1.0;
1125 dppsidx(0, 1) = 0.0;
1126
1127 dppsidx(1, 0) = 0.0;
1128 dppsidx(1, 1) = 1.0;
1129
1130 dppsidx(2, 0) = -1.0;
1131 dppsidx(2, 1) = -1.0;
1132
1133 // Allocate memory for the inverse 2x2 jacobian
1135
1136
1137 // Get the values of the shape functions and their local derivatives
1138 Shape psi(6);
1139 DShape dpsi(6, 2);
1140 dshape_local(s, psi, dpsi);
1141
1142 // Now calculate the inverse jacobian
1143 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
1144
1145 // Now set the values of the derivatives to be derivs w.r.t. to the
1146 // Eulerian coordinates
1147 transform_derivatives(inverse_jacobian, dppsidx);
1148
1149 // Test functions are shape functions
1150 ptest.shallow_copy_from(ppsi);
1151 dptestdx.shallow_copy_from(dppsidx);
1152
1153 // Return the determinant of the jacobian
1154 return det;
1155 }
1156
1157
1158 //==========================================================================
1159 /// 3D :
1160 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1161 /// Return Jacobian of mapping between local and global coordinates.
1162 //==========================================================================
1163 template<>
1165 3>::dpshape_and_dptest_eulerian_nst(const Vector<double>& s,
1166 Shape& ppsi,
1167 DShape& dppsidx,
1168 Shape& ptest,
1169 DShape& dptestdx) const
1170 {
1171 ppsi[0] = s[0];
1172 ppsi[1] = s[1];
1173 ppsi[2] = s[2];
1174 ppsi[3] = 1.0 - s[0] - s[1] - s[2];
1175
1176 dppsidx(0, 0) = 1.0;
1177 dppsidx(0, 1) = 0.0;
1178 dppsidx(0, 2) = 0.0;
1179
1180 dppsidx(1, 0) = 0.0;
1181 dppsidx(1, 1) = 1.0;
1182 dppsidx(1, 2) = 0.0;
1183
1184 dppsidx(2, 0) = 0.0;
1185 dppsidx(2, 1) = 0.0;
1186 dppsidx(2, 2) = 1.0;
1187
1188 dppsidx(3, 0) = -1.0;
1189 dppsidx(3, 1) = -1.0;
1190 dppsidx(3, 2) = -1.0;
1191
1192
1193 // Get the values of the shape functions and their local derivatives
1194 Shape psi(10);
1195 DShape dpsi(10, 3);
1196 dshape_local(s, psi, dpsi);
1197
1198 // Allocate memory for the inverse 3x3 jacobian
1200
1201 // Now calculate the inverse jacobian
1202 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
1203
1204 // Now set the values of the derivatives to be derivs w.r.t. to the
1205 // Eulerian coordinates
1206 transform_derivatives(inverse_jacobian, dppsidx);
1207
1208 // Test functions are shape functions
1209 ptest.shallow_copy_from(ppsi);
1210 dptestdx.shallow_copy_from(dppsidx);
1211
1212 // Return the determinant of the jacobian
1213 return det;
1214 }
1215
1216
1217 //==========================================================================
1218 /// 2D :
1219 /// Define the shape functions (psi) and test functions (test) and
1220 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1221 /// and return Jacobian of mapping (J). Additionally compute the
1222 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1223 ///
1224 /// Galerkin: Test functions = shape functions
1225 //==========================================================================
1226 template<>
1229 const unsigned& ipt,
1230 Shape& psi,
1231 DShape& dpsidx,
1233 Shape& test,
1234 DShape& dtestdx,
1237 {
1238 // Call the geometrical shape functions and derivatives
1239 const double J = this->dshape_eulerian_at_knot(
1241
1242
1243 // Set the test functions equal to the shape functions
1244 test.shallow_copy_from(psi);
1245 dtestdx.shallow_copy_from(dpsidx);
1246 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1247
1248 // Return the jacobian
1249 return J;
1250 }
1251
1252
1253 //==========================================================================
1254 /// 3D :
1255 /// Define the shape functions (psi) and test functions (test) and
1256 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1257 /// and return Jacobian of mapping (J). Additionally compute the
1258 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1259 ///
1260 /// Galerkin: Test functions = shape functions
1261 //==========================================================================
1262 template<>
1265 const unsigned& ipt,
1266 Shape& psi,
1267 DShape& dpsidx,
1269 Shape& test,
1270 DShape& dtestdx,
1273 {
1274 // Call the geometrical shape functions and derivatives
1275 const double J = this->dshape_eulerian_at_knot(
1277
1278 // Set the test functions equal to the shape functions
1279 test.shallow_copy_from(psi);
1280 dtestdx.shallow_copy_from(dpsidx);
1281 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1282
1283
1284 // Return the jacobian
1285 return J;
1286 }
1287
1288
1289 //==========================================================================
1290 /// 2D :
1291 /// Pressure shape functions
1292 //==========================================================================
1293 template<>
1295 const Vector<double>& s, Shape& psi) const
1296 {
1297 psi[0] = s[0];
1298 psi[1] = s[1];
1299 psi[2] = 1.0 - s[0] - s[1];
1300 }
1301
1302 //==========================================================================
1303 /// 3D :
1304 /// Pressure shape functions
1305 //==========================================================================
1306 template<>
1308 const Vector<double>& s, Shape& psi) const
1309 {
1310 psi[0] = s[0];
1311 psi[1] = s[1];
1312 psi[2] = s[2];
1313 psi[3] = 1.0 - s[0] - s[1] - s[2];
1314 }
1315
1316
1317 //==========================================================================
1318 /// Pressure shape and test functions
1319 //==========================================================================
1320 template<unsigned DIM>
1322 const Vector<double>& s, Shape& psi, Shape& test) const
1323 {
1324 // Call the pressure shape functions
1325 this->pshape_nst(s, psi);
1326 // Test functions are shape functions
1327 test.shallow_copy_from(psi);
1328 }
1329
1330
1331 //=======================================================================
1332 /// Face geometry of the 2D Taylor_Hood elements
1333 //=======================================================================
1334 template<>
1336 : public virtual TElement<1, 3>
1337 {
1338 public:
1339 /// Constructor: Call constructor of base
1340 FaceGeometry() : TElement<1, 3>() {}
1341 };
1342
1343
1344 //=======================================================================
1345 /// Face geometry of the 3D Taylor_Hood elements
1346 //=======================================================================
1347 template<>
1349 : public virtual TElement<2, 3>
1350 {
1351 public:
1352 /// Constructor: Call constructor of base
1353 FaceGeometry() : TElement<2, 3>() {}
1354 };
1355
1356
1357 //=======================================================================
1358 /// Face geometry of the FaceGeometry of the 2D TaylorHood elements
1359 //=======================================================================
1360 template<>
1362 : public virtual PointElement
1363 {
1364 public:
1366 };
1367
1368
1369 //=======================================================================
1370 /// Face geometry of the FaceGeometry of the 3D Crouzeix_Raviart elements
1371 //=======================================================================
1372 template<>
1374 : public virtual TElement<1, 3>
1375 {
1376 public:
1377 FaceGeometry() : TElement<1, 3>() {}
1378 };
1379
1380
1381} // namespace oomph
1382
1383#endif
static char t char * s
Definition cfortran.h:568
cstr elem_len * i
Definition cfortran.h:603
char t
Definition cfortran.h:568
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Definition shape.h:359
A class that represents a collection of data; each Data object may contain many different individual ...
Definition nodes.h:86
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition nodes.h:385
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
Definition nodes.h:271
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
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
Definition elements.h:5002
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:2597
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
Definition elements.cc:3355
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
Definition elements.cc:4320
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:1436
unsigned nnode() const
Return the number of nodes.
Definition elements.h:2214
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition elements.h:2179
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:67
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
Definition elements.h:691
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition elements.h:605
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
Definition elements.h:713
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
A class for elements that solve the cartesian Navier–Stokes equations, templated by the dimension DIM...
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i)
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
TCrouzeix_Raviart elements are Navier–Stokes elements with quadratic interpolation for velocities and...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void fix_pressure(const unsigned &p_dof, const double &p_value)
Pin p_dof-th pressure dof and set it to value specified by p_value.
double dshape_and_dtest_eulerian_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const
Pressure shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
double p_nst(const unsigned &t, const unsigned &i) const
Return the pressure values at internal dof i_internal (Discontinous pressure interpolation – no need ...
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs of pointers to data objects and unsignedegers that index the va...
int p_local_eqn(const unsigned &n) const
Return the local equation numbers for the pressure values.
double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at ipt-th integation point...
void full_output(std::ostream &outfile, const unsigned &nplot)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Velocity and ...
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
void pshape_nst(const Vector< double > &s, Shape &psi, Shape &test) const
Pressure shape and test functions at local coordinte s.
double p_nst(const unsigned &i) const
Return the pressure values at internal dof i_internal (Discontinous pressure interpolation – no need ...
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
unsigned P_nst_internal_index
Internal index that indicates at which internal datum the pressure is stored.
GeneralisedNewtonianTCrouzeixRaviartElement()
Constructor, there are DIM+1 internal values (for the pressure)
GeneralisedNewtonianTCrouzeixRaviartElement(const GeneralisedNewtonianTCrouzeixRaviartElement< DIM > &dummy)=delete
Broken copy constructor.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as unenriched shape functions.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
Taylor–Hood elements are Navier–Stokes elements with quadratic interpolation for velocities and posit...
double p_nst(const unsigned &n_p) const
Access function for the pressure values at local pressure node n_p (const version)
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void fix_pressure(const unsigned &p_dof, const double &p_value)
Pin p_dof-th pressure dof and set it to value specified by p_value.
unsigned npres_nst() const
Return number of pressure values.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
int p_local_eqn(const unsigned &n) const
Pointer to n_p-th pressure node.
double dshape_and_dtest_eulerian_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
unsigned p_index_nst()
Which nodal value represents the pressure?
void pshape_nst(const Vector< double > &s, Shape &psi) const
Test whether the pressure dof p_dof hanging or not?
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Velocity and ...
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
double p_nst(const unsigned &t, const unsigned &n_p) const
Access function for the pressure values at local pressure node n_p (const version)
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
GeneralisedNewtonianTTaylorHoodElement(const GeneralisedNewtonianTTaylorHoodElement< DIM > &dummy)=delete
Broken copy constructor.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
virtual double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const
Compute the pressure shape and test functions and derivatives w.r.t. global coords at local coordinat...
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
int p_nodal_index_nst() const
Set the value at which the pressure is stored in the nodes.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition nodes.h:906
An OomphLibError object which should be thrown when an run-time error is encountered....
Point element has just a single node and a single shape function which is identically equal to one.
Definition elements.h:3443
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition shape.h:77
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
TElement class for which the shape functions have been enriched by a single bubble function of the ne...
Definition Telements.h:3570
General TElement class.
Definition Telements.h:1208
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).