rectangular_quadmesh.template.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-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 // Header file for a relatively simple Quad Meshe
27 #ifndef OOMPH_RECTANGULAR_QUADMESH_HEADER
28 #define OOMPH_RECTANGULAR_QUADMESH_HEADER
29 
30 // Config header generated by autoconfig
31 #ifdef HAVE_CONFIG_H
32 #include <oomph-lib-config.h>
33 #endif
34 
35 // OOMPH-LIB headers
36 #include "../generic/mesh.h"
37 #include "../generic/quad_mesh.h"
38 #include "../generic/refineable_quad_mesh.h"
39 
40 namespace oomph
41 {
42  //==========================================================================
43  /// RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx
44  /// elements in the "x" (horizonal) direction and Ny elements in the "y"
45  /// (vertical) direction. Two Constructors are provided. The basic constructor
46  /// assumes that the lower-left-hand corner of the mesh is (0,0) and
47  /// takes only the arguments, Nx, Ny, Xmax and Ymax. The more complex
48  /// constructor takes the additional arguments Xmin and Ymin.
49  ///
50  /// This class is designed to be used as a Base class for more complex
51  /// two dimensional meshes. The virtual functions x_spacing_function()
52  /// and y_spacing_function() may be overloaded to provide arbitrary node
53  /// spacing. The default is uniformly spaced nodes in each direction.
54  ///
55  /// It is also possible to make the solution periodic in the x direction.
56  //===========================================================================
57  template<class ELEMENT>
58  class RectangularQuadMesh : public virtual QuadMeshBase
59  {
60  protected:
61  // Mesh variables
62  /// Nx: number of elements in x-direction
63  unsigned Nx;
64  /// Ny: number of elements in y-direction
65  unsigned Ny;
66  /// Np: number of (linear) points in the element
67  unsigned Np;
68 
69  /// Minimum value of x coordinate
70  double Xmin;
71  /// Maximum value of x coordinate
72  double Xmax;
73 
74  /// Minimum value of y coordinate
75  double Ymin;
76  /// Maximum value of y coordinate
77  double Ymax;
78 
79  /// Boolean variable used to determine whether the mesh
80  /// is periodic in the x-direction
81  bool Xperiodic;
82 
83  /// Generic mesh construction function: contains all the hard work
84  void build_mesh(TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
85 
86  /// Constructor that allows the specification of minimum and maximum
87  /// values of x and y coordinates and does not build the mesh
88  /// This is intend to be used in derived classes that overload the
89  /// spacing functions. THis is scheduled to be changed, however.
90  /// The reason why this MUST be done is because the virtual spacing
91  /// functions cannot be called in the base constructur, because they will
92  /// not have been overloaded yet!!
94  const unsigned& nx,
95  const unsigned& ny,
96  const double& xmin,
97  const double& xmax,
98  const double& ymin,
99  const double& ymax,
100  const bool& periodic_in_x,
101  const bool& build,
102  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
103  : Nx(nx),
104  Ny(ny),
105  Xmin(xmin),
106  Xmax(xmax),
107  Ymin(ymin),
108  Ymax(ymax),
109  Xperiodic(periodic_in_x)
110  {
111  if (build)
112  {
113  // Call the generic mesh constructor
114  build_mesh(time_stepper_pt);
115  }
116  }
117 
118  public:
119  /// Simple constructor: nx: number of elements in x direction;
120  /// ny: number of elements in y direction; lx, length of domain in x
121  /// direction (0,lx); ly, length of domain in y direction (0,ly)
122  /// Also pass pointer to timestepper (defaults to Steady)
124  const unsigned& nx,
125  const unsigned& ny,
126  const double& lx,
127  const double& ly,
128  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
129  : Nx(nx),
130  Ny(ny),
131  Xmin(0.0),
132  Xmax(lx),
133  Ymin(0.0),
134  Ymax(ly),
135  Xperiodic(false)
136  {
137  // Mesh can only be built with 2D Qelements.
138  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
139 
140  // Call the generic mesh constructor
141  build_mesh(time_stepper_pt);
142  }
143 
144  /// Constructor that allows the specification of minimum and maximum
145  /// values of x and y coordinates
147  const unsigned& nx,
148  const unsigned& ny,
149  const double& xmin,
150  const double& xmax,
151  const double& ymin,
152  const double& ymax,
153  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
154  : Nx(nx),
155  Ny(ny),
156  Xmin(xmin),
157  Xmax(xmax),
158  Ymin(ymin),
159  Ymax(ymax),
160  Xperiodic(false)
161  {
162  // Mesh can only be built with 2D Qelements.
163  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
164 
165  // Call the generic mesh constructor
166  build_mesh(time_stepper_pt);
167  }
168 
169  /// Simple constructor: nx: number of elements in x direction;
170  /// ny: number of elements in y direction; lx, length of domain in x
171  /// direction (0,lx); ly, length of domain in y direction (0,ly)
172  /// Boolean flag specifies if the mesh is periodic in the x-direction.
173  /// Also pass pointer to timestepper (defaults to Steady)
175  const unsigned& nx,
176  const unsigned& ny,
177  const double& lx,
178  const double& ly,
179  const bool& periodic_in_x,
180  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
181  : Nx(nx),
182  Ny(ny),
183  Xmin(0.0),
184  Xmax(lx),
185  Ymin(0.0),
186  Ymax(ly),
187  Xperiodic(periodic_in_x)
188  {
189  // Mesh can only be built with 2D Qelements.
190  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
191 
192  // Call the generic mesh constructor
193  build_mesh(time_stepper_pt);
194  }
195 
196  /// Constructor that allows the specification of minimum and maximum
197  /// values of x and y coordinates.
198  /// Boolean flag specifies if the mesh is periodic in the x-direction.
200  const unsigned& nx,
201  const unsigned& ny,
202  const double& xmin,
203  const double& xmax,
204  const double& ymin,
205  const double& ymax,
206  const bool& periodic_in_x,
207  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
208  : Nx(nx),
209  Ny(ny),
210  Xmin(xmin),
211  Xmax(xmax),
212  Ymin(ymin),
213  Ymax(ymax),
214  Xperiodic(periodic_in_x)
215  {
216  // Mesh can only be built with 2D Qelements.
217  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
218 
219  // Call the generic mesh constructor
220  build_mesh(time_stepper_pt);
221  }
222 
223  /// Return number of elements in x direction
224  const unsigned& nx() const
225  {
226  // Return the value of Nx
227  return Nx;
228  }
229 
230  /// Return number of elements in y direction
231  const unsigned& ny() const
232  {
233  // Return the value of Ny
234  return Ny;
235  }
236 
237  /// Return the minimum value of x coordinate
238  const double x_min() const
239  {
240  // Return the value of Xmin
241  return Xmin;
242  }
243 
244  /// Return the maximum value of x coordinate
245  const double x_max() const
246  {
247  // Return the value of Xmax
248  return Xmax;
249  }
250 
251  /// Return the minimum value of y coordinate
252  const double y_min() const
253  {
254  // Return the value of Ymin
255  return Ymin;
256  }
257 
258  /// Return the maximum value of y coordinate
259  const double y_max() const
260  {
261  // Return the value of Ymax
262  return Ymax;
263  }
264 
265  /// Reorder the elements: By default they are ordered
266  /// in "horizontal" layers (increasing in x, then in y). This
267  /// function changes this to an ordering in the vertical direction
268  /// (y first, then x). This is more efficient if a frontal solver
269  /// is used and the mesh has more elements in the x than the y direction.
270  /// Can be overloaded in specific derived meshes.
271  virtual void element_reorder();
272 
273  /// Return the value of the x-coordinate at the node given by the
274  /// local node number (xnode, ynode) in the element (xelement,yelement).
275  /// The description is in a "psudeo" two-dimensional coordinate system,
276  /// so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and
277  /// that of xnode and ynode is [0,Np-1]. The default is to return
278  /// nodes that are equally spaced in the x coodinate.
279  virtual double x_spacing_function(unsigned xelement,
280  unsigned xnode,
281  unsigned yelement,
282  unsigned ynode)
283  {
284  // Calculate the values of equal increments in nodal values
285  double xstep = (Xmax - Xmin) / ((Np - 1) * Nx);
286  // Return the appropriate value
287  return (Xmin + xstep * ((Np - 1) * xelement + xnode));
288  }
289 
290  /// Return the value of the y-coordinate at the node given by the
291  /// local node number (xnode, ynode) in the element (xelement,yelement).
292  /// The description is in a "psudeo" two-dimensional coordinate system,
293  /// so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and
294  /// that of xnode and ynode is [0,Np-1]. The default it to return
295  /// nodes that are equally spaced in the y coordinate.
296  virtual double y_spacing_function(unsigned xelement,
297  unsigned xnode,
298  unsigned yelement,
299  unsigned ynode)
300  {
301  double ystep = (Ymax - Ymin) / ((Np - 1) * Ny);
302  // Return the appropriate value
303  return (Ymin + ystep * ((Np - 1) * yelement + ynode));
304  }
305  };
306 
307 
308  //==========================================================================
309  /// Refineable version of the RectangularQuadMesh: A two-dimensional
310  /// mesh of Quad elements with Nx elements in the "x" (horizonal)
311  /// direction and Ny elements in the "y" (vertical) direction. Two
312  /// Constructors are provided. The basic constructor
313  /// assumes that the lower-left-hand corner of the mesh is (0,0) and
314  /// takes only the arguments, Nx, Ny, Xmax and Ymax. The more complex
315  /// constructor takes the additional arguments Xmin and Ymin.
316  ///
317  /// This class is designed to be used as a Base class for more complex
318  /// two dimensional meshes. The virtual functions x_spacing_function()
319  /// and y_spacing_function() may be overloaded to provide arbitrary node
320  /// spacing. The default is uniformly spaced nodes in each direction.
321  //===========================================================================
322  template<class ELEMENT>
324  : public virtual RectangularQuadMesh<ELEMENT>,
325  public RefineableQuadMesh<ELEMENT>
326  {
327  public:
328  /// Simple constructor: nx: number of elements in x direction;
329  /// ny: number of elements in y direction; lx, length of domain in x
330  /// direction (0,lx); ly, length of domain in y direction (0,ly).
331  /// Also pass pointer to timestepper (defaults to Steady)
333  const unsigned& nx,
334  const unsigned& ny,
335  const double& lx,
336  const double& ly,
337  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
338  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
339  {
340  // Nodal positions etc. were created in constructor for
341  // RectangularMesh<...>. Only need to setup quadtree forest
342  this->setup_quadtree_forest();
343  }
344 
345  /// Simple constructor: nx: number of elements in x direction;
346  /// ny: number of elements in y direction; lx, length of domain in x
347  /// direction (0,lx); ly, length of domain in y direction (0,ly);
348  /// periodic_in_x, periodicity in x.
349  /// Also pass pointer to timestepper (defaults to Steady)
351  const unsigned& nx,
352  const unsigned& ny,
353  const double& lx,
354  const double& ly,
355  const bool& periodic_in_x,
356  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
357  : RectangularQuadMesh<ELEMENT>(
358  nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
359  {
360  // Nodal positions etc. were created in constructor for
361  // RectangularMesh<...>. Only need to setup quadtree forest
362  this->setup_quadtree_forest();
363  }
364 
365  /// Constructor that allows the specification of minimum and maximum
366  /// values of x and y coordinates
367  /// Also pass pointer to timestepper (defaults to Steady)
369  const unsigned& nx,
370  const unsigned& ny,
371  const double& xmin,
372  const double& xmax,
373  const double& ymin,
374  const double& ymax,
375  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
376  : RectangularQuadMesh<ELEMENT>(
377  nx, ny, xmin, xmax, ymin, ymax, time_stepper_pt)
378  {
379  // Nodal positions etc. were created in constructor for
380  // RectangularMesh<...>. Only need to setup quadtree forest
381  this->setup_quadtree_forest();
382  }
383 
384  /// Constructor that allows the specification of minimum and maximum
385  /// values of x and y coordinates and periodicity
386  /// Also pass pointer to timestepper (defaults to Steady)
388  const unsigned& nx,
389  const unsigned& ny,
390  const double& xmin,
391  const double& xmax,
392  const double& ymin,
393  const double& ymax,
394  const bool& periodic_in_x,
395  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
396  : RectangularQuadMesh<ELEMENT>(
397  nx, ny, xmin, xmax, ymin, ymax, periodic_in_x, time_stepper_pt)
398  {
399  // Nodal positions etc. were created in constructor for
400  // RectangularMesh<...>. Only need to setup quadtree forest
401  this->setup_quadtree_forest();
402  }
403  };
404 
405 
406  /// ///////////////////////////////////////////////////////////////////////
407  /// ///////////////////////////////////////////////////////////////////////
408  /// ///////////////////////////////////////////////////////////////////////
409 
410 
411  //================================================================
412  /// Elastic quad mesh with functionality to
413  /// attach traction elements to the specified boundaries. We "upgrade"
414  /// the RectangularQuadMesh to become an
415  /// SolidMesh and equate the Eulerian and Lagrangian coordinates,
416  /// thus making the domain represented by the mesh the stress-free
417  /// configuration.
418  //================================================================
419  template<class ELEMENT>
421  : public virtual RectangularQuadMesh<ELEMENT>,
422  public virtual SolidMesh
423  {
424  public:
425  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
426  /// ones so that the initial configuration is the stress-free one and
427  /// assign boundary coordinates. Origin specifies
428  /// an additional rigid-body displacement.
430  const unsigned& nx,
431  const unsigned& ny,
432  const double& lx,
433  const double& ly,
434  const Vector<double>& origin,
435  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
436  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
437  {
438  // Translate the nodes
439  unsigned nnod = nnode();
440  for (unsigned j = 0; j < nnod; j++)
441  {
442  node_pt(j)->x(0) += origin[0];
443  node_pt(j)->x(1) += origin[1];
444  }
445 
446  /// Make the current configuration the undeformed one by
447  /// setting the nodal Lagrangian coordinates to their current
448  /// Eulerian ones
450 
451  // Setup boundary coordinates
452  set_boundary_coordinates(origin);
453  }
454 
455 
456  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
457  /// ones so that the initial configuration is the stress-free one and
458  /// assign boundary coordinates
460  const unsigned& nx,
461  const unsigned& ny,
462  const double& lx,
463  const double& ly,
464  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
465  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
466  {
467  // No shift
468  Vector<double> origin(2, 0.0);
469 
470  /// Make the current configuration the undeformed one by
471  /// setting the nodal Lagrangian coordinates to their current
472  /// Eulerian ones
474 
475  // Setup boundary coordinates
476  set_boundary_coordinates(origin);
477  }
478 
479 
480  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
481  /// ones so that the initial configuration is the stress-free one and
482  /// assign boundary coordinates. This includes a boolean flag to specify
483  /// if the mesh is periodic in the x-direction
485  const unsigned& nx,
486  const unsigned& ny,
487  const double& lx,
488  const double& ly,
489  const bool& periodic_in_x,
490  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
492  nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
493  {
494  // No shift
495  Vector<double> origin(2, 0.0);
496 
497  /// Make the current configuration the undeformed one by
498  /// setting the nodal Lagrangian coordinates to their current
499  /// Eulerian ones
501 
502  // Setup boundary coordinates
503  set_boundary_coordinates(origin);
504  }
505 
506  private:
507  /// Setup the boundary coordinates. Vector
508  /// origin specifies the coordinates of the lower left corner of
509  /// the mesh.
511  {
512  // 1D vector fo boundary coordinate
513  Vector<double> zeta(1);
514 
515  // Loop over boundaries 0 and 2 where xi_0 is the varying
516  // boundary coordinate
517  for (unsigned b = 0; b < 3; b += 2)
518  {
519  // Number of nodes on those boundaries
520  unsigned n_nod = nboundary_node(b);
521 
522  // Loop over the nodes
523  for (unsigned i = 0; i < n_nod; i++)
524  {
525  // Boundary coordinate varies between 0 and L
526  zeta[0] = boundary_node_pt(b, i)->xi(0) - origin[0];
528  }
529  Boundary_coordinate_exists[b] = true;
530  }
531 
532 
533  // Loop over boundaries 1 and 3 where xi_1 is the varying
534  // boundary coordinate
535  for (unsigned b = 1; b < 4; b += 2)
536  {
537  // Number of nodes on those boundaries
538  unsigned n_nod = nboundary_node(b);
539 
540  // Loop over the nodes
541  for (unsigned i = 0; i < n_nod; i++)
542  {
543  // Boundary coordinate varies between +/- H/2
544  zeta[0] = boundary_node_pt(b, i)->xi(1) - origin[1] -
545  0.5 * (this->Ymax - this->Ymin);
547  }
548  Boundary_coordinate_exists[b] = true;
549  }
550  }
551  };
552 
553 
554  /// ///////////////////////////////////////////////////////////////////////
555  /// ///////////////////////////////////////////////////////////////////////
556  /// ///////////////////////////////////////////////////////////////////////
557 
558 
559  //================================================================
560  /// Elastic refineable quad mesh with functionality to
561  /// attach traction elements to the specified boundaries. We "upgrade"
562  /// the RefineableRectangularQuadMesh to become an
563  /// SolidMesh and equate the Eulerian and Lagrangian coordinates,
564  /// thus making the domain represented by the mesh the stress-free
565  /// configuration. We also move the mesh "down" by half the
566  /// the "height" so x=0 is located on the centreline -- appropriate
567  /// for the beam-type problems for which this mesh was developed.
568  //================================================================
569  template<class ELEMENT>
571  : public virtual ElasticRectangularQuadMesh<ELEMENT>,
572  public RefineableQuadMesh<ELEMENT>
573  {
574  public:
575  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
576  /// ones so that the initial configuration is the stress-free one and
577  /// assign boundary coordinates (variable Lagrangian coordinates along
578  /// the relevant boundaries).
580  const unsigned& nx,
581  const unsigned& ny,
582  const double& lx,
583  const double& ly,
584  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
585  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt),
586  ElasticRectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
587 
588  {
589  // Nodal positions etc. were created in base class.
590  // Only need to setup quadtree forest
591  this->setup_quadtree_forest();
592  }
593 
594 
595  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
596  /// ones so that the initial configuration is the stress-free one and
597  /// assign boundary coordinates. This includes a boolean flag to specify
598  /// if the mesh is periodic in the x-direction
600  const unsigned& nx,
601  const unsigned& ny,
602  const double& lx,
603  const double& ly,
604  const bool& periodic_in_x,
605  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
607  nx, ny, lx, ly, periodic_in_x, time_stepper_pt),
609  nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
610  {
611  // Nodal positions etc. were created in base class.
612  // Only need to setup quadtree forest
613  this->setup_quadtree_forest();
614  }
615 
616 
617  /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
618  /// ones so that the initial configuration is the stress-free one and
619  /// assign boundary coordinates (variable Lagrangian coordinates along
620  /// the relevant boundaries). Origin specifies an additional rigid-body
621  /// displacement.
623  const unsigned& nx,
624  const unsigned& ny,
625  const double& lx,
626  const double& ly,
627  const Vector<double>& origin,
628  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
629  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt),
631  nx, ny, lx, ly, origin, time_stepper_pt)
632 
633  {
634  // Nodal positions etc. were created in base class.
635  // Only need to setup quadtree forest
636  this->setup_quadtree_forest();
637  }
638  };
639 
640 
641 } // namespace oomph
642 
643 #endif
cstr elem_len * i
Definition: cfortran.h:603
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
void set_boundary_coordinates(const Vector< double > &origin)
Setup the boundary coordinates. Vector origin specifies the coordinates of the lower left corner of t...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition: mesh.h:75
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
Definition: mesh.h:190
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
Definition: nodes.cc:2394
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition: quad_mesh.h:57
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
unsigned Nx
Nx: number of elements in x-direction.
const double y_min() const
Return the minimum value of y coordinate.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx,...
const double x_max() const
Return the maximum value of x coordinate.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx,...
unsigned Ny
Ny: number of elements in y-direction.
const double y_max() const
Return the maximum value of y coordinate.
bool Xperiodic
Boolean variable used to determine whether the mesh is periodic in the x-direction.
const unsigned & ny() const
Return number of elements in y direction.
unsigned Np
Np: number of (linear) points in the element.
double Ymax
Maximum value of y coordinate.
const double x_min() const
Return the minimum value of x coordinate.
double Xmax
Maximum value of x coordinate.
const unsigned & nx() const
Return number of elements in x direction.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates....
virtual double x_spacing_function(unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
Return the value of the x-coordinate at the node given by the local node number (xnode,...
double Ymin
Minimum value of y coordinate.
virtual void element_reorder()
Reorder the elements: By default they are ordered in "horizontal" layers (increasing in x,...
virtual double y_spacing_function(unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
Return the value of the y-coordinate at the node given by the local node number (xnode,...
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, const bool &build, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates and do...
double Xmin
Minimum value of x coordinate.
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh construction function: contains all the hard work.
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
Refineable version of the RectangularQuadMesh: A two-dimensional mesh of Quad elements with Nx elemen...
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx,...
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx,...
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates Also p...
General SolidMesh class.
Definition: mesh.h:2562
void set_lagrangian_nodal_coordinates()
Make the current configuration the undeformed one by setting the nodal Lagrangian coordinates to thei...
Definition: mesh.cc:9564
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
Definition: mesh.h:2594
SolidNode * boundary_node_pt(const unsigned &b, const unsigned &n)
Return n-th SolidNodes on b-th boundary.
Definition: mesh.h:2612
double & xi(const unsigned &i)
Reference to i-th Lagrangian position.
Definition: nodes.h:1883
////////////////////////////////////////////////////////////////////// //////////////////////////////...
Definition: timesteppers.h:231
//////////////////////////////////////////////////////////////////// ////////////////////////////////...