oomph::TopologicallyRectangularDomain Class Reference

#include <topologically_rectangular_domain.h>

+ Inheritance diagram for oomph::TopologicallyRectangularDomain:

Public Types

typedef void(* BoundaryFctPt) (const double &s, Vector< double > &r)
 

Public Member Functions

 TopologicallyRectangularDomain (BoundaryFctPt north_pt, BoundaryFctPt east_pt, BoundaryFctPt south_pt, BoundaryFctPt west_pt)
 
 TopologicallyRectangularDomain (const double &l_x, const double &l_y)
 
 TopologicallyRectangularDomain (const double &x_min, const double &x_max, const double &y_min, const double &y_max)
 
 TopologicallyRectangularDomain (const TopologicallyRectangularDomain &)=delete
 Broken copy constructor. More...
 
void operator= (const TopologicallyRectangularDomain &)=delete
 Broken assignment operator. More...
 
 ~TopologicallyRectangularDomain ()
 Destructor - empty; clean up done in base class. More...
 
void set_boundary_derivative_functions (BoundaryFctPt d_north_pt, BoundaryFctPt d_east_pt, BoundaryFctPt d_south_pt, BoundaryFctPt d_west_pt)
 
void set_boundary_second_derivative_functions (BoundaryFctPt d2_north_pt, BoundaryFctPt d2_east_pt, BoundaryFctPt d2_south_pt, BoundaryFctPt d2_west_pt)
 
void macro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void dmacro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void d2macro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
- Public Member Functions inherited from oomph::Domain
 Domain ()
 Constructor. More...
 
 Domain (const Domain &)=delete
 Broken copy constructor. More...
 
void operator= (const Domain &)=delete
 Broken assignment operator. More...
 
virtual ~Domain ()
 
MacroElementmacro_element_pt (const unsigned &i)
 Access to i-th macro element. More...
 
unsigned nmacro_element ()
 Number of macro elements in domain. More...
 
void output (const std::string &filename, const unsigned &nplot)
 Output macro elements. More...
 
void output (std::ostream &outfile, const unsigned &nplot)
 Output macro elements. More...
 
virtual void macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void output_macro_element_boundaries (const std::string &filename, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
void output_macro_element_boundaries (std::ostream &outfile, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
virtual void dmacro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void dmacro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void d2macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void d2macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 

Private Member Functions

void r_N (const Vector< double > &s, Vector< double > &f)
 
void r_E (const Vector< double > &s, Vector< double > &f)
 
void r_S (const Vector< double > &s, Vector< double > &f)
 
void r_W (const Vector< double > &s, Vector< double > &f)
 
void dr_N (const Vector< double > &s, Vector< double > &dr)
 
void dr_E (const Vector< double > &s, Vector< double > &dr)
 
void dr_S (const Vector< double > &s, Vector< double > &dr)
 
void dr_W (const Vector< double > &s, Vector< double > &dr)
 
void d2r_N (const Vector< double > &s, Vector< double > &d2r)
 
void d2r_E (const Vector< double > &s, Vector< double > &d2r)
 
void d2r_S (const Vector< double > &s, Vector< double > &d2r)
 
void d2r_W (const Vector< double > &s, Vector< double > &d2r)
 

Private Attributes

BoundaryFctPt North_boundary_fn_pt
 
BoundaryFctPt East_boundary_fn_pt
 
BoundaryFctPt South_boundary_fn_pt
 
BoundaryFctPt West_boundary_fn_pt
 
BoundaryFctPt dNorth_boundary_fn_pt
 
BoundaryFctPt dEast_boundary_fn_pt
 
BoundaryFctPt dSouth_boundary_fn_pt
 
BoundaryFctPt dWest_boundary_fn_pt
 
BoundaryFctPt d2North_boundary_fn_pt
 
BoundaryFctPt d2East_boundary_fn_pt
 
BoundaryFctPt d2South_boundary_fn_pt
 
BoundaryFctPt d2West_boundary_fn_pt
 
Vector< doublex_south_west
 
Vector< doublex_north_east
 

Additional Inherited Members

- Protected Attributes inherited from oomph::Domain
Vector< MacroElement * > Macro_element_pt
 Vector of pointers to macro elements. More...
 

Detailed Description

Topologically Rectangular Domain - a domain dexcribing a topologically rectangular problem - primarily contains functions to access the position of the global boundary relative to the macro element boundary, as well as first and second derivates of the global boundary wrt the macro element boundary NOTE : suitable for HermiteElementQuadMesh

Member Typedef Documentation

◆ BoundaryFctPt

typedef void(* oomph::TopologicallyRectangularDomain::BoundaryFctPt) (const double &s, Vector< double > &r)

boundary function pointer - for a given boundary takes the macro element coordinate position on that boundary and for that position returns the global coordinates (x) coordinates, or derivatives - dx_i/dm_t or second derivatives d2x_i/dm_t^2

Constructor & Destructor Documentation

◆ TopologicallyRectangularDomain() [1/4]

oomph::TopologicallyRectangularDomain::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 topology of the north, east, south, and west boundaries

41  {
42  // domain comprises one macro element
43  Macro_element_pt.resize(1);
44 
45  // Create the macro element
46  Macro_element_pt[0] = new QMacroElement<2>(this, 0);
47 
48  // set boundary function pointers
49  North_boundary_fn_pt = north_pt;
50  East_boundary_fn_pt = east_pt;
51  South_boundary_fn_pt = south_pt;
52  West_boundary_fn_pt = west_pt;
53 
54  // by default derivative boundary function pointers are null
59 
60  // also by default second derivate boundary function pointers are null
65 
66  // paranoid self check to ensure that ends of boundaries meet
67 #ifdef PARANOID
68  // error message stream
69  std::ostringstream error_message;
70  bool error_flag = false;
71  // check NE corner
72  {
73  Vector<double> x_N(2);
74  (*North_boundary_fn_pt)(1.0, x_N);
75  Vector<double> x_E(2);
76  (*East_boundary_fn_pt)(1.0, x_E);
77  if (x_N[0] != x_E[0] || x_N[1] != x_E[1])
78  {
79  error_message << "North and East Boundaries do not meet at the "
80  << "North East Corner.\n"
81  << "North Boundary : x[0] = " << x_N[0] << "\n"
82  << " x[1] = " << x_N[1] << "\n"
83  << "East Boundary : x[0] = " << x_E[0] << "\n"
84  << " x[1] = " << x_E[1] << "\n\n";
85  error_flag = true;
86  }
87  }
88  // check SE corner
89  {
90  Vector<double> x_S(2);
91  (*South_boundary_fn_pt)(1.0, x_S);
92  Vector<double> x_E(2);
93  (*East_boundary_fn_pt)(-1.0, x_E);
94  if (x_S[0] != x_E[0] || x_S[1] != x_E[1])
95  {
96  error_message << "South and East Boundaries do not meet at the "
97  << "South East Corner.\n"
98  << "South Boundary : x[0] = " << x_S[0] << "\n"
99  << " x[1] = " << x_S[1] << "\n"
100  << "East Boundary : x[0] = " << x_E[0] << "\n"
101  << " x[1] = " << x_E[1] << "\n\n";
102  error_flag = true;
103  }
104  }
105  // check SW corner
106  {
107  Vector<double> x_S(2);
108  (*South_boundary_fn_pt)(-1.0, x_S);
109  Vector<double> x_W(2);
110  (*West_boundary_fn_pt)(-1.0, x_W);
111  if (x_S[0] != x_W[0] || x_S[1] != x_W[1])
112  {
113  error_message << "South and West Boundaries do not meet at the "
114  << "South West Corner.\n"
115  << "South Boundary : x[0] = " << x_S[0] << "\n"
116  << " x[1] = " << x_S[1] << "\n"
117  << "West Boundary : x[0] = " << x_W[0] << "\n"
118  << " x[1] = " << x_W[1] << "\n\n";
119  error_flag = true;
120  }
121  }
122  // check NW corner
123  {
124  Vector<double> x_N(2);
125  (*North_boundary_fn_pt)(-1.0, x_N);
126  Vector<double> x_W(2);
127  (*West_boundary_fn_pt)(1.0, x_W);
128  if (x_N[0] != x_W[0] || x_N[1] != x_W[1])
129  {
130  error_message << "North and West Boundaries do not meet at the "
131  << "North West Corner.\n"
132  << "North Boundary : x[0] = " << x_N[0] << "\n"
133  << " x[1] = " << x_N[1] << "\n"
134  << "West Boundary : x[0] = " << x_W[0] << "\n"
135  << " x[1] = " << x_W[1] << "\n\n";
136  error_flag = true;
137  }
138  }
139  if (error_flag)
140  {
141  throw OomphLibError(
142  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
143  }
144 #endif
145  }
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301
BoundaryFctPt d2North_boundary_fn_pt
Definition: topologically_rectangular_domain.h:191
BoundaryFctPt d2East_boundary_fn_pt
Definition: topologically_rectangular_domain.h:196
BoundaryFctPt South_boundary_fn_pt
Definition: topologically_rectangular_domain.h:164
BoundaryFctPt dEast_boundary_fn_pt
Definition: topologically_rectangular_domain.h:177
BoundaryFctPt d2West_boundary_fn_pt
Definition: topologically_rectangular_domain.h:206
BoundaryFctPt d2South_boundary_fn_pt
Definition: topologically_rectangular_domain.h:201
BoundaryFctPt North_boundary_fn_pt
Definition: topologically_rectangular_domain.h:156
BoundaryFctPt dWest_boundary_fn_pt
Definition: topologically_rectangular_domain.h:185
BoundaryFctPt West_boundary_fn_pt
Definition: topologically_rectangular_domain.h:168
BoundaryFctPt East_boundary_fn_pt
Definition: topologically_rectangular_domain.h:160
BoundaryFctPt dSouth_boundary_fn_pt
Definition: topologically_rectangular_domain.h:181
BoundaryFctPt dNorth_boundary_fn_pt
Definition: topologically_rectangular_domain.h:173
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References d2East_boundary_fn_pt, d2North_boundary_fn_pt, d2South_boundary_fn_pt, d2West_boundary_fn_pt, dEast_boundary_fn_pt, dNorth_boundary_fn_pt, dSouth_boundary_fn_pt, dWest_boundary_fn_pt, East_boundary_fn_pt, oomph::Domain::Macro_element_pt, North_boundary_fn_pt, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, South_boundary_fn_pt, and West_boundary_fn_pt.

◆ TopologicallyRectangularDomain() [2/4]

oomph::TopologicallyRectangularDomain::TopologicallyRectangularDomain ( const double l_x,
const double l_y 
)

Constructor - takes length of domain in x and y direction as arguements. Assumes domain is rectangular, and the south west (lower left) corner is at 0,0.

154  {
155  // domain comprises one macro element
156  Macro_element_pt.resize(1);
157 
158  // Create the macro element
159  Macro_element_pt[0] = new QMacroElement<2>(this, 0);
160 
161  // set the boundary function pointers to zero
166 
167  // resize x vectors
168  x_south_west.resize(2);
169  x_north_east.resize(2);
170 
171  // set south west corner to 0,0
172  x_south_west[0] = 0.0;
173  x_south_west[1] = 0.0;
174 
175  // set north east corner
176  x_north_east[0] = l_x;
177  x_north_east[1] = l_y;
178 
179  // by default derivative boundary function pointers are null
184 
185  // also by default second derivate boundary function pointers are null
190  }
Vector< double > x_south_west
Definition: topologically_rectangular_domain.h:211
Vector< double > x_north_east
Definition: topologically_rectangular_domain.h:215

References d2East_boundary_fn_pt, d2North_boundary_fn_pt, d2South_boundary_fn_pt, d2West_boundary_fn_pt, dEast_boundary_fn_pt, dNorth_boundary_fn_pt, dSouth_boundary_fn_pt, dWest_boundary_fn_pt, East_boundary_fn_pt, oomph::Domain::Macro_element_pt, North_boundary_fn_pt, South_boundary_fn_pt, West_boundary_fn_pt, x_north_east, and x_south_west.

◆ TopologicallyRectangularDomain() [3/4]

oomph::TopologicallyRectangularDomain::TopologicallyRectangularDomain ( const double x_min,
const double x_max,
const double y_min,
const double y_max 
)

Constructor - takes the minimum and maximum coordinates of the of an assumed rectanguler domain in the x and y direction

201  {
202  // domain comprises one macro element
203  Macro_element_pt.resize(1);
204 
205  // Create the macro element
206  Macro_element_pt[0] = new QMacroElement<2>(this, 0);
207 
208  // set the boundary function pointers to zero
213 
214  // resize x vectors
215  x_south_west.resize(2);
216  x_north_east.resize(2);
217 
218  // set vector values
219  x_south_west[0] = x_min;
220  x_south_west[1] = y_min;
221  x_north_east[0] = x_max;
222  x_north_east[1] = y_max;
223 
224  // by default derivative boundary function pointers are null
229 
230  // also by default second derivate boundary function pointers are null
235  }

References d2East_boundary_fn_pt, d2North_boundary_fn_pt, d2South_boundary_fn_pt, d2West_boundary_fn_pt, dEast_boundary_fn_pt, dNorth_boundary_fn_pt, dSouth_boundary_fn_pt, dWest_boundary_fn_pt, East_boundary_fn_pt, oomph::Domain::Macro_element_pt, North_boundary_fn_pt, South_boundary_fn_pt, West_boundary_fn_pt, x_north_east, and x_south_west.

◆ TopologicallyRectangularDomain() [4/4]

oomph::TopologicallyRectangularDomain::TopologicallyRectangularDomain ( const TopologicallyRectangularDomain )
delete

Broken copy constructor.

◆ ~TopologicallyRectangularDomain()

oomph::TopologicallyRectangularDomain::~TopologicallyRectangularDomain ( )
inline

Destructor - empty; clean up done in base class.

91 {}

Member Function Documentation

◆ d2macro_element_boundary()

void oomph::TopologicallyRectangularDomain::d2macro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
virtual

returns the second derivates of the global coordinate position (f) wrt to the macro element coordinate at macro macro element position s on boundary i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)

Reimplemented from oomph::Domain.

370  {
371  // use quad tree edge names to label edge of domain
372  using namespace QuadTreeNames;
373 
374 
375 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
376  // Warn about time argument being moved to the front
377  OomphLibWarning(
378  "Order of function arguments has changed between versions 0.8 and 0.85",
379  "TopologicallyRectangularDomain::d2macro_element_boundary(...)",
381 #endif
382 
383  // north boundary
384  if (i_direct == N) d2r_N(s, f);
385  // east boundary
386  else if (i_direct == E)
387  d2r_E(s, f);
388  // south boundary
389  else if (i_direct == S)
390  d2r_S(s, f);
391  // west boundary
392  else if (i_direct == W)
393  d2r_W(s, f);
394  }
void d2r_W(const Vector< double > &s, Vector< double > &d2r)
Definition: topologically_rectangular_domain.cc:781
void d2r_N(const Vector< double > &s, Vector< double > &d2r)
Definition: topologically_rectangular_domain.cc:622
void d2r_E(const Vector< double > &s, Vector< double > &d2r)
Definition: topologically_rectangular_domain.cc:675
void d2r_S(const Vector< double > &s, Vector< double > &d2r)
Definition: topologically_rectangular_domain.cc:728
@ N
Definition: constructor.cpp:22
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
@ S
Definition: quadtree.h:62
@ W
Definition: quadtree.h:63

References d2r_E(), d2r_N(), d2r_S(), d2r_W(), Global_Physical_Variables::E, f(), N, OOMPH_EXCEPTION_LOCATION, s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

◆ d2r_E()

void oomph::TopologicallyRectangularDomain::d2r_E ( const Vector< double > &  s,
Vector< double > &  d2r 
)
private

takes the macro element coordinate position along the east boundary and returns the second derivates of the global coordinates with respect to the boundary

677  {
678  // if E boundary fn provided
679  if (East_boundary_fn_pt != 0)
680  {
681  // if d2E boundary fn provided
682  if (d2East_boundary_fn_pt != 0)
683  {
684  (*d2East_boundary_fn_pt)(s[0], d2r);
685  }
686  // else compute by finite differencing
687  else
688  {
689  // if dE boundary fn provided finite difference d2E from it
690  if (dEast_boundary_fn_pt != 0)
691  {
692  const double h = 10e-8;
693  Vector<double> dx_E_lower(2);
694  (*dEast_boundary_fn_pt)(s[0] - 0.5 * h, dx_E_lower);
695  Vector<double> dx_E_upper(2);
696  (*dEast_boundary_fn_pt)(s[0] + 0.5 * h, dx_E_upper);
697  d2r[0] = (dx_E_upper[0] - dx_E_lower[0]) / h;
698  d2r[1] = (dx_E_upper[1] - dx_E_lower[1]) / h;
699  }
700  // else finite difference from E boundary fn
701  else
702  {
703  const double h = 10e-8;
704  Vector<double> E_left(2);
705  (*East_boundary_fn_pt)(s[0] - h, E_left);
706  Vector<double> E_right(2);
707  (*East_boundary_fn_pt)(s[0] + h, E_right);
708  Vector<double> E_centre(2);
709  (*East_boundary_fn_pt)(s[0], E_centre);
710  d2r[0] = (E_right[0] + E_left[0] - 2 * E_centre[0]) / (h * h);
711  d2r[1] = (E_right[1] + E_left[1] - 2 * E_centre[1]) / (h * h);
712  }
713  }
714  }
715  // if E boundary fn not provided then mesh is rectangular
716  else
717  {
718  d2r[0] = 0;
719  d2r[1] = 0;
720  }
721  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)

References d2East_boundary_fn_pt, dEast_boundary_fn_pt, e(), East_boundary_fn_pt, and s.

Referenced by d2macro_element_boundary().

◆ d2r_N()

void oomph::TopologicallyRectangularDomain::d2r_N ( const Vector< double > &  s,
Vector< double > &  d2r 
)
private

takes the macro element coordinate position along the north boundary and returns the second derivates of the global coordinates with respect to the boundary

624  {
625  // if N boundary fn provided
626  if (North_boundary_fn_pt != 0)
627  {
628  // if d2N boundary fn provided
629  if (d2North_boundary_fn_pt != 0)
630  {
631  (*d2North_boundary_fn_pt)(s[0], d2r);
632  }
633  // else compute by finite differencing
634  else
635  {
636  // if dN boundary fn provided finite difference d2N from it
637  if (dNorth_boundary_fn_pt != 0)
638  {
639  const double h = 10e-8;
640  Vector<double> dx_N_left(2);
641  (*dNorth_boundary_fn_pt)(s[0] - 0.5 * h, dx_N_left);
642  Vector<double> dx_N_right(2);
643  (*dNorth_boundary_fn_pt)(s[0] + 0.5 * h, dx_N_right);
644  d2r[0] = (dx_N_right[0] - dx_N_left[0]) / h;
645  d2r[1] = (dx_N_right[1] - dx_N_left[1]) / h;
646  }
647  // else finite difference from N boundary fn
648  else
649  {
650  const double h = 10e-8;
651  Vector<double> N_left(2);
652  (*North_boundary_fn_pt)(s[0] - h, N_left);
653  Vector<double> N_right(2);
654  (*North_boundary_fn_pt)(s[0] + h, N_right);
655  Vector<double> N_centre(2);
656  (*North_boundary_fn_pt)(s[0], N_centre);
657  d2r[0] = (N_right[0] + N_left[0] - 2 * N_centre[0]) / (h * h);
658  d2r[1] = (N_right[1] + N_left[1] - 2 * N_centre[1]) / (h * h);
659  }
660  }
661  }
662  // if N boundary fn not provided then mesh is rectangular
663  else
664  {
665  d2r[0] = 0;
666  d2r[1] = 0;
667  }
668  }

References d2North_boundary_fn_pt, dNorth_boundary_fn_pt, e(), North_boundary_fn_pt, and s.

Referenced by d2macro_element_boundary().

◆ d2r_S()

void oomph::TopologicallyRectangularDomain::d2r_S ( const Vector< double > &  s,
Vector< double > &  d2r 
)
private

takes the macro element coordinate position along the south boundary and returns the second derivates of the global coordinates with respect to the boundary

730  {
731  // if S boundary fn provided
732  if (South_boundary_fn_pt != 0)
733  {
734  // if d2S boundary fn provided
735  if (d2South_boundary_fn_pt != 0)
736  {
737  (*d2South_boundary_fn_pt)(s[0], d2r);
738  }
739  // else compute by finite differencing
740  else
741  {
742  // if dS boundary fn provided finite difference d2S from it
743  if (dSouth_boundary_fn_pt != 0)
744  {
745  const double h = 10e-8;
746  Vector<double> dx_S_left(2);
747  (*dSouth_boundary_fn_pt)(s[0] - 0.5 * h, dx_S_left);
748  Vector<double> dx_S_right(2);
749  (*dSouth_boundary_fn_pt)(s[0] + 0.5 * h, dx_S_right);
750  d2r[0] = (dx_S_right[0] - dx_S_left[0]) / h;
751  d2r[1] = (dx_S_right[1] - dx_S_left[1]) / h;
752  }
753  // else finite difference from S boundary fn
754  else
755  {
756  const double h = 10e-8;
757  Vector<double> S_left(2);
758  (*South_boundary_fn_pt)(s[0] - h, S_left);
759  Vector<double> S_right(2);
760  (*South_boundary_fn_pt)(s[0] + h, S_right);
761  Vector<double> S_centre(2);
762  (*South_boundary_fn_pt)(s[0], S_centre);
763  d2r[0] = (S_right[0] + S_left[0] - 2 * S_centre[0]) / (h * h);
764  d2r[1] = (S_right[1] + S_left[1] - 2 * S_centre[1]) / (h * h);
765  }
766  }
767  }
768  // if S boundary fn not provided then mesh is rectangular
769  else
770  {
771  d2r[0] = 0;
772  d2r[1] = 0;
773  }
774  }

References d2South_boundary_fn_pt, dSouth_boundary_fn_pt, e(), s, and South_boundary_fn_pt.

Referenced by d2macro_element_boundary().

◆ d2r_W()

void oomph::TopologicallyRectangularDomain::d2r_W ( const Vector< double > &  s,
Vector< double > &  d2r 
)
private

takes the macro element coordinate position along the west boundary and returns the second derivates of the global coordinates with respect to the boundary

783  {
784  // if W boundary fn provided
785  if (West_boundary_fn_pt != 0)
786  {
787  // if d2W boundary fn provided
788  if (d2West_boundary_fn_pt != 0)
789  {
790  (*d2West_boundary_fn_pt)(s[0], d2r);
791  }
792  // else compute by finite differencing
793  else
794  {
795  // if dW boundary fn provided finite difference d2W from it
796  if (dWest_boundary_fn_pt != 0)
797  {
798  const double h = 10e-8;
799  Vector<double> dx_W_lower(2);
800  (*dWest_boundary_fn_pt)(s[0] - 0.5 * h, dx_W_lower);
801  Vector<double> dx_W_upper(2);
802  (*dWest_boundary_fn_pt)(s[0] + 0.5 * h, dx_W_upper);
803  d2r[0] = (dx_W_upper[0] - dx_W_lower[0]) / h;
804  d2r[1] = (dx_W_upper[1] - dx_W_lower[1]) / h;
805  }
806  // else finite difference from W boundary fn
807  else
808  {
809  const double h = 10e-8;
810  Vector<double> W_left(2);
811  (*West_boundary_fn_pt)(s[0] - h, W_left);
812  Vector<double> W_right(2);
813  (*West_boundary_fn_pt)(s[0] + h, W_right);
814  Vector<double> W_centre(2);
815  (*West_boundary_fn_pt)(s[0], W_centre);
816  d2r[0] = (W_right[0] + W_left[0] - 2 * W_centre[0]) / (h * h);
817  d2r[1] = (W_right[1] + W_left[1] - 2 * W_centre[1]) / (h * h);
818  }
819  }
820  }
821  // if W boundary fn not provided then mesh is rectangular
822  else
823  {
824  d2r[0] = 0;
825  d2r[1] = 0;
826  }
827  }

References d2West_boundary_fn_pt, dWest_boundary_fn_pt, e(), s, and West_boundary_fn_pt.

Referenced by d2macro_element_boundary().

◆ dmacro_element_boundary()

void oomph::TopologicallyRectangularDomain::dmacro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
virtual

returns the derivates of the global coordinate position (f) wrt to the macro element coordinate at macro macro element position s on boundary i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)

Reimplemented from oomph::Domain.

334  {
335  // use quad tree edge names to label edge of domain
336  using namespace QuadTreeNames;
337 
338 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
339  // Warn about time argument being moved to the front
340  OomphLibWarning(
341  "Order of function arguments has changed between versions 0.8 and 0.85",
342  "TopologicallyRectangularDomain::dmacro_element_boundary(...)",
344 #endif
345 
346  // north boundary
347  if (i_direct == N) dr_N(s, f);
348  // east boundary
349  else if (i_direct == E)
350  dr_E(s, f);
351  // south boundary
352  else if (i_direct == S)
353  dr_S(s, f);
354  // west boundary
355  else if (i_direct == W)
356  dr_W(s, f);
357  }
void dr_E(const Vector< double > &s, Vector< double > &dr)
Definition: topologically_rectangular_domain.cc:514
void dr_S(const Vector< double > &s, Vector< double > &dr)
Definition: topologically_rectangular_domain.cc:550
void dr_W(const Vector< double > &s, Vector< double > &dr)
Definition: topologically_rectangular_domain.cc:586
void dr_N(const Vector< double > &s, Vector< double > &dr)
Definition: topologically_rectangular_domain.cc:478

References dr_E(), dr_N(), dr_S(), dr_W(), Global_Physical_Variables::E, f(), N, OOMPH_EXCEPTION_LOCATION, s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

◆ dr_E()

void oomph::TopologicallyRectangularDomain::dr_E ( const Vector< double > &  s,
Vector< double > &  dr 
)
private

takes the macro element coordinate position along the E boundary and returns the derivates of the global coordinates with respect to the boundary

516  {
517  // if E boundary fn provided
518  if (East_boundary_fn_pt != 0)
519  {
520  // if dE boundary fn provided
521  if (dEast_boundary_fn_pt != 0)
522  {
523  (*dEast_boundary_fn_pt)(s[0], dr);
524  }
525  // else compute by finite differencing
526  else
527  {
528  const double h = 10e-8;
529  Vector<double> x_E_down(2);
530  (*East_boundary_fn_pt)(s[0] - 0.5 * h, x_E_down);
531  Vector<double> x_E_up(2);
532  (*East_boundary_fn_pt)(s[0] + 0.5 * h, x_E_up);
533  dr[0] = (x_E_up[0] - x_E_down[0]) / h;
534  dr[1] = (x_E_up[1] - x_E_down[1]) / h;
535  }
536  }
537  // if E boundary fn not provided then mesh is rectangular
538  else
539  {
540  dr[0] = 0;
541  dr[1] = (x_north_east[1] - x_south_west[1]) / 2;
542  }
543  }

References dEast_boundary_fn_pt, e(), East_boundary_fn_pt, s, x_north_east, and x_south_west.

Referenced by dmacro_element_boundary().

◆ dr_N()

void oomph::TopologicallyRectangularDomain::dr_N ( const Vector< double > &  s,
Vector< double > &  dr 
)
private

takes the macro element coordinate position along the north boundary and returns the derivates of the global coordinates with respect to the boundary

480  {
481  // if N boundary fn provided
482  if (North_boundary_fn_pt != 0)
483  {
484  // if dN boundary fn provided
485  if (dNorth_boundary_fn_pt != 0)
486  {
487  (*dNorth_boundary_fn_pt)(s[0], dr);
488  }
489  // else compute by finite differencing
490  else
491  {
492  const double h = 10e-8;
493  Vector<double> x_N_left(2);
494  (*North_boundary_fn_pt)(s[0] - 0.5 * h, x_N_left);
495  Vector<double> x_N_right(2);
496  (*North_boundary_fn_pt)(s[0] + 0.5 * h, x_N_right);
497  dr[0] = (x_N_right[0] - x_N_left[0]) / h;
498  dr[1] = (x_N_right[1] - x_N_left[1]) / h;
499  }
500  }
501  // if N boundary fn not provided then mesh is rectangular
502  else
503  {
504  dr[0] = (x_north_east[0] - x_south_west[0]) / 2;
505  dr[1] = 0;
506  }
507  }

References dNorth_boundary_fn_pt, e(), North_boundary_fn_pt, s, x_north_east, and x_south_west.

Referenced by dmacro_element_boundary().

◆ dr_S()

void oomph::TopologicallyRectangularDomain::dr_S ( const Vector< double > &  s,
Vector< double > &  dr 
)
private

takes the macro element coordinate position along the south boundary and returns the derivates of the global coordinates with respect to the boundary

552  {
553  // if S boundary fn provided
554  if (South_boundary_fn_pt != 0)
555  {
556  // if dS boundary fn provided
557  if (dSouth_boundary_fn_pt != 0)
558  {
559  (*dSouth_boundary_fn_pt)(s[0], dr);
560  }
561  // else compute by finite differencing
562  else
563  {
564  const double h = 10e-8;
565  Vector<double> x_N_left(2);
566  (*South_boundary_fn_pt)(s[0] - 0.5 * h, x_N_left);
567  Vector<double> x_N_right(2);
568  (*South_boundary_fn_pt)(s[0] + 0.5 * h, x_N_right);
569  dr[0] = (x_N_right[0] - x_N_left[0]) / h;
570  dr[1] = (x_N_right[1] - x_N_left[1]) / h;
571  }
572  }
573  // if S boundary fn not provided then mesh is rectangular
574  else
575  {
576  dr[0] = (x_north_east[0] - x_south_west[0]) / 2;
577  dr[1] = 0;
578  }
579  }

References dSouth_boundary_fn_pt, e(), s, South_boundary_fn_pt, x_north_east, and x_south_west.

Referenced by dmacro_element_boundary().

◆ dr_W()

void oomph::TopologicallyRectangularDomain::dr_W ( const Vector< double > &  s,
Vector< double > &  dr 
)
private

takes the macro element coordinate position along the W boundary and returns the derivates of the global coordinates with respect to the boundary

588  {
589  // if W boundary fn provided
590  if (West_boundary_fn_pt != 0)
591  {
592  // if dW boundary fn provided
593  if (dWest_boundary_fn_pt != 0)
594  {
595  (*dWest_boundary_fn_pt)(s[0], dr);
596  }
597  // else compute by finite differencing
598  else
599  {
600  const double h = 10e-8;
601  Vector<double> x_W_down(2);
602  (*West_boundary_fn_pt)(s[0] - 0.5 * h, x_W_down);
603  Vector<double> x_W_up(2);
604  (*West_boundary_fn_pt)(s[0] + 0.5 * h, x_W_up);
605  dr[0] = (x_W_up[0] - x_W_down[0]) / h;
606  dr[1] = (x_W_up[1] - x_W_down[1]) / h;
607  }
608  }
609  // if E boundary fn not provided then mesh is rectangular
610  else
611  {
612  dr[0] = 0;
613  dr[1] = (x_north_east[1] - x_south_west[1]) / 2;
614  }
615  }

References dWest_boundary_fn_pt, e(), s, West_boundary_fn_pt, x_north_east, and x_south_west.

Referenced by dmacro_element_boundary().

◆ macro_element_boundary()

void oomph::TopologicallyRectangularDomain::macro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
virtual

returns the global coordinate position (f) of macro element position s on boundary i_direct (e.g. N/S/W/E in 2D) at time t (no time dependence)

Implements oomph::Domain.

298  {
299  // use quad tree edge names to label edge of domain
300  using namespace QuadTreeNames;
301 
302 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
303  // Warn about time argument being moved to the front
304  OomphLibWarning(
305  "Order of function arguments has changed between versions 0.8 and 0.85",
306  "TopologicallyRectangularDomain::macro_element_boundary(...)",
308 #endif
309 
310  // north boundary
311  if (i_direct == N) r_N(s, f);
312  // east boundary
313  else if (i_direct == E)
314  r_E(s, f);
315  // south boundary
316  else if (i_direct == S)
317  r_S(s, f);
318  // west boundary
319  else if (i_direct == W)
320  r_W(s, f);
321  }
void r_E(const Vector< double > &s, Vector< double > &f)
Definition: topologically_rectangular_domain.cc:419
void r_N(const Vector< double > &s, Vector< double > &f)
Definition: topologically_rectangular_domain.cc:400
void r_S(const Vector< double > &s, Vector< double > &f)
Definition: topologically_rectangular_domain.cc:438
void r_W(const Vector< double > &s, Vector< double > &f)
Definition: topologically_rectangular_domain.cc:458

References Global_Physical_Variables::E, f(), N, OOMPH_EXCEPTION_LOCATION, r_E(), r_N(), r_S(), r_W(), s, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

◆ operator=()

void oomph::TopologicallyRectangularDomain::operator= ( const TopologicallyRectangularDomain )
delete

Broken assignment operator.

◆ r_E()

void oomph::TopologicallyRectangularDomain::r_E ( const Vector< double > &  s,
Vector< double > &  f 
)
private

takes the macro element coordinate position along the east boundary and returns the global coordinate position along that boundary

421  {
422  if (East_boundary_fn_pt != 0)
423  {
424  (*East_boundary_fn_pt)(s[0], f);
425  }
426  else
427  {
428  f[0] = x_north_east[0];
429  f[1] =
430  x_south_west[1] + (s[0] + 1) / 2 * (x_north_east[1] - x_south_west[1]);
431  }
432  }

References East_boundary_fn_pt, f(), s, x_north_east, and x_south_west.

Referenced by macro_element_boundary().

◆ r_N()

void oomph::TopologicallyRectangularDomain::r_N ( const Vector< double > &  s,
Vector< double > &  f 
)
private

takes the macro element coordinate position along the north boundary and returns the global coordinate position along that boundary

402  {
403  if (North_boundary_fn_pt != 0)
404  {
405  (*North_boundary_fn_pt)(s[0], f);
406  }
407  else
408  {
409  f[0] =
410  x_south_west[0] + (s[0] + 1) / 2 * (x_north_east[0] - x_south_west[0]);
411  f[1] = x_north_east[1];
412  }
413  }

References f(), North_boundary_fn_pt, s, x_north_east, and x_south_west.

Referenced by macro_element_boundary().

◆ r_S()

void oomph::TopologicallyRectangularDomain::r_S ( const Vector< double > &  s,
Vector< double > &  f 
)
private

takes the macro element coordinate position along the south boundary and returns the global coordinate position along that boundary

440  {
441  if (South_boundary_fn_pt != 0)
442  {
443  (*South_boundary_fn_pt)(s[0], f);
444  }
445  else
446  {
447  f[0] =
448  x_south_west[0] + (s[0] + 1) / 2 * (x_north_east[0] - x_south_west[0]);
449  f[1] = x_south_west[1];
450  }
451  }

References f(), s, South_boundary_fn_pt, x_north_east, and x_south_west.

Referenced by macro_element_boundary().

◆ r_W()

void oomph::TopologicallyRectangularDomain::r_W ( const Vector< double > &  s,
Vector< double > &  f 
)
private

takes the macro element coordinate position along the west boundary and returns the global coordinate position along that boundary access down boundary function pointer

460  {
461  if (West_boundary_fn_pt != 0)
462  {
463  (*West_boundary_fn_pt)(s[0], f);
464  }
465  else
466  {
467  f[0] = x_south_west[0];
468  f[1] =
469  x_south_west[1] + (s[0] + 1) / 2 * (x_north_east[1] - x_south_west[1]);
470  }
471  }

References f(), s, West_boundary_fn_pt, x_north_east, and x_south_west.

Referenced by macro_element_boundary().

◆ set_boundary_derivative_functions()

void oomph::TopologicallyRectangularDomain::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 domain global coordinates (x_i) wrt the macro element coordinates (m_i), dx_i/dm_t is required along the domain boundaries (where dm_t is the macro element coordinate tangential to the domain boundary). The derivatives dx_i/dm_t can either be prescribed with function pointers, or if the function pointers are not provided then dx_i/dm_t is computed with finite differencing. Note - these functions are only required for domains contructed with boundary function pointers

253  {
254  // set the boundary derivate function pointers
255  dNorth_boundary_fn_pt = d_north_pt;
256  dEast_boundary_fn_pt = d_east_pt;
257  dSouth_boundary_fn_pt = d_south_pt;
258  dWest_boundary_fn_pt = d_west_pt;
259  }

References dEast_boundary_fn_pt, dNorth_boundary_fn_pt, dSouth_boundary_fn_pt, and dWest_boundary_fn_pt.

◆ set_boundary_second_derivative_functions()

void oomph::TopologicallyRectangularDomain::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 the problem domain global coordinates (x_i) wrt the macro element coordinates (m_i), d2x_i/dm_t^2 is required along the domain boundaries (where dm_t is the macro element coordinate tangential to the domain boundary). The derivatives d2x_i/dm_t^2 can either be prescribed with function pointers, or if the function pointers are not provided then dx_i/dm_t is computed with finite differencing. Note - these functions are only required for domains contructed with boundary function pointers

279  {
280  // set the boundary derivate function pointers
281  d2North_boundary_fn_pt = d2_north_pt;
282  d2East_boundary_fn_pt = d2_east_pt;
283  d2South_boundary_fn_pt = d2_south_pt;
284  d2West_boundary_fn_pt = d2_west_pt;
285  }

References d2East_boundary_fn_pt, d2North_boundary_fn_pt, d2South_boundary_fn_pt, and d2West_boundary_fn_pt.

Member Data Documentation

◆ d2East_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::d2East_boundary_fn_pt
private

Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coordinate tangential to the east boundary

Referenced by d2r_E(), set_boundary_second_derivative_functions(), and TopologicallyRectangularDomain().

◆ d2North_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::d2North_boundary_fn_pt
private

Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coordinate tangential to the north boundary

Referenced by d2r_N(), set_boundary_second_derivative_functions(), and TopologicallyRectangularDomain().

◆ d2South_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::d2South_boundary_fn_pt
private

Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coordinate tangential to the south boundary

Referenced by d2r_S(), set_boundary_second_derivative_functions(), and TopologicallyRectangularDomain().

◆ d2West_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::d2West_boundary_fn_pt
private

Function pointer to prescribe the second derivates of global coordinates wrt to the macro element coordinate tangential to the west boundary

Referenced by d2r_W(), set_boundary_second_derivative_functions(), and TopologicallyRectangularDomain().

◆ dEast_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::dEast_boundary_fn_pt
private

Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate tangential to the east boundary

Referenced by d2r_E(), dr_E(), set_boundary_derivative_functions(), and TopologicallyRectangularDomain().

◆ dNorth_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::dNorth_boundary_fn_pt
private

Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate tangential to the north boundary

Referenced by d2r_N(), dr_N(), set_boundary_derivative_functions(), and TopologicallyRectangularDomain().

◆ dSouth_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::dSouth_boundary_fn_pt
private

Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate tangential to the south boundary

Referenced by d2r_S(), dr_S(), set_boundary_derivative_functions(), and TopologicallyRectangularDomain().

◆ dWest_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::dWest_boundary_fn_pt
private

Function pointer to prescribe the derivates of global coordinates wrt to the macro element coordinate tangential to the west boundary

Referenced by d2r_W(), dr_W(), set_boundary_derivative_functions(), and TopologicallyRectangularDomain().

◆ East_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::East_boundary_fn_pt
private

Function pointer to prescribe the east boundary of this topologically rectangular domain

Referenced by d2r_E(), dr_E(), r_E(), and TopologicallyRectangularDomain().

◆ North_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::North_boundary_fn_pt
private

Function pointer to prescribe the north boundary of this topologically rectangular domain

Referenced by d2r_N(), dr_N(), r_N(), and TopologicallyRectangularDomain().

◆ South_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::South_boundary_fn_pt
private

Function pointer to prescribe the north boundary of this topologically rectangular domain

Referenced by d2r_S(), dr_S(), r_S(), and TopologicallyRectangularDomain().

◆ West_boundary_fn_pt

BoundaryFctPt oomph::TopologicallyRectangularDomain::West_boundary_fn_pt
private

Function pointer to prescribe the west boundary of this topologically rectangular domain

Referenced by d2r_W(), dr_W(), r_W(), and TopologicallyRectangularDomain().

◆ x_north_east

Vector<double> oomph::TopologicallyRectangularDomain::x_north_east
private

coordinate position of north east corner of domain (only used if boundary functions are not used)

Referenced by dr_E(), dr_N(), dr_S(), dr_W(), r_E(), r_N(), r_S(), r_W(), and TopologicallyRectangularDomain().

◆ x_south_west

Vector<double> oomph::TopologicallyRectangularDomain::x_south_west
private

coordinate position of south west corner of domain (only used if boundary functions are not used)

Referenced by dr_E(), dr_N(), dr_S(), dr_W(), r_E(), r_N(), r_S(), r_W(), and TopologicallyRectangularDomain().


The documentation for this class was generated from the following files: