generalised_newtonian_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-2024 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  //========================================================================
43  {
44  unsigned n_pres = this->npres_axi_nst();
45  // loop over pressure dofs
46  for (unsigned l = 0; l < n_pres; l++)
47  {
48  // unpin internal pressure
50  }
51  }
52 
53 
54  //=========================================================================
55  /// Add to the set \c paired_load_data pairs containing
56  /// - the pointer to a Data object
57  /// and
58  /// - the index of the value in that Data object
59  /// .
60  /// for all values (pressures, velocities) that affect the
61  /// load computed in the \c get_load(...) function.
62  //=========================================================================
64  identify_load_data(std::set<std::pair<Data*, unsigned>>& paired_load_data)
65  {
66  // Find the index at which the velocity is stored
67  unsigned u_index[3];
68  for (unsigned i = 0; i < 3; i++)
69  {
70  u_index[i] = this->u_index_axi_nst(i);
71  }
72 
73  // Loop over the nodes
74  unsigned n_node = this->nnode();
75  for (unsigned n = 0; n < n_node; n++)
76  {
77  // Loop over the velocity components and add pointer to their data
78  // and indices to the vectors
79  for (unsigned i = 0; i < 3; i++)
80  {
81  paired_load_data.insert(std::make_pair(this->node_pt(n), u_index[i]));
82  }
83  }
84 
85  // Identify the pressure data
86  identify_pressure_data(paired_load_data);
87  }
88 
89 
90  //=========================================================================
91  /// Add to the set \c paired_pressue_data pairs containing
92  /// - the pointer to a Data object
93  /// and
94  /// - the index of the value in that Data object
95  /// .
96  /// for all pressures values that affect the
97  /// load computed in the \c get_load(...) function.
98  //=========================================================================
101  std::set<std::pair<Data*, unsigned>>& paired_pressure_data)
102  {
103  // Loop over the internal data
104  unsigned n_internal = this->ninternal_data();
105  for (unsigned l = 0; l < n_internal; l++)
106  {
107  unsigned nval = this->internal_data_pt(l)->nvalue();
108  // Add internal data
109  for (unsigned j = 0; j < nval; j++)
110  {
111  paired_pressure_data.insert(
112  std::make_pair(this->internal_data_pt(l), j));
113  }
114  }
115  }
116 
117 
118  /// ////////////////////////////////////////////////////////////////////////
119  /// ////////////////////////////////////////////////////////////////////////
120  /// ////////////////////////////////////////////////////////////////////////
121 
122  // Set the data for the number of Variables at each node
123  const unsigned
125  4, 4, 4, 3, 3, 3};
126 
127  // Set the data for the pressure conversion array
129  {0, 1, 2};
130 
131 
132  //========================================================================
133  /// Unpin all pressure dofs, incl the mid-face/side ones where
134  /// they have been allocated (e.g. in the refineable version of this
135  /// element).
136  //========================================================================
139  {
140  unsigned n_node = this->nnode();
141  // loop over nodes
142  for (unsigned l = 0; l < n_node; l++)
143  {
144  if (this->node_pt(l)->nvalue() == 3 + 1)
145  {
146  // unpin pressure dof
147  this->node_pt(l)->unpin(3);
148  }
149  }
150  }
151 
152  //========================================================================
153  /// Pin all nodal pressure dofs, incl the mid-face/side ones where
154  /// they have been allocated (e.g. in the refineable version of this
155  /// element).
156  //========================================================================
159  {
160  // Loop over all nodes and pin pressure
161  unsigned n_node = this->nnode();
162  for (unsigned n = 0; n < n_node; n++)
163  {
164  if (this->node_pt(n)->nvalue() == 3 + 1)
165  {
166  this->node_pt(n)->pin(3);
167  }
168  }
169  }
170 
171  //========================================================================
172  /// Unpin the proper nodal pressure dofs which are not hanging.
173  //========================================================================
176  {
177  // Loop over all pressure nodes and unpin if they're not hanging
178  unsigned n_pres = npres_axi_nst();
179  for (unsigned l = 0; l < n_pres; l++)
180  {
181  Node* nod_pt = this->node_pt(Pconv[l]);
182  if (!nod_pt->is_hanging(3))
183  {
184  nod_pt->unpin(3);
185  }
186  }
187  }
188 
189 
190  //=========================================================================
191  /// Add to the set \c paired_load_data pairs containing
192  /// - the pointer to a Data object
193  /// and
194  /// - the index of the value in that Data object
195  /// .
196  /// for all values (pressures, velocities) that affect the
197  /// load computed in the \c get_load(...) function.
198  //=========================================================================
200  std::set<std::pair<Data*, unsigned>>& paired_load_data)
201  {
202  // Loop over the nodes
203  unsigned n_node = this->nnode();
204  for (unsigned n = 0; n < n_node; n++)
205  {
206  // Loop over the velocity components and add pointer to their data
207  // and indices to the vectors
208  for (unsigned i = 0; i < 3; i++)
209  {
210  paired_load_data.insert(std::make_pair(this->node_pt(n), i));
211  }
212  }
213 
214  // Add the pressure data
215  identify_pressure_data(paired_load_data);
216  }
217 
218  //=========================================================================
219  /// Add to the set \c paired_load_data pairs containing
220  /// - the pointer to a Data object
221  /// and
222  /// - the index of the value in that Data object
223  /// .
224  /// for all values (pressures, velocities) that affect the
225  /// load computed in the \c get_load(...) function.
226  //=========================================================================
229  std::set<std::pair<Data*, unsigned>>& paired_load_data)
230  {
231  // Loop over the pressure data
232  unsigned n_pres = npres_axi_nst();
233  for (unsigned l = 0; l < n_pres; l++)
234  {
235  // The DIMth entry in each nodal data is the pressure, which
236  // affects the traction
237  paired_load_data.insert(std::make_pair(this->node_pt(Pconv[l]), 3));
238  }
239  }
240 
241 } // namespace oomph
cstr elem_len * i
Definition: cfortran.h:603
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:2179
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2214
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:827
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,...
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 identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
unsigned P_axi_nst_internal_index
Internal index that indicates at which internal datum the pressure is stored.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
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
//////////////////////////////////////////////////////////////////// ////////////////////////////////...