Taxisym_navier_stokes_elements.cc
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2023 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Non-inline functions for triangle/tet NS elements
27 
29 
30 
31 namespace oomph
32 {
33  /// ///////////////////////////////////////////////////////////////////
34  /// ///////////////////////////////////////////////////////////////////
35  /// ///////////////////////////////////////////////////////////////////
36 
37 
38  //========================================================================
39  /// Unpin all internal pressure dofs.
40  //========================================================================
42  {
43  unsigned n_pres = this->npres_axi_nst();
44  // loop over pressure dofs
45  for (unsigned l = 0; l < n_pres; l++)
46  {
47  // unpin internal pressure
49  }
50  }
51 
52 
53  //=========================================================================
54  /// Add to the set \c paired_load_data pairs containing
55  /// - the pointer to a Data object
56  /// and
57  /// - the index of the value in that Data object
58  /// .
59  /// for all values (pressures, velocities) that affect the
60  /// load computed in the \c get_load(...) function.
61  //=========================================================================
63  std::set<std::pair<Data*, unsigned>>& paired_load_data)
64  {
65  // Find the index at which the velocity is stored
66  unsigned u_index[3];
67  for (unsigned i = 0; i < 3; i++)
68  {
69  u_index[i] = this->u_index_axi_nst(i);
70  }
71 
72  // Loop over the nodes
73  unsigned n_node = this->nnode();
74  for (unsigned n = 0; n < n_node; n++)
75  {
76  // Loop over the velocity components and add pointer to their data
77  // and indices to the vectors
78  for (unsigned i = 0; i < 3; i++)
79  {
80  paired_load_data.insert(std::make_pair(this->node_pt(n), u_index[i]));
81  }
82  }
83 
84  // Identify the pressure data
85  identify_pressure_data(paired_load_data);
86  }
87 
88 
89  //=========================================================================
90  /// Add to the set \c paired_pressue_data pairs containing
91  /// - the pointer to a Data object
92  /// and
93  /// - the index of the value in that Data object
94  /// .
95  /// for all pressures values that affect the
96  /// load computed in the \c get_load(...) function.
97  //=========================================================================
99  std::set<std::pair<Data*, unsigned>>& paired_pressure_data)
100  {
101  // Loop over the internal data
102  unsigned n_internal = this->ninternal_data();
103  for (unsigned l = 0; l < n_internal; l++)
104  {
105  unsigned nval = this->internal_data_pt(l)->nvalue();
106  // Add internal data
107  for (unsigned j = 0; j < nval; j++)
108  {
109  paired_pressure_data.insert(
110  std::make_pair(this->internal_data_pt(l), j));
111  }
112  }
113  }
114 
115 
116  /// ////////////////////////////////////////////////////////////////////////
117  /// ////////////////////////////////////////////////////////////////////////
118  /// ////////////////////////////////////////////////////////////////////////
119 
120  // Set the data for the number of Variables at each node
122  4, 4, 4, 3, 3, 3};
123 
124  // Set the data for the pressure conversion array
125  const unsigned AxisymmetricTTaylorHoodElement::Pconv[3] = {0, 1, 2};
126 
127 
128  //========================================================================
129  /// Unpin all pressure dofs, incl the mid-face/side ones where
130  /// they have been allocated (e.g. in the refineable version of this
131  /// element).
132  //========================================================================
134  {
135  unsigned n_node = this->nnode();
136  // loop over nodes
137  for (unsigned l = 0; l < n_node; l++)
138  {
139  if (this->node_pt(l)->nvalue() == 3 + 1)
140  {
141  // unpin pressure dof
142  this->node_pt(l)->unpin(3);
143  }
144  }
145  }
146 
147  //========================================================================
148  /// Pin all nodal pressure dofs, incl the mid-face/side ones where
149  /// they have been allocated (e.g. in the refineable version of this
150  /// element).
151  //========================================================================
153  {
154  // Loop over all nodes and pin pressure
155  unsigned n_node = this->nnode();
156  for (unsigned n = 0; n < n_node; n++)
157  {
158  if (this->node_pt(n)->nvalue() == 3 + 1)
159  {
160  this->node_pt(n)->pin(3);
161  }
162  }
163  }
164 
165  //========================================================================
166  /// Unpin the proper nodal pressure dofs which are not hanging.
167  //========================================================================
169  {
170  // Loop over all pressure nodes and unpin if they're not hanging
171  unsigned n_pres = npres_axi_nst();
172  for (unsigned l = 0; l < n_pres; l++)
173  {
174  Node* nod_pt = this->node_pt(Pconv[l]);
175  if (!nod_pt->is_hanging(3))
176  {
177  nod_pt->unpin(3);
178  }
179  }
180  }
181 
182 
183  //=========================================================================
184  /// Add to the set \c paired_load_data pairs containing
185  /// - the pointer to a Data object
186  /// and
187  /// - the index of the value in that Data object
188  /// .
189  /// for all values (pressures, velocities) that affect the
190  /// load computed in the \c get_load(...) function.
191  //=========================================================================
193  std::set<std::pair<Data*, unsigned>>& paired_load_data)
194  {
195  // Loop over the nodes
196  unsigned n_node = this->nnode();
197  for (unsigned n = 0; n < n_node; n++)
198  {
199  // Loop over the velocity components and add pointer to their data
200  // and indices to the vectors
201  for (unsigned i = 0; i < 3; i++)
202  {
203  paired_load_data.insert(std::make_pair(this->node_pt(n), i));
204  }
205  }
206 
207  // Add the pressure data
208  identify_pressure_data(paired_load_data);
209  }
210 
211  //=========================================================================
212  /// Add to the set \c paired_load_data pairs containing
213  /// - the pointer to a Data object
214  /// and
215  /// - the index of the value in that Data object
216  /// .
217  /// for all values (pressures, velocities) that affect the
218  /// load computed in the \c get_load(...) function.
219  //=========================================================================
221  std::set<std::pair<Data*, unsigned>>& paired_load_data)
222  {
223  // Loop over the pressure data
224  unsigned n_pres = npres_axi_nst();
225  for (unsigned l = 0; l < n_pres; l++)
226  {
227  // The DIMth entry in each nodal data is the pressure, which
228  // affects the traction
229  paired_load_data.insert(std::make_pair(this->node_pt(Pconv[l]), 3));
230  }
231  }
232 
233 } // namespace oomph
cstr elem_len * i
Definition: cfortran.h:603
virtual unsigned u_index_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
unsigned P_axi_nst_internal_index
Internal index that indicates at which internal datum the pressure is stored.
unsigned npres_axi_nst() const
Return number of pressure values.
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
void unpin_all_internal_pressure_dofs()
Unpin all internal pressure dofs.
void unpin_all_nodal_pressure_dofs()
Unpin all pressure dofs.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned npres_axi_nst() const
Return number of pressure values.
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void pin_all_nodal_pressure_dofs()
Pin all nodal pressure dofs.
void unpin_proper_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:391
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:906
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
//////////////////////////////////////////////////////////////////// ////////////////////////////////...