collapsible_channel_mesh.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// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Include guards
31 #ifndef OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER
32 #define OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER
33 
34 // Generic includes
35 #include "../generic/refineable_quad_mesh.h"
36 #include "../generic/macro_element.h"
37 #include "../generic/domain.h"
38 #include "../generic/quad_mesh.h"
39 
40 // Mesh is based on simple_rectangular_quadmesh
43 
44 // Include *.template.cc to allow building the templated member functions
45 #include "../generic/macro_element_node_update_element.h"
46 
47 // We need to include the templated sources for algebraic meshes
48 // to allow the build of all templates.
49 #include "../generic/algebraic_elements.h"
50 
51 //Include the headers file for collapsible channel
53 
54 namespace oomph
55 {
56 
57 
58 //========================================================================
59 /// \short Basic collapsible channel mesh.
60 /// The mesh is derived from the \c SimpleRectangularQuadMesh
61 /// so it's node and element numbering scheme is the same
62 /// as in that mesh. Only the boundaries are numbered differently
63 /// to allow the easy identification of the "collapsible" segment.
64 /// Boundary coordinates are set up for all nodes
65 /// located on boundary 3 (the collapsible segment).
66 /// The curvilinear ("collapsible") segment is defined by
67 /// a \c GeomObject.
68 //========================================================================
69 template <class ELEMENT>
71 {
72 
73 public:
74 
75  /// \short Constructor: Pass number of elements in upstream/collapsible/
76  /// downstream segment and across the channel; lengths of upstream/
77  /// collapsible/downstream segments and width of channel, pointer to
78  /// GeomObject that defines the collapsible segment and pointer to
79  /// TimeStepper (defaults to the default timestepper, Steady).
80  CollapsibleChannelMesh(const unsigned& nup,
81  const unsigned& ncollapsible,
82  const unsigned& ndown,
83  const unsigned& ny,
84  const double& lup,
85  const double& lcollapsible,
86  const double& ldown,
87  const double& ly,
89  TimeStepper* time_stepper_pt=
91 
92  /// \short destructor
94  {
95  delete Domain_pt;
96  }
97 
98  /// Access function to GeomObject representing wall
99  GeomObject*& wall_pt(){return Wall_pt;}
100 
101  /// Access function to domain
103 
104  /// \short Function pointer for function that squashes
105  /// the mesh near the walls. Default trivial mapping (the identity)
106  /// leaves vertical nodal positions unchanged. Mapping is
107  /// used in underlying CollapsibleChannelDomain. Virtual
108  /// so we can break it in derived classes (e.g. the Algebraic
109  /// versions of this mesh where it doesn't make any sense
110  /// to provide the bl_squash_fct after the mesh has been built).
112  {
113  return Domain_pt->bl_squash_fct_pt();
114  }
115 
116 
117  /// \short Function pointer for function that squashes
118  /// the mesh near the walls. Default trivial mapping (the identity)
119  /// leaves vertical nodal positions unchanged. Mapping is
120  /// used in underlying CollapsibleChannelDomain. Const version.
122  {
123  return Domain_pt->bl_squash_fct_pt();
124  }
125 
126 
127  /// \short Function pointer for function that redistributes the
128  /// elements in the axial direction. Virtual
129  /// so we can break it in derived classes (e.g. the Algebraic
130  /// versions of this mesh where it doesn't make any sense
131  /// to provide the bl_squash_fct after the mesh has been built).
133  {
135  }
136 
137 
138  /// \short Function pointer for function that redistributes the
139  /// elements in the axial direction. Const version
141  const
142  {
144  }
145 
146 
147 protected:
148 
149  /// Pointer to domain
151 
152  /// Number of element columns in upstream part
153  unsigned Nup;
154 
155  /// Number of element columns in collapsible part
156  unsigned Ncollapsible;
157 
158  /// Number of element columns in downstream part
159  unsigned Ndown;
160 
161  /// Number of element rows across channel
162  unsigned Ny;
163 
164  /// Pointer to geometric object that represents the moving wall
166 
167 
168 };
169 
170 
171 /////////////////////////////////////////////////////////////////////
172 /////////////////////////////////////////////////////////////////////
173 /////////////////////////////////////////////////////////////////////
174 
175 
176 
177 //===================================================================
178 /// Refineable collapsible channel mesh.
179 /// The mesh is derived from the \c SimpleRectangularQuadMesh
180 /// so it's node and element numbering scheme is the same
181 /// as in that mesh. Only the boundaries are numbered differently
182 /// to allow the easy identification of the "collapsible" segment.
183 /// Boundary coordinates are set up for all nodes
184 /// located on boundary 3 (the collapsible segment).
185 /// The curvilinear ("collapsible") segment is defined by
186 /// a \c GeomObject.
187 //====================================================================
188 template <class ELEMENT>
190  public virtual CollapsibleChannelMesh<ELEMENT>,
191  public RefineableQuadMesh<ELEMENT>
192 {
193 
194 public :
195 
196  /// \short Constructor: Pass number of elements, lengths, pointer to
197  /// geometric object that describes the wall and timestepper
198  RefineableCollapsibleChannelMesh(const unsigned& nup,
199  const unsigned& ncollapsible,
200  const unsigned& ndown,
201  const unsigned& ny,
202  const double& lup,
203  const double& lcollapsible,
204  const double& ldown,
205  const double& ly,
207  TimeStepper* time_stepper_pt=
209  CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
210  lup, lcollapsible, ldown, ly,
211  wall_pt,
212  time_stepper_pt)
213  {
214  // Build quadtree forest
215  this->setup_quadtree_forest();
216  }
217 
218 
219  ///Destructor(empty)
221 
222 
223 };
224 
225 
226 
227 /////////////////////////////////////////////////////////////////////
228 /////////////////////////////////////////////////////////////////////
229 /////////////////////////////////////////////////////////////////////
230 
231 
232 //=====start_of_mesh=======================================================
233 /// Collapsible channel mesh with MacroElement-based node update.
234 /// The collapsible segment is represented by the specified geometric object.
235 /// Some or all of the geometric Data in that geometric object
236 /// may contain unknowns in the global Problem. The dependency
237 /// on these unknowns is taken into account when setting up
238 /// the Jacobian matrix of the elements. For this purpose,
239 /// the element (whose type is specified by the template parameter)
240 /// must inherit from MacroElementNodeUpdateElementBase.
241 //========================================================================
242 template<class ELEMENT>
244  public virtual MacroElementNodeUpdateMesh,
245  public virtual CollapsibleChannelMesh<ELEMENT>
246 {
247 
248 public:
249 
250  /// \short Constructor: Pass numbers of elements and dimensions of the
251  /// various parts of the collapsible channel, pointer to
252  /// geometric object that represents the wall and pointer to
253  /// timestepper (defaults to Steady).
255  const unsigned& nup,
256  const unsigned& ncollapsible,
257  const unsigned& ndown,
258  const unsigned& ny,
259  const double& lup,
260  const double& lcollapsible,
261  const double& ldown,
262  const double& ly,
264  TimeStepper* time_stepper_pt=
266  CollapsibleChannelMesh<ELEMENT>(
267  nup, ncollapsible, ndown, ny,
268  lup, lcollapsible, ldown, ly,
269  wall_pt,
270  time_stepper_pt)
271  {
272 #ifdef PARANOID
273  ELEMENT* el_pt=new ELEMENT;
274  if (dynamic_cast<MacroElementNodeUpdateElementBase*>(el_pt)==0)
275  {
276  std::ostringstream error_message;
277  error_message
278  << "Base class for ELEMENT in "
279  << "MacroElementNodeUpdateCollapsibleChannelMesh needs"
280  << "to be of type MacroElementNodeUpdateElement!\n";
281  error_message << "Whereas it is: typeid(el_pt).name()"
282  << typeid(el_pt).name()
283  << std::endl;
284 
285  std::string function_name =
286  "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
287  function_name +=
288  "MacroElementNodeUpdateCollapsibleChannelMesh()";
289 
290  throw OomphLibError(error_message.str(),
291  OOMPH_CURRENT_FUNCTION,
292  OOMPH_EXCEPTION_LOCATION);
293  }
294  delete el_pt;
295 #endif
296 
297  // Setup all the information that's required for MacroElement-based
298  // node update: Tell the elements that their geometry depends on the
299  // wall geometric object
300  unsigned n_element = this->nelement();
301  for(unsigned i=0;i<n_element;i++)
302  {
303  // Upcast from FiniteElement to the present element
304  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(this->element_pt(i));
305 
306 #ifdef PARANOID
307  // Check if cast is successful
308  MacroElementNodeUpdateElementBase* m_el_pt=dynamic_cast<
310  if (m_el_pt==0)
311  {
312  std::ostringstream error_message;
313  error_message
314  << "Failed to upcast to MacroElementNodeUpdateElementBase\n";
315  error_message
316  << "Element must be derived from MacroElementNodeUpdateElementBase\n";
317  error_message << "but it is of type " << typeid(el_pt).name();
318 
319  std::string function_name =
320  "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
321  function_name +=
322  "MacroElementNodeUpdateCollapsibleChannelMesh()";
323 
324  throw OomphLibError(error_message.str(),
325  OOMPH_CURRENT_FUNCTION,
326  OOMPH_EXCEPTION_LOCATION);
327  }
328 #endif
329 
330  // There's just one GeomObject
331  Vector<GeomObject*> geom_object_pt(1);
332  geom_object_pt[0] = this->Wall_pt;
333 
334  // Tell the element which geom objects its macro-element-based
335  // node update depends on
336  el_pt->set_node_update_info(geom_object_pt);
337  }
338 
339  // Add the geometric object(s) for the wall to the mesh's storage
340  Vector<GeomObject*> geom_object_pt(1);
341  geom_object_pt[0] = this->Wall_pt;
343 
344  // Fill in the domain pointer to the mesh's storage in the base class
346 
347  } // end of constructor
348 
349 
350 
351  /// \short Destructor: empty
353 
354 
355 }; //end of mesh
356 
357 
358 
359 ////////////////////////////////////////////////////////////////////////////
360 ////////////////////////////////////////////////////////////////////////////
361 ////////////////////////////////////////////////////////////////////////////
362 
363 
364 //=====start_of_mesh=======================================================
365 /// Refineable collapsible channel mesh with MacroElement-based node update.
366 /// The collapsible segment is represented by the specified geometric object.
367 /// Some or all of the geometric Data in that geometric object
368 /// may contain unknowns in the global Problem. The dependency
369 /// on these unknowns is taken into account when setting up
370 /// the Jacobian matrix of the elements. For this purpose,
371 /// the element (whose type is specified by the template parameter)
372 /// must inherit from MacroElementNodeUpdateElementBase.
373 //========================================================================
374 template<class ELEMENT>
376  public virtual MacroElementNodeUpdateCollapsibleChannelMesh<ELEMENT>,
377  public virtual RefineableQuadMesh<ELEMENT>
378 {
379 
380 public:
381 
382  /// \short Constructor: Pass numbers of elements and dimensions of the
383  /// various parts of the collapsible channel, pointer to
384  /// geometric object that represents the wall and pointer to
385  /// timestepper (defaults to Steady).
387  const unsigned& nup,
388  const unsigned& ncollapsible,
389  const unsigned& ndown,
390  const unsigned& ny,
391  const double& lup,
392  const double& lcollapsible,
393  const double& ldown,
394  const double& ly,
396  TimeStepper* time_stepper_pt=
398  CollapsibleChannelMesh<ELEMENT>(
399  nup, ncollapsible, ndown, ny,
400  lup, lcollapsible, ldown, ly,
401  wall_pt,
402  time_stepper_pt),
404  nup, ncollapsible, ndown, ny,
405  lup, lcollapsible, ldown, ly,
406  wall_pt,
407  time_stepper_pt)
408  {
409 
410  // Build quadtree forest
411  this->setup_quadtree_forest();
412 
413  }
414 
415  /// \short Destructor: empty
417 
418  }; //end of mesh
419 
420 
421 
422 
423 
424 /////////////////////////////////////////////////////////////////////
425 /////////////////////////////////////////////////////////////////////
426 /////////////////////////////////////////////////////////////////////
427 
428 
429 
430 //========start_of_algebraic_collapsible_channel_mesh==============
431 /// Collapsible channel mesh with algebraic node update
432 //=================================================================
433 template<class ELEMENT>
435  public virtual CollapsibleChannelMesh<ELEMENT>,
436  public AlgebraicMesh
437 {
438 
439 public:
440 
441 
442  /// \short Constructor: Pass number of elements in upstream/collapsible/
443  /// downstream segment and across the channel; lengths of upstream/
444  /// collapsible/downstream segments and width of channel, pointer to
445  /// GeomObject that defines the collapsible segment and pointer to
446  /// TimeStepper (defaults to the default timestepper, Steady).
447  AlgebraicCollapsibleChannelMesh(const unsigned& nup,
448  const unsigned& ncollapsible,
449  const unsigned& ndown,
450  const unsigned& ny,
451  const double& lup,
452  const double& lcollapsible,
453  const double& ldown,
454  const double& ly,
456  TimeStepper* time_stepper_pt=
458  CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
459  lup, lcollapsible, ldown, ly,
460  wall_pt,
461  time_stepper_pt)
462  {
463  // Add the geometric object to the list associated with this AlgebraicMesh
465 
466  // Setup algebraic node update operations
467  setup_algebraic_node_update();
468  }
469 
470  /// \short Destructor: empty
472 
473 
474  /// \short Constructor: Pass number of elements in upstream/collapsible/
475  /// downstream segment and across the channel; lengths of upstream/
476  /// collapsible/downstream segments and width of channel, pointer to
477  /// GeomObject that defines the collapsible segment and pointer to
478  /// TimeStepper (defaults to the default timestepper, Steady).
480  const unsigned& nup,
481  const unsigned& ncollapsible,
482  const unsigned& ndown,
483  const unsigned& ny,
484  const double& lup,
485  const double& lcollapsible,
486  const double& ldown,
487  const double& ly,
489  CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt,
490  TimeStepper* time_stepper_pt=
492  CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
493  lup, lcollapsible, ldown, ly,
494  wall_pt,
495  time_stepper_pt)
496  {
497  // Add the geometric object to the list associated with this AlgebraicMesh
499 
500  // Set boundary layer squash function
501  this->Domain_pt->bl_squash_fct_pt()=bl_squash_function_pt;
502 
503  // Do MacroElement-based node update
505 
506  // Setup algebraic node update operations
507  setup_algebraic_node_update();
508 
509  }
510 
511  /// \short Function pointer for function that squashes
512  /// the mesh near the walls. Default trivial mapping (the identity)
513  /// leaves vertical nodal positions unchanged. Mapping is
514  /// used in underlying CollapsibleChannelDomain. Broken function
515  /// that overloads the version in the CollapsibleChannelMesh.
516  /// It does not make sense to specify the function pointer
517  /// after the mesh has been set up!
519  {
520  std::ostringstream error_message;
521  error_message
522  << "It does not make sense to set the bl_squash_fct_pt \n"
523  << "outside the constructor as it's only used to set up the \n"
524  << "algebraic remesh data when the algebraic mesh is first built. \n";
525  std::string function_name =
526  "AlgebraicCollapsibleChannelMesh::bl_squash_fct_pt()\n";
527 
528  throw OomphLibError(error_message.str(),
529  OOMPH_CURRENT_FUNCTION,
530  OOMPH_EXCEPTION_LOCATION);
531 
532  // Dummy return
533  return Dummy_fct_pt;
534  }
535 
536 
537  /// \short Function pointer for function that redistributes nodes
538  /// axially. Default trivial mapping (the identity)
539  /// leaves vertical nodal positions unchanged. Mapping is
540  /// used in underlying CollapsibleChannelDomain. Broken function
541  /// that overloads the version in the CollapsibleChannelMesh.
542  /// It does not make sense to specify the function pointer
543  /// after the mesh has been set up!
545  {
546  std::ostringstream error_message;
547  error_message
548  << "It does not make sense to set the axial_spacing_fct_pt \n"
549  << "outside the constructor as it's only used to set up the \n"
550  << "algebraic remesh data when the algebraic mesh is first built. \n";
551  std::string function_name =
552  "AlgebraicCollapsibleChannelMesh::axial_spacing_fct_pt()\n";
553 
554  throw OomphLibError(error_message.str(),
555  OOMPH_CURRENT_FUNCTION,
556  OOMPH_EXCEPTION_LOCATION);
557 
558  // Dummy return
559  return Dummy_fct_pt;
560  }
561 
562 
563  /// \short Update nodal position at time level t (t=0: present;
564  /// t>0: previous)
565  void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
566 
567  /// \short Update the node-udate data after mesh adaptation.
568  /// Empty -- no update of node update required as this is
569  /// non-refineable mesh.
571 
572 protected:
573 
574  /// Function to setup the algebraic node update
575  void setup_algebraic_node_update();
576 
577  /// Dummy function pointer
579 
580 };
581 
582 
583 
584 
585 
586 ///////////////////////////////////////////////////////////////////////////
587 ///////////////////////////////////////////////////////////////////////////
588 ///////////////////////////////////////////////////////////////////////////
589 
590 
591 
592 //=====start_of_refineable_algebraic_collapsible_channel_mesh=====
593 /// Refineable version of the CollapsibleChannel mesh with
594 /// algebraic node update.
595 //=================================================================
596 template<class ELEMENT>
598  public RefineableQuadMesh<ELEMENT>,
599  public virtual AlgebraicCollapsibleChannelMesh<ELEMENT>
600 {
601 
602 public:
603 
604 
605  /// \short Constructor: Pass number of elements in upstream/collapsible/
606  /// downstream segment and across the channel; lengths of upstream/
607  /// collapsible/downstream segments and width of channel, pointer to
608  /// GeomObject that defines the collapsible segment and pointer to
609  /// TimeStepper (defaults to the default timestepper, Steady).
611  const unsigned& ncollapsible,
612  const unsigned& ndown,
613  const unsigned& ny,
614  const double& lup,
615  const double& lcollapsible,
616  const double& ldown,
617  const double& ly,
619  TimeStepper* time_stepper_pt=
621  CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
622  lup, lcollapsible, ldown, ly,
623  wall_pt,
624  time_stepper_pt),
625  AlgebraicCollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
626  lup, lcollapsible, ldown, ly,
627  wall_pt,
628  time_stepper_pt)
629  {
630  // Build quadtree forest
631  this->setup_quadtree_forest();
632  }
633 
634 
635 
636 
637  /// \short Constructor: Pass number of elements in upstream/collapsible/
638  /// downstream segment and across the channel; lengths of upstream/
639  /// collapsible/downstream segments and width of channel, pointer to
640  /// GeomObject that defines the collapsible segment and pointer to
641  /// TimeStepper (defaults to the default timestepper, Steady).
643  const unsigned& nup,
644  const unsigned& ncollapsible,
645  const unsigned& ndown,
646  const unsigned& ny,
647  const double& lup,
648  const double& lcollapsible,
649  const double& ldown,
650  const double& ly,
652  CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt,
653  TimeStepper* time_stepper_pt=
655  CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
656  lup, lcollapsible, ldown, ly,
657  wall_pt,
658  time_stepper_pt),
659  AlgebraicCollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
660  lup, lcollapsible, ldown, ly,
661  wall_pt,
662  bl_squash_function_pt,
663  time_stepper_pt)
664  {
665  // Build quadtree forest
666  this->setup_quadtree_forest();
667  }
668 
669  /// \short Update the node update data for specified node following
670  /// any mesh adapation
671  void update_node_update(AlgebraicNode*& node_pt);
672 
673 };
674 
675 
676 
677 
678 }
679 
680 #endif
unsigned Ncollapsible
Number of element columns in collapsible part.
CollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
CollapsibleChannelDomain::BLSquashFctPt bl_squash_fct_pt() const
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
MacroElementNodeUpdateCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass numbers of elements and dimensions of the various parts of the collapsible channel...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
Definition: mesh.h:85
CollapsibleChannelDomain::BLSquashFctPt Dummy_fct_pt
Dummy function pointer.
CollapsibleChannelDomain * Domain_pt
Pointer to domain.
cstr elem_len * i
Definition: cfortran.h:607
CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Add the specified GeomObject to the list of geometric objects associated with this AlgebraicMesh; rem...
char t
Definition: cfortran.h:572
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the macro elements near wall. Default mapping (identity) ...
void update_node_update(AlgebraicNode *&node_pt)
Update the node-udate data after mesh adaptation. Empty – no update of node update required as this ...
AlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
MacroElementNodeUpdateRefineableCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass numbers of elements and dimensions of the various parts of the collapsible channel...
AlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:587
CollapsibleChannelDomain * domain_pt()
Access function to domain.
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
unsigned Ny
Number of element rows across channel.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the macro elements near the wall to help reso...
virtual CollapsibleChannelDomain::AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that redistributes the elements in the axial direction. Virtual so we can break it in derived classes (e.g. the Algebraic versions of this mesh where it doesn&#39;t make any sense to provide the bl_squash_fct after the mesh has been built).
CollapsibleChannelDomain::BLSquashFctPt & axial_spacing_fct_pt()
Function pointer for function that redistributes nodes axially. Default trivial mapping (the identity...
unsigned Nup
Number of element columns in upstream part.
Basic collapsible channel mesh. The mesh is derived from the SimpleRectangularQuadMesh so it&#39;s node a...
Domain *& macro_domain_pt()
Broken assignment operator.
RefineableCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to geometric object that describes the wall an...
Collapsible channel mesh with algebraic node update.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:456
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
RefineableAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
virtual void node_update(const bool &update_all_solid_nodes=false)
Update nodal positions in response to changes in the domain shape. Uses the FiniteElement::get_x(...) function for FiniteElements and doesn&#39;t do anything for other element types. If a MacroElement pointer has been set for a FiniteElement, the MacroElement representation is used to update the nodal positions; if not get_x(...) uses the FE interpolation and thus leaves the nodal positions unchanged. Virtual, so it can be overloaded by specific meshes, such as AlgebraicMeshes or SpineMeshes. Generally, this function updates the position of all nodes in response to changes in the boundary position. However, we ignore all SolidNodes since their position is computed as part of the solution – unless the bool flag is set to true. Such calls are typically made when the initial mesh is created and/or after a mesh has been refined repeatedly before the start of the computation.
Definition: mesh.cc:290
Base class for elements that allow MacroElement-based node update.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn&#39;t been defined.
RefineableAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
virtual CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
virtual CollapsibleChannelDomain::AxialSpacingFctPt & axial_spacing_fct_pt() const
Function pointer for function that redistributes the elements in the axial direction. Const version.
void set_geom_object_vector_pt(Vector< GeomObject *> geom_object_vector_pt)
Set geometric objects associated with MacroElementNodeUpdateMesh; this must also be called from the c...
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition: mesh.h:470
unsigned Ndown
Number of element columns in downstream part.
const unsigned & ny() const
Access function for number of elements in y directions.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
GeomObject *& wall_pt()
Access function to GeomObject representing wall.