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// Version 1.0; svn revision $LastChangedRevision: 1194 $
7 //LIC//
8 //LIC// $LastChangedDate: 2016-05-27 08:44:43 +0100 (Fri, 27 May 2016) $
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
128 Initial_Nvalue[6]={4,4,4,3,3,3};
129 
130 //Set the data for the pressure conversion array
132 Pconv[3]={0,1,2};
133 
134 
135 //========================================================================
136 /// Unpin all pressure dofs, incl the mid-face/side ones where
137 /// they have been allocated (e.g. in the refineable version of this
138 /// element).
139 //========================================================================
142 {
143  unsigned n_node = this->nnode();
144  // loop over nodes
145  for(unsigned l=0;l<n_node;l++)
146  {
147  if (this->node_pt(l)->nvalue()==3+1)
148  {
149  // unpin pressure dof
150  this->node_pt(l)->unpin(3);
151  }
152  }
153 }
154 
155 //========================================================================
156 /// Pin all nodal pressure dofs, incl the mid-face/side ones where
157 /// they have been allocated (e.g. in the refineable version of this
158 /// element).
159 //========================================================================
162 {
163  // Loop over all nodes and pin pressure
164  unsigned n_node = this->nnode();
165  for(unsigned n=0;n<n_node;n++)
166  {
167  if (this->node_pt(n)->nvalue()==3+1)
168  {
169  this->node_pt(n)->pin(3);
170  }
171  }
172 }
173 
174 //========================================================================
175 /// Unpin the proper nodal pressure dofs which are not hanging.
176 //========================================================================
179 {
180 
181  // Loop over all pressure nodes and unpin if they're not hanging
182  unsigned n_pres = npres_axi_nst();
183  for(unsigned l=0;l<n_pres;l++)
184  {
185  Node* nod_pt = this->node_pt(Pconv[l]);
186  if (!nod_pt->is_hanging(3)) {nod_pt->unpin(3);}
187  }
188 }
189 
190 
191 //=========================================================================
192 /// Add to the set \c paired_load_data pairs containing
193 /// - the pointer to a Data object
194 /// and
195 /// - the index of the value in that Data object
196 /// .
197 /// for all values (pressures, velocities) that affect the
198 /// load computed in the \c get_load(...) function.
199 //=========================================================================
201 identify_load_data(std::set<std::pair<Data*,unsigned> > &paired_load_data)
202 {
203  //Loop over the nodes
204  unsigned n_node = this->nnode();
205  for(unsigned n=0;n<n_node;n++)
206  {
207  //Loop over the velocity components and add pointer to their data
208  //and indices to the vectors
209  for(unsigned i=0;i<3;i++)
210  {
211  paired_load_data.insert(std::make_pair(this->node_pt(n),i));
212  }
213  }
214 
215  //Add the pressure data
216  identify_pressure_data(paired_load_data);
217 }
218 
219 //=========================================================================
220 /// Add to the set \c paired_load_data pairs containing
221 /// - the pointer to a Data object
222 /// and
223 /// - the index of the value in that Data object
224 /// .
225 /// for all values (pressures, velocities) that affect the
226 /// load computed in the \c get_load(...) function.
227 //=========================================================================
229 identify_pressure_data(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 }
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:386
cstr elem_len * i
Definition: cfortran.h:607
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers...
virtual unsigned u_index_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component.
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_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:852
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:448
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:383
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...
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1207
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:623
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2097
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:828
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2134
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.