rectangular_quadmesh.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-2025 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
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"
39
40namespace 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
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),
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),
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),
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),
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),
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 /// Refineable version of the RectangularQuadMesh: A two-dimensional
309 /// mesh of Quad elements with Nx elements in the "x" (horizonal)
310 /// direction and Ny elements in the "y" (vertical) direction. Two
311 /// Constructors are provided. The basic constructor
312 /// assumes that the lower-left-hand corner of the mesh is (0,0) and
313 /// takes only the arguments, Nx, Ny, Xmax and Ymax. The more complex
314 /// constructor takes the additional arguments Xmin and Ymin.
315 ///
316 /// This class is designed to be used as a Base class for more complex
317 /// two dimensional meshes. The virtual functions x_spacing_function()
318 /// and y_spacing_function() may be overloaded to provide arbitrary node
319 /// spacing. The default is uniformly spaced nodes in each direction.
320 //===========================================================================
321 template<class ELEMENT>
323 : public virtual RectangularQuadMesh<ELEMENT>,
324 public RefineableQuadMesh<ELEMENT>
325 {
326 public:
327 /// Simple constructor: nx: number of elements in x direction;
328 /// ny: number of elements in y direction; lx, length of domain in x
329 /// direction (0,lx); ly, length of domain in y direction (0,ly).
330 /// Also pass pointer to timestepper (defaults to Steady)
332 const unsigned& nx,
333 const unsigned& ny,
334 const double& lx,
335 const double& ly,
336 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
337 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
338 {
339 // Nodal positions etc. were created in constructor for
340 // RectangularMesh<...>. Only need to setup quadtree forest
341 this->setup_quadtree_forest();
342 }
343
344 /// Simple constructor: nx: number of elements in x direction;
345 /// ny: number of elements in y direction; lx, length of domain in x
346 /// direction (0,lx); ly, length of domain in y direction (0,ly);
347 /// periodic_in_x, periodicity in x.
348 /// Also pass pointer to timestepper (defaults to Steady)
350 const unsigned& nx,
351 const unsigned& ny,
352 const double& lx,
353 const double& ly,
354 const bool& periodic_in_x,
355 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
356 : RectangularQuadMesh<ELEMENT>(
357 nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
358 {
359 // Nodal positions etc. were created in constructor for
360 // RectangularMesh<...>. Only need to setup quadtree forest
361 this->setup_quadtree_forest();
362 }
363
364 /// Constructor that allows the specification of minimum and maximum
365 /// values of x and y coordinates
366 /// Also pass pointer to timestepper (defaults to Steady)
368 const unsigned& nx,
369 const unsigned& ny,
370 const double& xmin,
371 const double& xmax,
372 const double& ymin,
373 const double& ymax,
374 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
375 : RectangularQuadMesh<ELEMENT>(
376 nx, ny, xmin, xmax, ymin, ymax, time_stepper_pt)
377 {
378 // Nodal positions etc. were created in constructor for
379 // RectangularMesh<...>. Only need to setup quadtree forest
380 this->setup_quadtree_forest();
381 }
382
383 /// Constructor that allows the specification of minimum and maximum
384 /// values of x and y coordinates and periodicity
385 /// Also pass pointer to timestepper (defaults to Steady)
387 const unsigned& nx,
388 const unsigned& ny,
389 const double& xmin,
390 const double& xmax,
391 const double& ymin,
392 const double& ymax,
393 const bool& periodic_in_x,
394 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
395 : RectangularQuadMesh<ELEMENT>(
396 nx, ny, xmin, xmax, ymin, ymax, periodic_in_x, time_stepper_pt)
397 {
398 // Nodal positions etc. were created in constructor for
399 // RectangularMesh<...>. Only need to setup quadtree forest
400 this->setup_quadtree_forest();
401 }
402 };
403
404
405 //////////////////////////////////////////////////////////////////////////
406 //////////////////////////////////////////////////////////////////////////
407 //////////////////////////////////////////////////////////////////////////
408
409 //================================================================
410 /// Elastic quad mesh with functionality to
411 /// attach traction elements to the specified boundaries. We "upgrade"
412 /// the RectangularQuadMesh to become an
413 /// SolidMesh and equate the Eulerian and Lagrangian coordinates,
414 /// thus making the domain represented by the mesh the stress-free
415 /// configuration.
416 //================================================================
417 template<class ELEMENT>
419 : public virtual RectangularQuadMesh<ELEMENT>,
420 public virtual SolidMesh
421 {
422 public:
423 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
424 /// ones so that the initial configuration is the stress-free one and
425 /// assign boundary coordinates. Origin specifies
426 /// an additional rigid-body displacement.
428 const unsigned& nx,
429 const unsigned& ny,
430 const double& lx,
431 const double& ly,
432 const Vector<double>& origin,
433 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
434 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
435 {
436 // Translate the nodes
437 unsigned nnod = nnode();
438 for (unsigned j = 0; j < nnod; j++)
439 {
440 node_pt(j)->x(0) += origin[0];
441 node_pt(j)->x(1) += origin[1];
442 }
443
444 /// Make the current configuration the undeformed one by
445 /// setting the nodal Lagrangian coordinates to their current
446 /// Eulerian ones
448
449 // Setup boundary coordinates
451 }
452
453
454 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
455 /// ones so that the initial configuration is the stress-free one and
456 /// assign boundary coordinates
458 const unsigned& nx,
459 const unsigned& ny,
460 const double& lx,
461 const double& ly,
462 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
463 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
464 {
465 // No shift
466 Vector<double> origin(2, 0.0);
467
468 /// Make the current configuration the undeformed one by
469 /// setting the nodal Lagrangian coordinates to their current
470 /// Eulerian ones
472
473 // Setup boundary coordinates
475 }
476
477
478 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
479 /// ones so that the initial configuration is the stress-free one and
480 /// assign boundary coordinates. This includes a boolean flag to specify
481 /// if the mesh is periodic in the x-direction
483 const unsigned& nx,
484 const unsigned& ny,
485 const double& lx,
486 const double& ly,
487 const bool& periodic_in_x,
488 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
490 nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
491 {
492 // No shift
493 Vector<double> origin(2, 0.0);
494
495 /// Make the current configuration the undeformed one by
496 /// setting the nodal Lagrangian coordinates to their current
497 /// Eulerian ones
499
500 // Setup boundary coordinates
502 }
503
504 private:
505 /// Setup the boundary coordinates. Vector
506 /// origin specifies the coordinates of the lower left corner of
507 /// the mesh.
509 {
510 // 1D vector fo boundary coordinate
512
513 // Loop over boundaries 0 and 2 where xi_0 is the varying
514 // boundary coordinate
515 for (unsigned b = 0; b < 3; b += 2)
516 {
517 // Number of nodes on those boundaries
518 unsigned n_nod = nboundary_node(b);
519
520 // Loop over the nodes
521 for (unsigned i = 0; i < n_nod; i++)
522 {
523 // Boundary coordinate varies between 0 and L
524 zeta[0] = boundary_node_pt(b, i)->xi(0) - origin[0];
526 }
528 }
529
530 // Loop over boundaries 1 and 3 where xi_1 is the varying
531 // boundary coordinate
532 for (unsigned b = 1; b < 4; b += 2)
533 {
534 // Number of nodes on those boundaries
535 unsigned n_nod = nboundary_node(b);
536
537 // Loop over the nodes
538 for (unsigned i = 0; i < n_nod; i++)
539 {
540 // Boundary coordinate varies between +/- H/2
541 zeta[0] = boundary_node_pt(b, i)->xi(1) - origin[1] -
542 0.5 * (this->Ymax - this->Ymin);
544 }
546 }
547 }
548 };
549
550
551 //////////////////////////////////////////////////////////////////////////
552 //////////////////////////////////////////////////////////////////////////
553 //////////////////////////////////////////////////////////////////////////
554
555 //================================================================
556 /// Elastic refineable quad mesh with functionality to
557 /// attach traction elements to the specified boundaries. We "upgrade"
558 /// the RefineableRectangularQuadMesh to become an
559 /// SolidMesh and equate the Eulerian and Lagrangian coordinates,
560 /// thus making the domain represented by the mesh the stress-free
561 /// configuration. We also move the mesh "down" by half the
562 /// the "height" so x=0 is located on the centreline -- appropriate
563 /// for the beam-type problems for which this mesh was developed.
564 //================================================================
565 template<class ELEMENT>
567 : public virtual ElasticRectangularQuadMesh<ELEMENT>,
568 public RefineableQuadMesh<ELEMENT>
569 {
570 public:
571 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
572 /// ones so that the initial configuration is the stress-free one and
573 /// assign boundary coordinates (variable Lagrangian coordinates along
574 /// the relevant boundaries).
576 const unsigned& nx,
577 const unsigned& ny,
578 const double& lx,
579 const double& ly,
580 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
581 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt),
582 ElasticRectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
583
584 {
585 // Nodal positions etc. were created in base class.
586 // Only need to setup quadtree forest
587 this->setup_quadtree_forest();
588 }
589
590
591 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
592 /// ones so that the initial configuration is the stress-free one and
593 /// assign boundary coordinates. This includes a boolean flag to specify
594 /// if the mesh is periodic in the x-direction
596 const unsigned& nx,
597 const unsigned& ny,
598 const double& lx,
599 const double& ly,
600 const bool& periodic_in_x,
601 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
603 nx, ny, lx, ly, periodic_in_x, time_stepper_pt),
605 nx, ny, lx, ly, periodic_in_x, time_stepper_pt)
606 {
607 // Nodal positions etc. were created in base class.
608 // Only need to setup quadtree forest
609 this->setup_quadtree_forest();
610 }
611
612
613 /// Constructor: Build mesh and copy Eulerian coords to Lagrangian
614 /// ones so that the initial configuration is the stress-free one and
615 /// assign boundary coordinates (variable Lagrangian coordinates along
616 /// the relevant boundaries). Origin specifies an additional rigid-body
617 /// displacement.
619 const unsigned& nx,
620 const unsigned& ny,
621 const double& lx,
622 const double& ly,
623 const Vector<double>& origin,
624 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
625 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt),
627 nx, ny, lx, ly, origin, time_stepper_pt)
628
629 {
630 // Nodal positions etc. were created in base class.
631 // Only need to setup quadtree forest
632 this->setup_quadtree_forest();
633 }
634 };
635
636} // namespace oomph
637
639#endif
cstr elem_len * i
Definition cfortran.h:603
Elastic quad mesh with functionality to attach traction elements to the specified boundaries....
void set_boundary_coordinates(const Vector< double > &origin)
Setup the boundary coordinates. Vector origin specifies the coordinates of the lower left corner of t...
Elastic refineable quad mesh with functionality to attach traction elements to the specified boundari...
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition mesh.h:841
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
unsigned long nnode() const
Return number of nodes in the mesh.
Definition mesh.h:604
void set_boundary_coordinate_exists(const unsigned &i)
Set boundary coordinate on the i-th boundary to be existing.
Definition mesh.h:584
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
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition nodes.h:1060
Base class for quad meshes (meshes made of 2D quad elements).
Definition quad_mesh.h:57
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
const unsigned & ny() const
Return number of elements in y direction.
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 & nx() const
Return number of elements in x 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.
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:2570
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
Definition mesh.h:2602
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 * boundary_node_pt(const unsigned &b, const unsigned &n)
Return n-th SolidNodes on b-th boundary.
Definition mesh.h:2620
double & xi(const unsigned &i)
Reference to i-th Lagrangian position.
Definition nodes.h:1883
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).