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
825 /// Pointer to n_p-th pressure node
826 // Node* pressure_node_pt(const unsigned &n_p)
827 //{return this->Node_pt[Pconv[n_p]];}
828
829 /// Return the local equation numbers for the pressure values.
830 inline int p_local_eqn(const unsigned& n) const
831 {
832 return this->nodal_local_eqn(Pconv[n], this->p_nodal_index_nst());
833 }
834
835 /// Access function for the pressure values at local pressure
836 /// node n_p (const version)
837 double p_nst(const unsigned& n_p) const
838 {
839 return this->nodal_value(Pconv[n_p], this->p_nodal_index_nst());
840 }
841
842 /// Access function for the pressure values at local pressure
843 /// node n_p (const version)
844 double p_nst(const unsigned& t, const unsigned& n_p) const
845 {
846 return this->nodal_value(t, Pconv[n_p], this->p_nodal_index_nst());
847 }
848
849 /// Set the value at which the pressure is stored in the nodes
851 {
852 return static_cast<int>(DIM);
853 }
854
855 /// Return number of pressure values
856 unsigned npres_nst() const;
857
858 /// Pin p_dof-th pressure dof and set it to value specified by p_value.
859 void fix_pressure(const unsigned& p_dof, const double& p_value)
860 {
861 this->node_pt(Pconv[p_dof])->pin(this->p_nodal_index_nst());
862 this->node_pt(Pconv[p_dof])
863 ->set_value(this->p_nodal_index_nst(), p_value);
864 }
865
866
867 /// Build FaceElements that apply the Robin boundary condition
868 /// to the pressure advection diffusion problem required by
869 /// Fp preconditioner
870 void build_fp_press_adv_diff_robin_bc_element(const unsigned& face_index)
871 {
874 this, face_index));
875 }
876
877 /// Add to the set \c paired_load_data pairs containing
878 /// - the pointer to a Data object
879 /// and
880 /// - the index of the value in that Data object
881 /// .
882 /// for all values (pressures, velocities) that affect the
883 /// load computed in the \c get_load(...) function.
885 std::set<std::pair<Data*, unsigned>>& paired_load_data);
886
887 /// Add to the set \c paired_pressure_data pairs
888 /// containing
889 /// - the pointer to a Data object
890 /// and
891 /// - the index of the value in that Data object
892 /// .
893 /// for all pressure values that affect the
894 /// load computed in the \c get_load(...) function.
896 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
897
898 /// Redirect output to NavierStokesEquations output
899 void output(std::ostream& outfile)
900 {
902 }
903
904 /// Redirect output to NavierStokesEquations output
905 void output(std::ostream& outfile, const unsigned& nplot)
906 {
908 }
909
910 /// Redirect output to NavierStokesEquations output
915
916 /// Redirect output to NavierStokesEquations output
917 void output(FILE* file_pt, const unsigned& n_plot)
918 {
920 }
921
922 /// Order of recovery shape functions for Z2 error estimation:
923 /// Same order as shape functions.
925 {
926 return 2;
927 }
928
929 /// Number of vertex nodes in the element
930 unsigned nvertex_node() const
931 {
932 return DIM + 1;
933 }
934
935 /// Pointer to the j-th vertex node in the element
936 Node* vertex_node_pt(const unsigned& j) const
937 {
938 return node_pt(j);
939 }
940
941
942 /// Number of 'flux' terms for Z2 error estimation
944 {
945 // DIM diagonal strain rates, DIM(DIM -1) /2 off diagonal rates
946 return DIM + (DIM * (DIM - 1)) / 2;
947 }
948
949 /// Get 'flux' for Z2 error recovery: Upper triangular entries
950 /// in strain rate tensor.
952 {
953#ifdef PARANOID
954 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
955 if (flux.size() < num_entries)
956 {
957 std::ostringstream error_message;
958 error_message << "The flux vector has the wrong number of entries, "
959 << flux.size() << ", whereas it should be at least "
960 << num_entries << std::endl;
961 throw OomphLibError(error_message.str(),
964 }
965#endif
966
967 // Get strain rate matrix
969 this->strain_rate(s, strainrate);
970
971 // Pack into flux Vector
972 unsigned icount = 0;
973
974 // Start with diagonal terms
975 for (unsigned i = 0; i < DIM; i++)
976 {
977 flux[icount] = strainrate(i, i);
978 icount++;
979 }
980
981 // Off diagonals row by row
982 for (unsigned i = 0; i < DIM; i++)
983 {
984 for (unsigned j = i + 1; j < DIM; j++)
985 {
986 flux[icount] = strainrate(i, j);
987 icount++;
988 }
989 }
990 }
991
992 /// The number of "DOF types" that degrees of freedom in this element
993 /// are sub-divided into: Velocity and pressure.
994 unsigned ndof_types() const
995 {
996 return DIM + 1;
997 }
998
999 /// Create a list of pairs for all unknowns in this element,
1000 /// so that the first entry in each pair contains the global equation
1001 /// number of the unknown, while the second one contains the number
1002 /// of the "DOF type" that this unknown is associated with.
1003 /// (Function can obviously only be called if the equation numbering
1004 /// scheme has been set up.) Velocity=0; Pressure=1
1006 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
1007 {
1008 // number of nodes
1009 unsigned n_node = this->nnode();
1010
1011 // temporary pair (used to store dof lookup prior to being added to list)
1012 std::pair<unsigned, unsigned> dof_lookup;
1013
1014 // loop over the nodes
1015 for (unsigned n = 0; n < n_node; n++)
1016 {
1017 // find the number of Navier Stokes values at this node
1018 unsigned nv = this->required_nvalue(n);
1019
1020 // loop over these values
1021 for (unsigned v = 0; v < nv; v++)
1022 {
1023 // determine local eqn number
1024 int local_eqn_number = this->nodal_local_eqn(n, v);
1025
1026 // ignore pinned values - far away degrees of freedom resulting
1027 // from hanging nodes can be ignored since these are be dealt
1028 // with by the element containing their master nodes
1029 if (local_eqn_number >= 0)
1030 {
1031 // store dof lookup in temporary pair: Global equation number
1032 // is the first entry in pair
1033 dof_lookup.first = this->eqn_number(local_eqn_number);
1034
1035 // set dof numbers: Dof number is the second entry in pair
1036 dof_lookup.second = v;
1037
1038 // add to list
1039 dof_lookup_list.push_front(dof_lookup);
1040 }
1041 }
1042 }
1043 }
1044 };
1045
1046
1047 // Inline functions
1048
1049 //==========================================================================
1050 /// 2D :
1051 /// Number of pressure values
1052 //==========================================================================
1053 template<>
1054 inline unsigned TTaylorHoodElement<2>::npres_nst() const
1055 {
1056 return 3;
1057 }
1058
1059 //==========================================================================
1060 /// 3D :
1061 /// Number of pressure values
1062 //==========================================================================
1063 template<>
1064 inline unsigned TTaylorHoodElement<3>::npres_nst() const
1065 {
1066 return 4;
1067 }
1068
1069
1070 //==========================================================================
1071 /// 2D :
1072 /// Derivatives of the shape functions and test functions w.r.t to
1073 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1074 /// local and global coordinates.
1075 //==========================================================================
1076 template<unsigned DIM>
1078 const Vector<double>& s,
1079 Shape& psi,
1080 DShape& dpsidx,
1081 Shape& test,
1082 DShape& dtestdx) const
1083 {
1084 // Call the geometrical shape functions and derivatives
1085 double J = this->dshape_eulerian(s, psi, dpsidx);
1086 // Test functions are the shape functions
1087 test.shallow_copy_from(psi);
1088 dtestdx.shallow_copy_from(dpsidx);
1089 // Return the jacobian
1090 return J;
1091 }
1092
1093
1094 //==========================================================================
1095 /// Derivatives of the shape functions and test functions w.r.t to
1096 /// global (Eulerian) coordinates. Return Jacobian of mapping between
1097 /// local and global coordinates.
1098 //==========================================================================
1099 template<unsigned DIM>
1101 const unsigned& ipt,
1102 Shape& psi,
1103 DShape& dpsidx,
1104 Shape& test,
1105 DShape& dtestdx) const
1106 {
1107 // Call the geometrical shape functions and derivatives
1108 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
1109 // Test functions are the shape functions
1110 test.shallow_copy_from(psi);
1111 dtestdx.shallow_copy_from(dpsidx);
1112 // Return the jacobian
1113 return J;
1114 }
1115
1116 //==========================================================================
1117 /// 2D :
1118 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1119 /// Return Jacobian of mapping between local and global coordinates.
1120 //==========================================================================
1121 template<>
1123 const Vector<double>& s,
1124 Shape& ppsi,
1125 DShape& dppsidx,
1126 Shape& ptest,
1127 DShape& dptestdx) const
1128 {
1129 ppsi[0] = s[0];
1130 ppsi[1] = s[1];
1131 ppsi[2] = 1.0 - s[0] - s[1];
1132
1133 dppsidx(0, 0) = 1.0;
1134 dppsidx(0, 1) = 0.0;
1135
1136 dppsidx(1, 0) = 0.0;
1137 dppsidx(1, 1) = 1.0;
1138
1139 dppsidx(2, 0) = -1.0;
1140 dppsidx(2, 1) = -1.0;
1141
1142 // Allocate memory for the inverse 2x2 jacobian
1144
1145
1146 // Get the values of the shape functions and their local derivatives
1147 Shape psi(6);
1148 DShape dpsi(6, 2);
1150
1151 // Now calculate the inverse jacobian
1153
1154 // Now set the values of the derivatives to be derivs w.r.t. to the
1155 // Eulerian coordinates
1157
1158 // Test functions are shape functions
1159 ptest.shallow_copy_from(ppsi);
1160 dptestdx.shallow_copy_from(dppsidx);
1161
1162 // Return the determinant of the jacobian
1163 return det;
1164 }
1165
1166
1167 //==========================================================================
1168 /// 3D :
1169 /// Pressure shape and test functions and derivs w.r.t. to Eulerian coords.
1170 /// Return Jacobian of mapping between local and global coordinates.
1171 //==========================================================================
1172 template<>
1174 const Vector<double>& s,
1175 Shape& ppsi,
1176 DShape& dppsidx,
1177 Shape& ptest,
1178 DShape& dptestdx) const
1179 {
1180 ppsi[0] = s[0];
1181 ppsi[1] = s[1];
1182 ppsi[2] = s[2];
1183 ppsi[3] = 1.0 - s[0] - s[1] - s[2];
1184
1185 dppsidx(0, 0) = 1.0;
1186 dppsidx(0, 1) = 0.0;
1187 dppsidx(0, 2) = 0.0;
1188
1189 dppsidx(1, 0) = 0.0;
1190 dppsidx(1, 1) = 1.0;
1191 dppsidx(1, 2) = 0.0;
1192
1193 dppsidx(2, 0) = 0.0;
1194 dppsidx(2, 1) = 0.0;
1195 dppsidx(2, 2) = 1.0;
1196
1197 dppsidx(3, 0) = -1.0;
1198 dppsidx(3, 1) = -1.0;
1199 dppsidx(3, 2) = -1.0;
1200
1201
1202 // Get the values of the shape functions and their local derivatives
1203 Shape psi(10);
1204 DShape dpsi(10, 3);
1206
1207 // Allocate memory for the inverse 3x3 jacobian
1209
1210 // Now calculate the inverse jacobian
1212
1213 // Now set the values of the derivatives to be derivs w.r.t. to the
1214 // Eulerian coordinates
1216
1217 // Test functions are shape functions
1218 ptest.shallow_copy_from(ppsi);
1219 dptestdx.shallow_copy_from(dppsidx);
1220
1221 // Return the determinant of the jacobian
1222 return det;
1223 }
1224
1225
1226 //==========================================================================
1227 /// 2D :
1228 /// Define the shape functions (psi) and test functions (test) and
1229 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1230 /// and return Jacobian of mapping (J). Additionally compute the
1231 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1232 ///
1233 /// Galerkin: Test functions = shape functions
1234 //==========================================================================
1235 template<>
1237 const unsigned& ipt,
1238 Shape& psi,
1239 DShape& dpsidx,
1241 Shape& test,
1242 DShape& dtestdx,
1245 {
1246 // Call the geometrical shape functions and derivatives
1247 const double J = this->dshape_eulerian_at_knot(
1249
1250 // Set the test functions equal to the shape functions
1251 test.shallow_copy_from(psi);
1252 dtestdx.shallow_copy_from(dpsidx);
1253 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1254
1255 // Return the jacobian
1256 return J;
1257 }
1258
1259
1260 //==========================================================================
1261 /// 3D :
1262 /// Define the shape functions (psi) and test functions (test) and
1263 /// their derivatives w.r.t. global coordinates (dpsidx and dtestdx)
1264 /// and return Jacobian of mapping (J). Additionally compute the
1265 /// derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.
1266 ///
1267 /// Galerkin: Test functions = shape functions
1268 //==========================================================================
1269 template<>
1271 const unsigned& ipt,
1272 Shape& psi,
1273 DShape& dpsidx,
1275 Shape& test,
1276 DShape& dtestdx,
1279 {
1280 // Call the geometrical shape functions and derivatives
1281 const double J = this->dshape_eulerian_at_knot(
1283
1284 // Set the test functions equal to the shape functions
1285 test.shallow_copy_from(psi);
1286 dtestdx.shallow_copy_from(dpsidx);
1287 d_dtestdx_dX.shallow_copy_from(d_dpsidx_dX);
1288
1289 // Return the jacobian
1290 return J;
1291 }
1292
1293
1294 //==========================================================================
1295 /// 2D :
1296 /// Pressure shape functions
1297 //==========================================================================
1298 template<>
1300 Shape& psi) const
1301 {
1302 psi[0] = s[0];
1303 psi[1] = s[1];
1304 psi[2] = 1.0 - s[0] - s[1];
1305 }
1306
1307 //==========================================================================
1308 /// 3D :
1309 /// Pressure shape functions
1310 //==========================================================================
1311 template<>
1313 Shape& psi) const
1314 {
1315 psi[0] = s[0];
1316 psi[1] = s[1];
1317 psi[2] = s[2];
1318 psi[3] = 1.0 - s[0] - s[1] - s[2];
1319 }
1320
1321
1322 //==========================================================================
1323 /// Pressure shape and test functions
1324 //==========================================================================
1325 template<unsigned DIM>
1327 Shape& psi,
1328 Shape& test) const
1329 {
1330 // Call the pressure shape functions
1331 this->pshape_nst(s, psi);
1332 // Test functions are shape functions
1333 test.shallow_copy_from(psi);
1334 }
1335
1336
1337 //=======================================================================
1338 /// Face geometry of the 2D Taylor_Hood elements
1339 //=======================================================================
1340 template<>
1341 class FaceGeometry<TTaylorHoodElement<2>> : public virtual TElement<1, 3>
1342 {
1343 public:
1344 /// Constructor: Call constructor of base
1345 FaceGeometry() : TElement<1, 3>() {}
1346 };
1347
1348
1349 //=======================================================================
1350 /// Face geometry of the 3D Taylor_Hood elements
1351 //=======================================================================
1352 template<>
1353 class FaceGeometry<TTaylorHoodElement<3>> : public virtual TElement<2, 3>
1354 {
1355 public:
1356 /// Constructor: Call constructor of base
1357 FaceGeometry() : TElement<2, 3>() {}
1358 };
1359
1360
1361 //=======================================================================
1362 /// Face geometry of the FaceGeometry of the 2D TaylorHood elements
1363 //=======================================================================
1364 template<>
1366 : public virtual PointElement
1367 {
1368 public:
1370 };
1371
1372
1373 //=======================================================================
1374 /// Face geometry of the FaceGeometry of the 3D Crouzeix_Raviart elements
1375 //=======================================================================
1376 template<>
1378 : public virtual TElement<1, 3>
1379 {
1380 public:
1381 FaceGeometry() : TElement<1, 3>() {}
1382 };
1383
1384
1385} // namespace oomph
1386
1387#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...
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).