topologically_rectangular_domain.h
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 // Include guards
27 #ifndef OOMPH_TOPOLOGICALLY_RECTANGULAR_DOMAIN_HEADER
28 #define OOMPH_TOPOLOGICALLY_RECTANGULAR_DOMAIN_HEADER
29 
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 
37 // oomph-lib headers
38 #include "../generic/domain.h"
39 
40 
41 namespace oomph
42 {
43  //=============================================================================
44  /// Topologically Rectangular Domain - a domain dexcribing a
45  /// topologically rectangular problem - primarily contains functions to access
46  /// the position of the global boundary relative to the macro element
47  /// boundary, as well as first and second derivates of the global boundary wrt
48  /// the macro element boundary NOTE : suitable for HermiteElementQuadMesh
49  //=============================================================================
50  class TopologicallyRectangularDomain : public Domain
51  {
52  public:
53  /// boundary function pointer - for a given boundary takes the
54  /// macro element coordinate position on that boundary and for that position
55  /// returns the global coordinates (x) coordinates, or derivatives -
56  /// dx_i/dm_t or second derivatives d2x_i/dm_t^2
57  typedef void (*BoundaryFctPt)(const double& s, Vector<double>& r);
58 
59 
60  /// Constructor - domain boundaries are described with four boundary
61  /// function pointers describing the topology of the north, east, south, and
62  /// west boundaries
64  BoundaryFctPt east_pt,
65  BoundaryFctPt south_pt,
66  BoundaryFctPt west_pt);
67 
68 
69  /// Constructor - takes length of domain in x and y direction as
70  /// arguements. Assumes domain is rectangular, and the south west (lower
71  /// left) corner is at 0,0.
72  TopologicallyRectangularDomain(const double& l_x, const double& l_y);
73 
74 
75  /// Constructor - takes the minimum and maximum coordinates of the
76  /// of an assumed rectanguler domain in the x and y direction
77  TopologicallyRectangularDomain(const double& x_min,
78  const double& x_max,
79  const double& y_min,
80  const double& y_max);
81 
82 
83  /// Broken copy constructor
85  delete;
86 
87  /// Broken assignment operator
89 
90  /// Destructor - empty; clean up done in base class
92 
93 
94  /// allows the boundary derivate function pointers to be set. To
95  /// compute the derivatives of the problem domain global coordinates (x_i)
96  /// wrt the macro element coordinates (m_i), dx_i/dm_t is required along the
97  /// domain boundaries (where dm_t is the macro element coordinate tangential
98  /// to the domain boundary). The derivatives dx_i/dm_t can either be
99  /// prescribed with function pointers, or if the function pointers are not
100  /// provided then dx_i/dm_t is computed with finite differencing.
101  /// Note - these functions are only required for domains contructed with
102  /// boundary function pointers
104  BoundaryFctPt d_east_pt,
105  BoundaryFctPt d_south_pt,
106  BoundaryFctPt d_west_pt);
107 
108 
109  /// allows the boundary second derivate function pointers to be set.
110  /// To compute the second derivatives of the problem domain global
111  /// coordinates (x_i) wrt the macro element coordinates (m_i), d2x_i/dm_t^2
112  /// is required along the domain boundaries (where dm_t is the macro element
113  /// coordinate tangential to the domain boundary). The derivatives
114  /// d2x_i/dm_t^2 can either be prescribed with function pointers, or if the
115  /// function pointers are not provided then dx_i/dm_t is computed with
116  /// finite differencing. Note - these functions are only required for
117  /// domains contructed with boundary function pointers
119  BoundaryFctPt d2_east_pt,
120  BoundaryFctPt d2_south_pt,
121  BoundaryFctPt d2_west_pt);
122 
123 
124  /// returns the global coordinate position (f) of macro element position s
125  /// on boundary i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)
126  void macro_element_boundary(const unsigned& t,
127  const unsigned& i_macro,
128  const unsigned& i_direct,
129  const Vector<double>& s,
130  Vector<double>& f);
131 
132 
133  /// returns the derivates of the global coordinate position (f) wrt to the
134  /// macro element coordinate at macro macro element position s on boundary
135  /// i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)
136  void dmacro_element_boundary(const unsigned& t,
137  const unsigned& i_macro,
138  const unsigned& i_direct,
139  const Vector<double>& s,
140  Vector<double>& f);
141 
142 
143  /// returns the second derivates of the global coordinate position (f) wrt
144  /// to the macro element coordinate at macro macro element position s on
145  /// boundary i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)
146  void d2macro_element_boundary(const unsigned& t,
147  const unsigned& i_macro,
148  const unsigned& i_direct,
149  const Vector<double>& s,
150  Vector<double>& f);
151 
152 
153  private:
154  /// Function pointer to prescribe the north boundary of this
155  /// topologically rectangular domain
157 
158  /// Function pointer to prescribe the east boundary of this
159  /// topologically rectangular domain
161 
162  /// Function pointer to prescribe the north boundary of this
163  /// topologically rectangular domain
165 
166  /// Function pointer to prescribe the west boundary of this
167  /// topologically rectangular domain
169 
170 
171  /// Function pointer to prescribe the derivates of global coordinates
172  /// wrt to the macro element coordinate tangential to the north boundary
174 
175  /// Function pointer to prescribe the derivates of global coordinates
176  /// wrt to the macro element coordinate tangential to the east boundary
178 
179  /// Function pointer to prescribe the derivates of global coordinates
180  /// wrt to the macro element coordinate tangential to the south boundary
182 
183  /// Function pointer to prescribe the derivates of global coordinates
184  /// wrt to the macro element coordinate tangential to the west boundary
186 
187 
188  /// Function pointer to prescribe the second derivates of global
189  /// coordinates wrt to the macro element coordinate tangential to the north
190  /// boundary
192 
193  /// Function pointer to prescribe the second derivates of global
194  /// coordinates wrt to the macro element coordinate tangential to the east
195  /// boundary
197 
198  /// Function pointer to prescribe the second derivates of global
199  /// coordinates wrt to the macro element coordinate tangential to the south
200  /// boundary
202 
203  /// Function pointer to prescribe the second derivates of global
204  /// coordinates wrt to the macro element coordinate tangential to the west
205  /// boundary
207 
208 
209  /// coordinate position of south west corner of domain (only used if
210  /// boundary functions are not used)
211  Vector<double> x_south_west;
212 
213  /// coordinate position of north east corner of domain (only used if
214  /// boundary functions are not used)
215  Vector<double> x_north_east;
216 
217 
218  /// takes the macro element coordinate position along the north
219  /// boundary and returns the global coordinate position along that boundary
220  void r_N(const Vector<double>& s, Vector<double>& f);
221 
222  /// takes the macro element coordinate position along the east
223  /// boundary and returns the global coordinate position along that boundary
224  void r_E(const Vector<double>& s, Vector<double>& f);
225 
226  /// takes the macro element coordinate position along the south
227  /// boundary and returns the global coordinate position along that boundary
228  void r_S(const Vector<double>& s, Vector<double>& f);
229 
230  /// takes the macro element coordinate position along the west
231  /// boundary and returns the global coordinate position along that boundary
232  /// access down boundary function pointer
233  void r_W(const Vector<double>& s, Vector<double>& f);
234 
235 
236  /// takes the macro element coordinate position along the north
237  /// boundary and returns the derivates of the global coordinates with
238  /// respect to the boundary
239  void dr_N(const Vector<double>& s, Vector<double>& dr);
240 
241  /// takes the macro element coordinate position along the E
242  /// boundary and returns the derivates of the global coordinates with
243  /// respect to the boundary
244  void dr_E(const Vector<double>& s, Vector<double>& dr);
245 
246  /// takes the macro element coordinate position along the south
247  /// boundary and returns the derivates of the global coordinates with
248  /// respect to the boundary
249  void dr_S(const Vector<double>& s, Vector<double>& dr);
250 
251  /// takes the macro element coordinate position along the W
252  /// boundary and returns the derivates of the global coordinates with
253  /// respect to the boundary
254  void dr_W(const Vector<double>& s, Vector<double>& dr);
255 
256 
257  /// takes the macro element coordinate position along the north
258  /// boundary and returns the second derivates of the global coordinates with
259  /// respect to the boundary
260  void d2r_N(const Vector<double>& s, Vector<double>& d2r);
261 
262  /// takes the macro element coordinate position along the east
263  /// boundary and returns the second derivates of the global coordinates with
264  /// respect to the boundary
265  void d2r_E(const Vector<double>& s, Vector<double>& d2r);
266 
267  /// takes the macro element coordinate position along the south
268  /// boundary and returns the second derivates of the global coordinates with
269  /// respect to the boundary
270  void d2r_S(const Vector<double>& s, Vector<double>& d2r);
271 
272  /// takes the macro element coordinate position along the west
273  /// boundary and returns the second derivates of the global coordinates with
274  /// respect to the boundary
275  void d2r_W(const Vector<double>& s, Vector<double>& d2r);
276  };
277 } // namespace oomph
278 #endif
Topologically Rectangular Domain - a domain dexcribing a topologically rectangular problem - primaril...
void r_E(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the east boundary and returns the global coordinate...
void d2macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the second derivates of the global coordinate position (f) wrt to the macro element coordinat...
BoundaryFctPt d2North_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void dmacro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the derivates of the global coordinate position (f) wrt to the macro element coordinate at ma...
void dr_E(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the E boundary and returns the derivates of the glo...
void dr_S(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the south boundary and returns the derivates of the...
void operator=(const TopologicallyRectangularDomain &)=delete
Broken assignment operator.
Vector< double > x_south_west
coordinate position of south west corner of domain (only used if boundary functions are not used)
BoundaryFctPt d2East_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void d2r_W(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the west boundary and returns the second derivates ...
BoundaryFctPt South_boundary_fn_pt
Function pointer to prescribe the north boundary of this topologically rectangular domain.
TopologicallyRectangularDomain(const TopologicallyRectangularDomain &)=delete
Broken copy constructor.
void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
returns the global coordinate position (f) of macro element position s on boundary i_direct (e....
BoundaryFctPt dEast_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
BoundaryFctPt d2West_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void set_boundary_second_derivative_functions(BoundaryFctPt d2_north_pt, BoundaryFctPt d2_east_pt, BoundaryFctPt d2_south_pt, BoundaryFctPt d2_west_pt)
allows the boundary second derivate function pointers to be set. To compute the second derivatives of...
void r_N(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the north boundary and returns the global coordinat...
void d2r_N(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the north boundary and returns the second derivates...
BoundaryFctPt d2South_boundary_fn_pt
Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coo...
void r_S(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the south boundary and returns the global coordinat...
BoundaryFctPt North_boundary_fn_pt
Function pointer to prescribe the north boundary of this topologically rectangular domain.
void set_boundary_derivative_functions(BoundaryFctPt d_north_pt, BoundaryFctPt d_east_pt, BoundaryFctPt d_south_pt, BoundaryFctPt d_west_pt)
allows the boundary derivate function pointers to be set. To compute the derivatives of the problem d...
void(* BoundaryFctPt)(const double &s, Vector< double > &r)
boundary function pointer - for a given boundary takes the macro element coordinate position on that ...
BoundaryFctPt dWest_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
void dr_W(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the W boundary and returns the derivates of the glo...
void r_W(const Vector< double > &s, Vector< double > &f)
takes the macro element coordinate position along the west boundary and returns the global coordinate...
~TopologicallyRectangularDomain()
Destructor - empty; clean up done in base class.
void d2r_E(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the east boundary and returns the second derivates ...
BoundaryFctPt West_boundary_fn_pt
Function pointer to prescribe the west boundary of this topologically rectangular domain.
BoundaryFctPt East_boundary_fn_pt
Function pointer to prescribe the east boundary of this topologically rectangular domain.
TopologicallyRectangularDomain(BoundaryFctPt north_pt, BoundaryFctPt east_pt, BoundaryFctPt south_pt, BoundaryFctPt west_pt)
Constructor - domain boundaries are described with four boundary function pointers describing the top...
void dr_N(const Vector< double > &s, Vector< double > &dr)
takes the macro element coordinate position along the north boundary and returns the derivates of the...
void d2r_S(const Vector< double > &s, Vector< double > &d2r)
takes the macro element coordinate position along the south boundary and returns the second derivates...
Vector< double > x_north_east
coordinate position of north east corner of domain (only used if boundary functions are not used)
BoundaryFctPt dSouth_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
BoundaryFctPt dNorth_boundary_fn_pt
Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate...
////////////////////////////////////////////////////////////////////// //////////////////////////////...