Qelement_face_coordinate_translation_schemes.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 //The guts of the face translation schemes
32 
33 namespace oomph
34 {
35 //=============================================================
36 ///Namespace for helper functions that return the local
37 ///coordinates in the bulk elements
38 //==============================================================
39 namespace QElement1FaceToBulkCoordinates
40 {
41  ///The translation scheme for the face s0 = -1.0
42  void face0(const Vector<double> &s, Vector<double> &s_bulk)
43  {
44  s_bulk[0] = -1.0;
45  }
46 
47  ///The translation scheme for the face s0 = 1.0
48  void face1(const Vector<double> &s, Vector<double> &s_bulk)
49  {
50  s_bulk[0] = 1.0;
51  }
52 }
53 
54 
55 //=============================================================
56 /// Namespace for helper functions that calculate derivatives
57 /// of the local coordinates in the bulk elements wrt the
58 /// local coordinates in the face element.
59 //=============================================================
60 namespace QElement1BulkCoordinateDerivatives
61 {
62  ///Function for both faces -- the bulk coordinate is fixed on both
63  void faces0(const Vector<double> &s,
64  DenseMatrix<double> &dsbulk_dsface,
65  unsigned &interior_direction)
66  {
67  //Bulk coordinate s[0] does not vary along the face
68  dsbulk_dsface(0,0) = 0.0;
69 
70  //The interior direction is given by s[0]
71  interior_direction=0;
72  }
73 }
74 
75 
76 
77 
78 //===================================================================
79 /// Namespace for the functions that translate local face coordinates
80 /// to the coordinates in the bulk element
81 //==================================================================
82 namespace QElement2FaceToBulkCoordinates
83 {
84  ///The translation scheme for the west face (s0 = -1.0)
85  void face0(const Vector<double> &s, Vector<double> &s_bulk)
86  {
87  s_bulk[0] = -1.0;
88  s_bulk[1] = s[0];
89  }
90 
91  ///The translation scheme for the south face (s1 = -1.0)
92  void face1(const Vector<double> &s, Vector<double> &s_bulk)
93  {
94  s_bulk[0] = s[0];
95  s_bulk[1] = -1.0;
96  }
97 
98  ///The translation scheme for the east face (s0 = 1.0)
99  void face2(const Vector<double> &s, Vector<double> &s_bulk)
100  {
101  s_bulk[0] = 1.0;
102  s_bulk[1] = s[0];
103  }
104 
105  ///The translation scheme for the north face (s1 = 1.0)
106  void face3(const Vector<double> &s, Vector<double> &s_bulk)
107  {
108  s_bulk[0] = s[0];
109  s_bulk[1] = 1.0;
110  }
111 }
112 
113 
114 //=============================================================
115 /// Namespace for helper functions that calculate derivatives
116 /// of the local coordinates in the bulk elements wrt the
117 /// local coordinates in the face element.
118 //=============================================================
119 namespace QElement2BulkCoordinateDerivatives
120 {
121  ///Function for the east and west faces, along which s0 is fixed
122  void faces0(const Vector<double> &s,
123  DenseMatrix<double> &dsbulk_dsface,
124  unsigned &interior_direction)
125  {
126  //Bulk coordinate s[0] does not vary along the face
127  dsbulk_dsface(0,0) = 0.0;
128  //Bulk coordinate s[1] is the face coordinate
129  dsbulk_dsface(1,0) = 1.0;
130 
131  //The interior direction is given by s[0]
132  interior_direction=0;
133  }
134 
135 
136  ///Function for the north and south faces, along which s1 is fixed
137  void faces1(const Vector<double> &s,
138  DenseMatrix<double> &dsbulk_dsface,
139  unsigned &interior_direction)
140  {
141  //Bulk coordinate s[0] is the face coordinate
142  dsbulk_dsface(0,0) = 1.0;
143  //Bulk coordinate s[1] does not vary along the face
144  dsbulk_dsface(1,0) = 0.0;
145 
146  //The interior direction is given by s[1]
147  interior_direction=1;
148  }
149 }
150 
151 
152 //===================================================================
153 /// Namespace for the functions that translate local face coordinates
154 /// to the coordinates in the bulk element
155 //==================================================================
156 namespace QElement3FaceToBulkCoordinates
157 {
158  ///The translation scheme for the left face (s0 = -1.0)
159  void face0(const Vector<double> &s, Vector<double> &s_bulk)
160  {
161  s_bulk[0] = -1.0;
162  s_bulk[1] = s[0];
163  s_bulk[2] = s[1];
164  }
165 
166  ///The translation scheme for the down face (s1 = -1.0)
167  void face1(const Vector<double> &s, Vector<double> &s_bulk)
168  {
169  s_bulk[0] = s[0];
170  s_bulk[1] = -1.0;
171  s_bulk[2] = s[1];
172  }
173 
174  ///The translation scheme for the back face (s2 = -1.0)
175  void face2(const Vector<double> &s, Vector<double> &s_bulk)
176  {
177  s_bulk[0] = s[0];
178  s_bulk[1] = s[1];
179  s_bulk[2] = -1.0;
180  }
181 
182  ///The translation scheme for the right face (s0 = 1.0)
183  void face3(const Vector<double> &s, Vector<double> &s_bulk)
184  {
185  s_bulk[0] = 1.0;
186  s_bulk[1] = s[0];
187  s_bulk[2] = s[1];
188  }
189 
190  ///The translation scheme for the up face (s1 = 1.0)
191  void face4(const Vector<double> &s, Vector<double> &s_bulk)
192  {
193  s_bulk[0] = s[0];
194  s_bulk[1] = 1.0;
195  s_bulk[2] = s[1];
196  }
197 
198  ///The translation scheme for the front face (s2 = 1.0)
199  void face5(const Vector<double> &s, Vector<double> &s_bulk)
200  {
201  s_bulk[0] = s[0];
202  s_bulk[1] = s[1];
203  s_bulk[2] = 1.0;
204  }
205 }
206 
207 
208 //=============================================================
209 /// Namespace for helper functions that calculate derivatives
210 /// of the local coordinates in the bulk elements wrt the
211 /// local coordinates in the face element.
212 //=============================================================
213 namespace QElement3BulkCoordinateDerivatives
214 {
215  ///Function for the back and front faces, along which s0 is fixed
216  void faces0(const Vector<double> &s,
217  DenseMatrix<double> &dsbulk_dsface,
218  unsigned &interior_direction)
219  {
220  //Bulk coordinate s[0] does not vary along the face
221  dsbulk_dsface(0,0) = 0.0;
222  dsbulk_dsface(0,1) = 0.0;
223  //Bulk coordinate s[1] is the face coordinate 1
224  dsbulk_dsface(1,0) = 1.0;
225  dsbulk_dsface(1,1) = 0.0;
226  //Bulk coordinate s[2] is the face coordinate 2
227  dsbulk_dsface(2,0) = 0.0;
228  dsbulk_dsface(2,1) = 1.0;
229 
230  //The interior direction is given by s[0]
231  interior_direction=0;
232  }
233 
234 
235  ///Function for the up and down faces, along which s1 is fixed
236  void faces1(const Vector<double> &s,
237  DenseMatrix<double> &dsbulk_dsface,
238  unsigned &interior_direction)
239  {
240  //Bulk coordinate s[0] is face coordinate 0
241  dsbulk_dsface(0,0) = 1.0;
242  dsbulk_dsface(0,1) = 0.0;
243  //Bulk coordinate s[1] is fixed on the face
244  dsbulk_dsface(1,0) = 0.0;
245  dsbulk_dsface(1,1) = 0.0;
246  //Bulk coordinate s[2] is the face coordinate 2
247  dsbulk_dsface(2,0) = 0.0;
248  dsbulk_dsface(2,1) = 1.0;
249 
250  //The interior direction is given by s[1]
251  interior_direction=1;
252  }
253 
254  ///Function for the left and right faces, along which s2 is fixed
255  void faces2(const Vector<double> &s,
256  DenseMatrix<double> &dsbulk_dsface,
257  unsigned &interior_direction)
258  {
259  //Bulk coordinate s[0] is face coordinate 0
260  dsbulk_dsface(0,0) = 1.0;
261  dsbulk_dsface(0,1) = 0.0;
262  //Bulk coordinate s[1] is face coordinate 1
263  dsbulk_dsface(1,0) = 0.0;
264  dsbulk_dsface(1,1) = 1.0;
265  //Bulk coordinate s[2] is fixed on the face
266  dsbulk_dsface(2,0) = 0.0;
267  dsbulk_dsface(2,1) = 0.0;
268 
269  //The interior direction is given by s[2]
270  interior_direction=2;
271  }
272 }
273 
274 }
void face0(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the face s0 = -1.0.
void face1(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the face s0 = 1.0.
void face2(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the back face (s2 = -1.0)
void faces1(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the up and down faces, along which s1 is fixed.
void face4(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the up face (s1 = 1.0)
void faces0(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the back and front faces, along which s0 is fixed.
static char t char * s
Definition: cfortran.h:572
void faces2(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the left and right faces, along which s2 is fixed.
void face3(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the right face (s0 = 1.0)
void face5(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the front face (s2 = 1.0)