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