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_TNAVIER_STOKES_ELEMENTS_HEADER
29#define OOMPH_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>
60 class TCrouzeixRaviartElement : public virtual TBubbleEnrichedElement<DIM, 3>,
61 public virtual NavierStokesEquations<DIM>,
62 public virtual ElementWithZ2ErrorEstimator
63 {
64 protected:
65 /// Internal index that indicates at which internal datum the pressure is
66 /// stored
68
69
70 /// Velocity shape and test functions and their derivs
71 /// w.r.t. to global coords at local coordinate s (taken from geometry)
72 /// Return Jacobian of mapping between local and global coordinates.
74 Shape& psi,
76 Shape& test,
77 DShape& dtestdx) const;
78
79 /// Velocity shape and test functions and their derivs
80 /// w.r.t. to global coords at ipt-th integation point (taken from geometry)
81 /// Return Jacobian of mapping between local and global coordinates.
82 inline double dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
83 Shape& psi,
85 Shape& test,
86 DShape& dtestdx) const;
87
88 /// Shape/test functions and derivs w.r.t. to global coords at
89 /// integration point ipt; return Jacobian of mapping (J). Also compute
90 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
92 const unsigned& ipt,
93 Shape& psi,
96 Shape& test,
100
101 /// Pressure shape and test functions and their derivs
102 /// w.r.t. to global coords at local coordinate s (taken from geometry)
103 /// Return Jacobian of mapping between local and global coordinates.
105 Shape& ppsi,
107 Shape& ptest,
108 DShape& dptestdx) const;
109
110 public:
111 /// Pressure shape functions at local coordinate s
112 inline void pshape_nst(const Vector<double>& s, Shape& psi) const;
113
114 /// Pressure shape and test functions at local coordinte s
115 inline void pshape_nst(const Vector<double>& s,
116 Shape& psi,
117 Shape& test) const;
118
119 /// Unpin all internal pressure dofs
121
122 /// Return the local equation numbers for the pressure values.
123 inline int p_local_eqn(const unsigned& n) const
124 {
125 return this->internal_local_eqn(P_nst_internal_index, n);
126 }
127
128 public:
129 /// Constructor, there are DIM+1 internal values (for the pressure)
132 {
133 // Allocate and a single internal datum with DIM+1 entries for the
134 // pressure
136 }
137
138 /// Broken copy constructor
140
141 /// Broken assignment operator
142 // Commented out broken assignment operator because this can lead to a
143 // conflict warning when used in the virtual inheritence hierarchy.
144 // Essentially the compiler doesn't realise that two separate
145 // implementations of the broken function are the same and so, quite
146 // rightly, it shouts.
147 /*void operator=(const TCrouzeixRaviartElement<DIM>&) = delete;*/
148
149
150 /// Number of values (pinned or dofs) required at local node n.
151 inline virtual unsigned required_nvalue(const unsigned& n) const
152 {
153 return DIM;
154 }
155
156
157 /// Return the pressure values at internal dof i_internal
158 /// (Discontinous pressure interpolation -- no need to cater for hanging
159 /// nodes).
160 double p_nst(const unsigned& i) const
161 {
162 return this->internal_data_pt(P_nst_internal_index)->value(i);
163 }
164
165 /// Return the pressure values at internal dof i_internal
166 /// (Discontinous pressure interpolation -- no need to cater for hanging
167 /// nodes).
168 double p_nst(const unsigned& t, const unsigned& i) const
169 {
170 return this->internal_data_pt(P_nst_internal_index)->value(t, i);
171 }
172
173 /// Return number of pressure values
174 unsigned npres_nst() const
175 {
176 return DIM + 1;
177 }
178
179 /// Pin p_dof-th pressure dof and set it to value specified by p_value.
180 void fix_pressure(const unsigned& p_dof, const double& p_value)
181 {
182 this->internal_data_pt(P_nst_internal_index)->pin(p_dof);
183 this->internal_data_pt(P_nst_internal_index)->set_value(p_dof, p_value);
184 }
185
186 /// Build FaceElements that apply the Robin boundary condition
187 /// to the pressure advection diffusion problem required by
188 /// Fp preconditioner
189 void build_fp_press_adv_diff_robin_bc_element(const unsigned& face_index)
190 {
193 this, face_index));
194 }
195
196 /// Add to the set paired_load_data
197 /// pairs of pointers to data objects and unsignedegers that
198 /// index the values in the data object that affect the load (traction),
199 /// as specified in the get_load() function.
201 std::set<std::pair<Data*, unsigned>>& paired_load_data);
202
203 /// Add to the set \c paired_pressure_data pairs
204 /// containing
205 /// - the pointer to a Data object
206 /// and
207 /// - the index of the value in that Data object
208 /// .
209 /// for all pressure values that affect the
210 /// load computed in the \c get_load(...) function.
212 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
213
214 /// Redirect output to NavierStokesEquations output
215 void output(std::ostream& outfile)
216 {
218 }
219
220 /// Redirect output to NavierStokesEquations output
221 void output(std::ostream& outfile, const unsigned& nplot)
222 {
224 }
225
226 /// Redirect output to NavierStokesEquations output
231
232 /// Redirect output to NavierStokesEquations output
233 void output(FILE* file_pt, const unsigned& n_plot)
234 {
236 }
237
238
239 /// Order of recovery shape functions for Z2 error estimation:
240 /// Same order as unenriched shape functions.
242 {
243 return 2;
244 }
245
246 /// Number of vertex nodes in the element
247 unsigned nvertex_node() const
248 {
249 return DIM + 1;
250 }
251
252 /// Pointer to the j-th vertex node in the element
253 Node* vertex_node_pt(const unsigned& j) const
254 {
255 return node_pt(j);
256 }
257
258 /// Number of 'flux' terms for Z2 error estimation
260 {
261 // DIM diagonal strain rates, DIM(DIM -1) /2 off diagonal rates
262 return DIM + (DIM * (DIM - 1)) / 2;
263 }
264
265 /// Get 'flux' for Z2 error recovery: Upper triangular entries
266 /// in strain rate tensor.
268 {
269#ifdef PARANOID
270 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
271 if (flux.size() < num_entries)
272 {
273 std::ostringstream error_message;
274 error_message << "The flux vector has the wrong number of entries, "
275 << flux.size() << ", whereas it should be at least "
276 << num_entries << std::endl;
277 throw OomphLibError(error_message.str(),
280 }
281#endif
282
283 // Get strain rate matrix
285 this->strain_rate(s, strainrate);
286
287 // Pack into flux Vector
288 unsigned icount = 0;
289
290 // Start with diagonal terms
291 for (unsigned i = 0; i < DIM; i++)
292 {
293 flux[icount] = strainrate(i, i);
294 icount++;
295 }
296
297 // Off diagonals row by row
298 for (unsigned i = 0; i < DIM; i++)
299 {
300 for (unsigned j = i + 1; j < DIM; j++)
301 {
302 flux[icount] = strainrate(i, j);
303 icount++;
304 }
305 }
306 }
307
308
309 /// Full output function:
310 /// x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation
311 /// in tecplot format. Default number of plot points
316
317 /// Full output function:
318 /// x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation
319 /// in tecplot format. nplot points in each coordinate direction
320 void full_output(std::ostream& outfile, const unsigned& nplot)
321 {
323 }
324
325 /// The number of "DOF types" that degrees of freedom in this element
326 /// are sub-divided into: Velocity and pressure.
327 unsigned ndof_types() const
328 {
329 return DIM + 1;
330 }
331
332 /// Create a list of pairs for all unknowns in this element,
333 /// so that the first entry in each pair contains the global equation
334 /// number of the unknown, while the second one contains the number
335 /// of the "DOF types" that this unknown is associated with.
336 /// (Function can obviously only be called if the equation numbering
337 /// scheme has been set up.) Velocity=0; Pressure=1
339 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const;
340 };
341
342 // Inline functions
343
344 //=======================================================================
345 /// Derivatives of the shape functions and test functions w.r.t. to global
346 /// (Eulerian) coordinates. Return Jacobian of mapping between
347 /// local and global coordinates.
348 //=======================================================================
349 template<unsigned DIM>
351 const Vector<double>& s,
352 Shape& psi,
353 DShape& dpsidx,
354 Shape& test,
355 DShape& dtestdx) const
356 {
357 // Call the geometrical shape functions and derivatives
358 double J = this->dshape_eulerian(s, psi, dpsidx);
359 // The test functions are equal to the shape functions
360 test.shallow_copy_from(psi);
361 dtestdx.shallow_copy_from(dpsidx);
362 // Return the jacobian
363 return J;
364 }
365
366
367 //=======================================================================
368 /// Derivatives of the shape functions and test functions w.r.t. to global
369 /// (Eulerian) coordinates. Return Jacobian of mapping between
370 /// local and global coordinates.
371 //=======================================================================
372 template<unsigned DIM>
373 inline double TCrouzeixRaviartElement<
374 DIM>::dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
375 Shape& psi,
376 DShape& dpsidx,
377 Shape& test,
378 DShape& dtestdx) const
379 {
380 // Call the geometrical shape functions and derivatives
381 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
382 // The test functions are the shape functions
383 test.shallow_copy_from(psi);
384 dtestdx.shallow_copy_from(dpsidx);
385 // Return the jacobian
386 return J;
387 }
388
389
390 //=======================================================================
391 /// 2D
392 /// Define the shape functions (psi) and test functions (test) and
393 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
394 /// and return Jacobian of mapping (J). Additionally compute the
395 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
396 ///
397 /// Galerkin: Test functions = shape functions
398 //=======================================================================
399 template<unsigned DIM>
402 const unsigned& ipt,
403 Shape& psi,
404 DShape& dpsidx,
406 Shape& test,
410 {
411 // Call the geometrical shape functions and derivatives
412 const double J = this->dshape_eulerian_at_knot(
414
415 // Set the test functions equal to the shape functions
416 test.shallow_copy_from(psi);
417 dtestdx.shallow_copy_from(dpsidx);
418 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
419
420 // Return the jacobian
421 return J;
422 }
423
424
425 //=======================================================================
426 /// 2D :
427 /// Pressure shape functions
428 //=======================================================================
429 template<>
431 Shape& psi) const
432 {
433 psi[0] = 1.0;
434 psi[1] = s[0];
435 psi[2] = s[1];
436 }
437
438 //=======================================================================
439 /// Pressure shape and test functions
440 //=======================================================================
441 template<>
443 Shape& psi,
444 Shape& test) const
445 {
446 // Call the pressure shape functions
447 this->pshape_nst(s, psi);
448 // The test functions are the shape functions
449 test.shallow_copy_from(psi);
450 }
451
452
453 //=======================================================================
454 /// 3D :
455 /// Pressure shape functions
456 //=======================================================================
457 template<>
459 Shape& psi) const
460 {
461 psi[0] = 1.0;
462 psi[1] = s[0];
463 psi[2] = s[1];
464 psi[3] = s[2];
465 }
466
467
468 //=======================================================================
469 /// Pressure shape and test functions
470 //=======================================================================
471 template<>
473 Shape& psi,
474 Shape& test) const
475 {
476 // Call the pressure shape functions
477 this->pshape_nst(s, psi);
478 // The test functions are the shape functions
479 test.shallow_copy_from(psi);
480 }
481
482
483 //==========================================================================
484 /// 2D :
485 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
486 /// Return Jacobian of mapping between local and global coordinates.
487 //==========================================================================
488 template<>
490 const Vector<double>& s,
491 Shape& ppsi,
493 Shape& ptest,
494 DShape& dptestdx) const
495 {
496 // Initalise with shape fcts and derivs. w.r.t. to local coordinates
497 ppsi[0] = 1.0;
498 ppsi[1] = s[0];
499 ppsi[2] = s[1];
500
501 dppsidx(0, 0) = 0.0;
502 dppsidx(1, 0) = 1.0;
503 dppsidx(2, 0) = 0.0;
504
505 dppsidx(0, 1) = 0.0;
506 dppsidx(1, 1) = 0.0;
507 dppsidx(2, 1) = 1.0;
508
509
510 // Get the values of the shape functions and their local derivatives
511 Shape psi(7);
512 DShape dpsi(7, 2);
514
515 // Allocate memory for the inverse 2x2 jacobian
517
518 // Now calculate the inverse jacobian
520
521 // Now set the values of the derivatives to be derivs w.r.t. to the
522 // Eulerian coordinates
524
525 // The test functions are equal to the shape functions
526 ptest.shallow_copy_from(ppsi);
527 dptestdx.shallow_copy_from(dppsidx);
528
529 // Return the determinant of the jacobian
530 return det;
531 }
532
533
534 //==========================================================================
535 /// 3D :
536 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
537 /// Return Jacobian of mapping between local and global coordinates.
538 //==========================================================================
539 template<>
541 const Vector<double>& s,
542 Shape& ppsi,
544 Shape& ptest,
545 DShape& dptestdx) const
546 {
547 // Initalise with shape fcts and derivs. w.r.t. to local coordinates
548 ppsi[0] = 1.0;
549 ppsi[1] = s[0];
550 ppsi[2] = s[1];
551 ppsi[3] = s[2];
552
553 dppsidx(0, 0) = 0.0;
554 dppsidx(1, 0) = 1.0;
555 dppsidx(2, 0) = 0.0;
556 dppsidx(3, 0) = 0.0;
557
558 dppsidx(0, 1) = 0.0;
559 dppsidx(1, 1) = 0.0;
560 dppsidx(2, 1) = 1.0;
561 dppsidx(3, 1) = 0.0;
562
563 dppsidx(0, 2) = 0.0;
564 dppsidx(1, 2) = 0.0;
565 dppsidx(2, 2) = 0.0;
566 dppsidx(3, 2) = 1.0;
567
568
569 // Get the values of the shape functions and their local derivatives
570 Shape psi(11);
571 DShape dpsi(11, 3);
573
574 // Allocate memory for the inverse 3x3 jacobian
576
577 // Now calculate the inverse jacobian
579
580 // Now set the values of the derivatives to be derivs w.r.t. to the
581 // Eulerian coordinates
583
584 // The test functions are equal to the shape functions
585 ptest.shallow_copy_from(ppsi);
586 dptestdx.shallow_copy_from(dppsidx);
587
588 // Return the determinant of the jacobian
589 return det;
590 }
591
592
593 //=======================================================================
594 /// Face geometry of the 2D Crouzeix_Raviart elements
595 //=======================================================================
596 template<>
597 class FaceGeometry<TCrouzeixRaviartElement<2>> : public virtual TElement<1, 3>
598 {
599 public:
600 FaceGeometry() : TElement<1, 3>() {}
601 };
602
603 //=======================================================================
604 /// Face geometry of the 3D Crouzeix_Raviart elements
605 //=======================================================================
606 template<>
608 : public virtual TBubbleEnrichedElement<2, 3>
609 {
610 public:
612 };
613
614
615 //=======================================================================
616 /// Face geometry of the FaceGeometry of the 2D CrouzeixRaviart elements
617 //=======================================================================
618 template<>
620 : public virtual PointElement
621 {
622 public:
624 };
625
626
627 //=======================================================================
628 /// Face geometry of the FaceGeometry of the 3D Crouzeix_Raviart elements
629 //=======================================================================
630 template<>
632 : public virtual TElement<1, 3>
633 {
634 public:
635 FaceGeometry() : TElement<1, 3>() {}
636 };
637
638
639 //=============================================================================
640 /// Create a list of pairs for all unknowns in this element,
641 /// so that the first entry in each pair contains the global equation
642 /// number of the unknown, while the second one contains the number
643 /// of the DOF that this unknown is associated with.
644 /// (Function can obviously only be called if the equation numbering
645 /// scheme has been set up.)
646 //=============================================================================
647 template<unsigned DIM>
649 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
650 {
651 // number of nodes
652 unsigned n_node = this->nnode();
653
654 // number of pressure values
655 unsigned n_press = this->npres_nst();
656
657 // temporary pair (used to store dof lookup prior to being added to list)
658 std::pair<unsigned, unsigned> dof_lookup;
659
660 // pressure dof number
661 unsigned pressure_dof_number = DIM;
662
663 // loop over the pressure values
664 for (unsigned n = 0; n < n_press; n++)
665 {
666 // determine local eqn number
667 int local_eqn_number = this->p_local_eqn(n);
668
669 // ignore pinned values - far away degrees of freedom resulting
670 // from hanging nodes can be ignored since these are be dealt
671 // with by the element containing their master nodes
672 if (local_eqn_number >= 0)
673 {
674 // store dof lookup in temporary pair: First entry in pair
675 // is global equation number; second entry is dof type
676 dof_lookup.first = this->eqn_number(local_eqn_number);
678
679 // add to list
680 dof_lookup_list.push_front(dof_lookup);
681 }
682 }
683
684 // loop over the nodes
685 for (unsigned n = 0; n < n_node; n++)
686 {
687 // find the number of values at this node
688 unsigned nv = this->node_pt(n)->nvalue();
689
690 // loop over these values
691 for (unsigned v = 0; v < nv; v++)
692 {
693 // determine local eqn number
694 int local_eqn_number = this->nodal_local_eqn(n, v);
695
696 // ignore pinned values
697 if (local_eqn_number >= 0)
698 {
699 // store dof lookup in temporary pair: First entry in pair
700 // is global equation number; second entry is dof type
701 dof_lookup.first = this->eqn_number(local_eqn_number);
702 dof_lookup.second = v;
703
704 // add to list
705 dof_lookup_list.push_front(dof_lookup);
706 }
707 }
708 }
709 }
710
711 ////////////////////////////////////////////////////////////////////////////
712 ////////////////////////////////////////////////////////////////////////////
713 ////////////////////////////////////////////////////////////////////////////
714
715
716 //=======================================================================
717 /// Taylor--Hood elements are Navier--Stokes elements
718 /// with quadratic interpolation for velocities and positions and
719 /// continous linear pressure interpolation
720 //=======================================================================
721 template<unsigned DIM>
722 class TTaylorHoodElement : public virtual TElement<DIM, 3>,
723 public virtual NavierStokesEquations<DIM>,
724 public virtual ElementWithZ2ErrorEstimator
725
726 {
727 public:
728 /// Publicly exposed template parameter
729 static const unsigned TEMPLATE_PARAMETER_DIM = DIM;
730
731 /// Publicly exposed template parameter
732 static const unsigned TEMPLATE_PARAMETER_NNODE_1D = 3;
733
734 private:
735 /// Static array of ints to hold number of variables at node
736 static const unsigned Initial_Nvalue[];
737
738 protected:
739 /// Static array of ints to hold conversion from pressure
740 /// node numbers to actual node numbers
741 static const unsigned Pconv[];
742
743 /// Velocity shape and test functions and their derivs
744 /// w.r.t. to global coords at local coordinate s (taken from geometry)
745 /// Return Jacobian of mapping between local and global coordinates.
747 Shape& psi,
748 DShape& dpsidx,
749 Shape& test,
750 DShape& dtestdx) const;
751
752 /// Velocity shape and test functions and their derivs
753 /// w.r.t. to global coords at local coordinate s (taken from geometry)
754 /// Return Jacobian of mapping between local and global coordinates.
755 inline double dshape_and_dtest_eulerian_at_knot_nst(const unsigned& ipt,
756 Shape& psi,
757 DShape& dpsidx,
758 Shape& test,
759 DShape& dtestdx) const;
760
761 /// Shape/test functions and derivs w.r.t. to global coords at
762 /// integration point ipt; return Jacobian of mapping (J). Also compute
763 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
765 const unsigned& ipt,
766 Shape& psi,
767 DShape& dpsidx,
769 Shape& test,
773
774 /// Compute the pressure shape and test functions and derivatives
775 /// w.r.t. global coords at local coordinate s.
776 /// Return Jacobian of mapping between local and global coordinates.
778 Shape& ppsi,
780 Shape& ptest,
781 DShape& dptestdx) const;
782
783 /// Unpin all pressure dofs
785
786 /// Pin all nodal pressure dofs
788
789 /// Unpin the proper nodal pressure dofs
791
792
793 public:
794 /// Constructor, no internal data points
796
797
798 /// Broken copy constructor
800
801 /// Broken assignment operator
802 /*void operator=(const TTaylorHoodElement<DIM>&) = delete;*/
803
804 /// Number of values (pinned or dofs) required at node n. Can
805 /// be overwritten for hanging node version
806 inline virtual unsigned required_nvalue(const unsigned& n) const
807 {
808 return Initial_Nvalue[n];
809 }
810
811 /// Test whether the pressure dof p_dof hanging or not?
812 // bool pressure_dof_is_hanging(const unsigned& p_dof)
813 // {return this->node_pt(Pconv[p_dof])->is_hanging(DIM);}
814
815
816 /// Pressure shape functions at local coordinate s
817 inline void pshape_nst(const Vector<double>& s, Shape& psi) const;
818
819 /// Pressure shape and test functions at local coordinte s
820 inline void pshape_nst(const Vector<double>& s,
821 Shape& psi,
822 Shape& test) const;
823
824 /// Which nodal value represents the pressure?
825 unsigned p_index_nst()
826 {
827 return DIM;
828 }
829
830 /// Pointer to n_p-th pressure node
831 // Node* pressure_node_pt(const unsigned &n_p)
832 //{return this->Node_pt[Pconv[n_p]];}
833
834 /// Return the local equation numbers for the pressure values.
835 inline int p_local_eqn(const unsigned& n) const
836 {
837 return this->nodal_local_eqn(Pconv[n], DIM);
838 }
839
840 /// Access function for the pressure values at local pressure
841 /// node n_p (const version)
842 double p_nst(const unsigned& n_p) const
843 {
844 return this->nodal_value(Pconv[n_p], DIM);
845 }
846
847 /// Access function for the pressure values at local pressure
848 /// node n_p (const version)
849 double p_nst(const unsigned& t, const unsigned& n_p) const
850 {
851 return this->nodal_value(t, Pconv[n_p], DIM);
852 }
853
854 /// Set the value at which the pressure is stored in the nodes
856 {
857 return static_cast<int>(DIM);
858 }
859
860 /// Return number of pressure values
861 unsigned npres_nst() const;
862
863 /// Pin p_dof-th pressure dof and set it to value specified by p_value.
864 void fix_pressure(const unsigned& p_dof, const double& p_value)
865 {
866 this->node_pt(Pconv[p_dof])->pin(DIM);
867 this->node_pt(Pconv[p_dof])->set_value(DIM, p_value);
868 }
869
870
871 /// Build FaceElements that apply the Robin boundary condition
872 /// to the pressure advection diffusion problem required by
873 /// Fp preconditioner
874 void build_fp_press_adv_diff_robin_bc_element(const unsigned& face_index)
875 {
878 this, face_index));
879 }
880
881 /// Add to the set \c paired_load_data pairs containing
882 /// - the pointer to a Data object
883 /// and
884 /// - the index of the value in that Data object
885 /// .
886 /// for all values (pressures, velocities) that affect the
887 /// load computed in the \c get_load(...) function.
889 std::set<std::pair<Data*, unsigned>>& paired_load_data);
890
891 /// Add to the set \c paired_pressure_data pairs
892 /// containing
893 /// - the pointer to a Data object
894 /// and
895 /// - the index of the value in that Data object
896 /// .
897 /// for all pressure values that affect the
898 /// load computed in the \c get_load(...) function.
900 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
901
902 /// Redirect output to NavierStokesEquations output
903 void output(std::ostream& outfile)
904 {
906 }
907
908 /// Redirect output to NavierStokesEquations output
909 void output(std::ostream& outfile, const unsigned& nplot)
910 {
912 }
913
914 /// Redirect output to NavierStokesEquations output
919
920 /// Redirect output to NavierStokesEquations output
921 void output(FILE* file_pt, const unsigned& n_plot)
922 {
924 }
925
926 /// Order of recovery shape functions for Z2 error estimation:
927 /// Same order as shape functions.
929 {
930 return 2;
931 }
932
933 /// Number of vertex nodes in the element
934 unsigned nvertex_node() const
935 {
936 return DIM + 1;
937 }
938
939 /// Pointer to the j-th vertex node in the element
940 Node* vertex_node_pt(const unsigned& j) const
941 {
942 return node_pt(j);
943 }
944
945
946 /// Number of 'flux' terms for Z2 error estimation
948 {
949 // DIM diagonal strain rates, DIM(DIM -1) /2 off diagonal rates
950 return DIM + (DIM * (DIM - 1)) / 2;
951 }
952
953 /// Get 'flux' for Z2 error recovery: Upper triangular entries
954 /// in strain rate tensor.
956 {
957#ifdef PARANOID
958 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
959 if (flux.size() < num_entries)
960 {
961 std::ostringstream error_message;
962 error_message << "The flux vector has the wrong number of entries, "
963 << flux.size() << ", whereas it should be at least "
964 << num_entries << std::endl;
965 throw OomphLibError(error_message.str(),
968 }
969#endif
970
971 // Get strain rate matrix
973 this->strain_rate(s, strainrate);
974
975 // Pack into flux Vector
976 unsigned icount = 0;
977
978 // Start with diagonal terms
979 for (unsigned i = 0; i < DIM; i++)
980 {
981 flux[icount] = strainrate(i, i);
982 icount++;
983 }
984
985 // Off diagonals row by row
986 for (unsigned i = 0; i < DIM; i++)
987 {
988 for (unsigned j = i + 1; j < DIM; j++)
989 {
990 flux[icount] = strainrate(i, j);
991 icount++;
992 }
993 }
994 }
995
996 /// The number of "DOF types" that degrees of freedom in this element
997 /// are sub-divided into: Velocity and pressure.
998 unsigned ndof_types() const
999 {
1000 return DIM + 1;
1001 }
1002
1003 /// Create a list of pairs for all unknowns in this element,
1004 /// so that the first entry in each pair contains the global equation
1005 /// number of the unknown, while the second one contains the number
1006 /// of the "DOF type" that this unknown is associated with.
1007 /// (Function can obviously only be called if the equation numbering
1008 /// scheme has been set up.) Velocity=0; Pressure=1
1010 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
1011 {
1012 // number of nodes
1013 unsigned n_node = this->nnode();
1014
1015 // temporary pair (used to store dof lookup prior to being added to list)
1016 std::pair<unsigned, unsigned> dof_lookup;
1017
1018 // loop over the nodes
1019 for (unsigned n = 0; n < n_node; n++)
1020 {
1021 // find the number of Navier Stokes values at this node
1022 unsigned nv = this->required_nvalue(n);
1023
1024 // loop over these values
1025 for (unsigned v = 0; v < nv; v++)
1026 {
1027 // determine local eqn number
1028 int local_eqn_number = this->nodal_local_eqn(n, v);
1029
1030 // ignore pinned values - far away degrees of freedom resulting
1031 // from hanging nodes can be ignored since these are be dealt
1032 // with by the element containing their master nodes
1033 if (local_eqn_number >= 0)
1034 {
1035 // store dof lookup in temporary pair: Global equation number
1036 // is the first entry in pair
1037 dof_lookup.first = this->eqn_number(local_eqn_number);
1038
1039 // set dof numbers: Dof number is the second entry in pair
1040 dof_lookup.second = v;
1041
1042 // add to list
1043 dof_lookup_list.push_front(dof_lookup);
1044 }
1045 }
1046 }
1047 }
1048 };
1049
1050
1051 // Inline functions
1052
1053 //==========================================================================
1054 /// 2D :
1055 /// Number of pressure values
1056 //==========================================================================
1057 template<>
1058 inline unsigned TTaylorHoodElement<2>::npres_nst() const
1059 {
1060 return 3;
1061 }
1062
1063 //==========================================================================
1064 /// 3D :
1065 /// Number of pressure values
1066 //==========================================================================
1067 template<>
1068 inline unsigned TTaylorHoodElement<3>::npres_nst() const
1069 {
1070 return 4;
1071 }
1072
1073
1074 //==========================================================================
1075 /// 2D :
1076 /// Derivatives of the shape functions and test functions w.r.t to
1077 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1078 /// local and global coordinates.
1079 //==========================================================================
1080 template<unsigned DIM>
1082 const Vector<double>& s,
1083 Shape& psi,
1084 DShape& dpsidx,
1085 Shape& test,
1086 DShape& dtestdx) const
1087 {
1088 // Call the geometrical shape functions and derivatives
1089 double J = this->dshape_eulerian(s, psi, dpsidx);
1090 // Test functions are the shape functions
1091 test.shallow_copy_from(psi);
1092 dtestdx.shallow_copy_from(dpsidx);
1093 // Return the jacobian
1094 return J;
1095 }
1096
1097
1098 //==========================================================================
1099 /// Derivatives of the shape functions and test functions w.r.t to
1100 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1101 /// local and global coordinates.
1102 //==========================================================================
1103 template<unsigned DIM>
1105 const unsigned& ipt,
1106 Shape& psi,
1107 DShape& dpsidx,
1108 Shape& test,
1109 DShape& dtestdx) const
1110 {
1111 // Call the geometrical shape functions and derivatives
1112 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
1113 // Test functions are the shape functions
1114 test.shallow_copy_from(psi);
1115 dtestdx.shallow_copy_from(dpsidx);
1116 // Return the jacobian
1117 return J;
1118 }
1119
1120 //==========================================================================
1121 /// 2D :
1122 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1123 /// Return Jacobian of mapping between local and global coordinates.
1124 //==========================================================================
1125 template<>
1127 const Vector<double>& s,
1128 Shape& ppsi,
1129 DShape& dppsidx,
1130 Shape& ptest,
1131 DShape& dptestdx) const
1132 {
1133 ppsi[0] = s[0];
1134 ppsi[1] = s[1];
1135 ppsi[2] = 1.0 - s[0] - s[1];
1136
1137 dppsidx(0, 0) = 1.0;
1138 dppsidx(0, 1) = 0.0;
1139
1140 dppsidx(1, 0) = 0.0;
1141 dppsidx(1, 1) = 1.0;
1142
1143 dppsidx(2, 0) = -1.0;
1144 dppsidx(2, 1) = -1.0;
1145
1146 // Allocate memory for the inverse 2x2 jacobian
1148
1149
1150 // Get the values of the shape functions and their local derivatives
1151 Shape psi(6);
1152 DShape dpsi(6, 2);
1154
1155 // Now calculate the inverse jacobian
1157
1158 // Now set the values of the derivatives to be derivs w.r.t. to the
1159 // Eulerian coordinates
1161
1162 // Test functions are shape functions
1163 ptest.shallow_copy_from(ppsi);
1164 dptestdx.shallow_copy_from(dppsidx);
1165
1166 // Return the determinant of the jacobian
1167 return det;
1168 }
1169
1170
1171 //==========================================================================
1172 /// 3D :
1173 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1174 /// Return Jacobian of mapping between local and global coordinates.
1175 //==========================================================================
1176 template<>
1178 const Vector<double>& s,
1179 Shape& ppsi,
1180 DShape& dppsidx,
1181 Shape& ptest,
1182 DShape& dptestdx) const
1183 {
1184 ppsi[0] = s[0];
1185 ppsi[1] = s[1];
1186 ppsi[2] = s[2];
1187 ppsi[3] = 1.0 - s[0] - s[1] - s[2];
1188
1189 dppsidx(0, 0) = 1.0;
1190 dppsidx(0, 1) = 0.0;
1191 dppsidx(0, 2) = 0.0;
1192
1193 dppsidx(1, 0) = 0.0;
1194 dppsidx(1, 1) = 1.0;
1195 dppsidx(1, 2) = 0.0;
1196
1197 dppsidx(2, 0) = 0.0;
1198 dppsidx(2, 1) = 0.0;
1199 dppsidx(2, 2) = 1.0;
1200
1201 dppsidx(3, 0) = -1.0;
1202 dppsidx(3, 1) = -1.0;
1203 dppsidx(3, 2) = -1.0;
1204
1205
1206 // Get the values of the shape functions and their local derivatives
1207 Shape psi(10);
1208 DShape dpsi(10, 3);
1210
1211 // Allocate memory for the inverse 3x3 jacobian
1213
1214 // Now calculate the inverse jacobian
1216
1217 // Now set the values of the derivatives to be derivs w.r.t. to the
1218 // Eulerian coordinates
1220
1221 // Test functions are shape functions
1222 ptest.shallow_copy_from(ppsi);
1223 dptestdx.shallow_copy_from(dppsidx);
1224
1225 // Return the determinant of the jacobian
1226 return det;
1227 }
1228
1229
1230 //==========================================================================
1231 /// 2D :
1232 /// Define the shape functions (psi) and test functions (test) and
1233 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1234 /// and return Jacobian of mapping (J). Additionally compute the
1235 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1236 ///
1237 /// Galerkin: Test functions = shape functions
1238 //==========================================================================
1239 template<>
1241 const unsigned& ipt,
1242 Shape& psi,
1243 DShape& dpsidx,
1245 Shape& test,
1246 DShape& dtestdx,
1249 {
1250 // Call the geometrical shape functions and derivatives
1251 const double J = this->dshape_eulerian_at_knot(
1253
1254 // Set the test functions equal to the shape functions
1255 test.shallow_copy_from(psi);
1256 dtestdx.shallow_copy_from(dpsidx);
1257 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1258
1259 // Return the jacobian
1260 return J;
1261 }
1262
1263
1264 //==========================================================================
1265 /// 3D :
1266 /// Define the shape functions (psi) and test functions (test) and
1267 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1268 /// and return Jacobian of mapping (J). Additionally compute the
1269 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1270 ///
1271 /// Galerkin: Test functions = shape functions
1272 //==========================================================================
1273 template<>
1275 const unsigned& ipt,
1276 Shape& psi,
1277 DShape& dpsidx,
1279 Shape& test,
1280 DShape& dtestdx,
1283 {
1284 // Call the geometrical shape functions and derivatives
1285 const double J = this->dshape_eulerian_at_knot(
1287
1288 // Set the test functions equal to the shape functions
1289 test.shallow_copy_from(psi);
1290 dtestdx.shallow_copy_from(dpsidx);
1291 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1292
1293 // Return the jacobian
1294 return J;
1295 }
1296
1297
1298 //==========================================================================
1299 /// 2D :
1300 /// Pressure shape functions
1301 //==========================================================================
1302 template<>
1304 Shape& psi) const
1305 {
1306 psi[0] = s[0];
1307 psi[1] = s[1];
1308 psi[2] = 1.0 - s[0] - s[1];
1309 }
1310
1311 //==========================================================================
1312 /// 3D :
1313 /// Pressure shape functions
1314 //==========================================================================
1315 template<>
1317 Shape& psi) const
1318 {
1319 psi[0] = s[0];
1320 psi[1] = s[1];
1321 psi[2] = s[2];
1322 psi[3] = 1.0 - s[0] - s[1] - s[2];
1323 }
1324
1325
1326 //==========================================================================
1327 /// Pressure shape and test functions
1328 //==========================================================================
1329 template<unsigned DIM>
1331 Shape& psi,
1332 Shape& test) const
1333 {
1334 // Call the pressure shape functions
1335 this->pshape_nst(s, psi);
1336 // Test functions are shape functions
1337 test.shallow_copy_from(psi);
1338 }
1339
1340
1341 //=======================================================================
1342 /// Face geometry of the 2D Taylor_Hood elements
1343 //=======================================================================
1344 template<>
1345 class FaceGeometry<TTaylorHoodElement<2>> : public virtual TElement<1, 3>
1346 {
1347 public:
1348 /// Constructor: Call constructor of base
1349 FaceGeometry() : TElement<1, 3>() {}
1350 };
1351
1352
1353 //=======================================================================
1354 /// Face geometry of the 3D Taylor_Hood elements
1355 //=======================================================================
1356 template<>
1357 class FaceGeometry<TTaylorHoodElement<3>> : public virtual TElement<2, 3>
1358 {
1359 public:
1360 /// Constructor: Call constructor of base
1361 FaceGeometry() : TElement<2, 3>() {}
1362 };
1363
1364
1365 //=======================================================================
1366 /// Face geometry of the FaceGeometry of the 2D TaylorHood elements
1367 //=======================================================================
1368 template<>
1370 : public virtual PointElement
1371 {
1372 public:
1374 };
1375
1376
1377 //=======================================================================
1378 /// Face geometry of the FaceGeometry of the 3D Crouzeix_Raviart elements
1379 //=======================================================================
1380 template<>
1382 : public virtual TElement<1, 3>
1383 {
1384 public:
1385 FaceGeometry() : TElement<1, 3>() {}
1386 };
1387
1388
1389} // namespace oomph
1390
1391#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()
Constructor: Call constructor of base.
FaceGeometry()
Constructor: Call constructor of base.
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 void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t.local coordinates to derivatives w.r.t the coordinates used to assemble the ...
Definition elements.cc:2863
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
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
Definition elements.h:1512
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:3328
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition elements.h:2179
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
Definition elements.h:1985
A class for elements that allow the imposition of Robin boundary conditions for the pressure advectio...
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 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....
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
Vector< FpPressureAdvDiffRobinBCElementBase * > Pressure_advection_diffusion_robin_element_pt
Storage for FaceElements that apply Robin BC for pressure adv diff equation used in Fp preconditioner...
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
TCrouzeix_Raviart elements are Navier–Stokes elements with quadratic interpolation for velocities and...
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...
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....
unsigned npres_nst() const
Return number of pressure values.
unsigned P_nst_internal_index
Internal index that indicates at which internal datum the pressure is stored.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
double p_nst(const unsigned &i) const
Return the pressure values at internal dof i_internal (Discontinous pressure interpolation – no need ...
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...
TCrouzeixRaviartElement()
Constructor, there are DIM+1 internal values (for the pressure)
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
unsigned nvertex_node() const
Number of vertex nodes in the element.
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 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 output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
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.
int p_local_eqn(const unsigned &n) const
Return the local equation numbers for the pressure values.
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...
void unpin_all_internal_pressure_dofs()
Unpin all internal pressure dofs.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as unenriched shape functions.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
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 pshape_nst(const Vector< double > &s, Shape &psi, Shape &test) const
Pressure shape and test functions at local coordinte s.
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
TCrouzeixRaviartElement(const TCrouzeixRaviartElement< DIM > &dummy)=delete
Broken copy constructor.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Velocity and ...
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....
General TElement class.
Definition Telements.h:1208
Taylor–Hood elements are Navier–Stokes elements with quadratic interpolation for velocities and posit...
unsigned p_index_nst()
Which nodal value represents the pressure?
void pin_all_nodal_pressure_dofs()
Pin all nodal pressure dofs.
TTaylorHoodElement()
Constructor, no internal data points.
static const unsigned TEMPLATE_PARAMETER_DIM
Publicly exposed template parameter.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
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...
void unpin_proper_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void unpin_all_nodal_pressure_dofs()
Unpin all pressure dofs.
void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
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 ...
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
void pshape_nst(const Vector< double > &s, Shape &psi) const
Test whether the pressure dof p_dof hanging or not?
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...
unsigned nvertex_node() const
Number of vertex nodes in the element.
static const unsigned TEMPLATE_PARAMETER_NNODE_1D
Publicly exposed template parameter.
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)
double p_nst(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.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Velocity and ...
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...
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
int p_nodal_index_nst() const
Set the value at which the pressure is stored in the nodes.
TTaylorHoodElement(const TTaylorHoodElement< DIM > &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
int p_local_eqn(const unsigned &n) const
Pointer to n_p-th pressure node.
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned npres_nst() const
Return number of pressure values.
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.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
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...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).