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