27 #ifndef OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER
28 #define OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER
31 #include "../generic/refineable_quad_mesh.h"
32 #include "../generic/macro_element.h"
33 #include "../generic/domain.h"
34 #include "../generic/quad_mesh.h"
41 #include "../generic/macro_element_node_update_element.h"
45 #include "../generic/algebraic_elements.h"
63 template<
class ELEMENT>
74 const unsigned& ncollapsible,
75 const unsigned& ndown,
78 const double& lcollapsible,
82 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
182 template<
class ELEMENT>
185 public RefineableQuadMesh<ELEMENT>
192 const unsigned& ncollapsible,
193 const unsigned& ndown,
196 const double& lcollapsible,
200 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
213 this->setup_quadtree_forest();
237 template<
class ELEMENT>
239 :
public virtual MacroElementNodeUpdateMesh,
249 const unsigned& ncollapsible,
250 const unsigned& ndown,
253 const double& lcollapsible,
257 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
270 ELEMENT* el_pt =
new ELEMENT;
271 if (
dynamic_cast<MacroElementNodeUpdateElementBase*
>(el_pt) == 0)
273 std::ostringstream error_message;
274 error_message <<
"Base class for ELEMENT in "
275 <<
"MacroElementNodeUpdateCollapsibleChannelMesh needs"
276 <<
"to be of type MacroElementNodeUpdateElement!\n";
277 error_message <<
"Whereas it is: typeid(el_pt).name()"
278 <<
typeid(el_pt).name() << std::endl;
280 std::string function_name =
281 "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
282 function_name +=
"MacroElementNodeUpdateCollapsibleChannelMesh()";
284 throw OomphLibError(error_message.str(),
285 OOMPH_CURRENT_FUNCTION,
286 OOMPH_EXCEPTION_LOCATION);
294 unsigned n_element = this->nelement();
295 for (
unsigned i = 0; i < n_element; i++)
298 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(this->element_pt(i));
302 MacroElementNodeUpdateElementBase* m_el_pt =
303 dynamic_cast<MacroElementNodeUpdateElementBase*
>(el_pt);
306 std::ostringstream error_message;
308 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
309 error_message <<
"Element must be derived from "
310 "MacroElementNodeUpdateElementBase\n";
311 error_message <<
"but it is of type " <<
typeid(el_pt).name();
313 std::string function_name =
314 "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
315 function_name +=
"MacroElementNodeUpdateCollapsibleChannelMesh()";
317 throw OomphLibError(error_message.str(),
318 OOMPH_CURRENT_FUNCTION,
319 OOMPH_EXCEPTION_LOCATION);
324 Vector<GeomObject*> geom_object_pt(1);
325 geom_object_pt[0] = this->
Wall_pt;
329 el_pt->set_node_update_info(geom_object_pt);
333 Vector<GeomObject*> geom_object_pt(1);
334 geom_object_pt[0] = this->
Wall_pt;
335 MacroElementNodeUpdateMesh::set_geom_object_vector_pt(geom_object_pt);
338 MacroElementNodeUpdateMesh::macro_domain_pt() = this->
domain_pt();
365 template<
class ELEMENT>
368 public virtual RefineableQuadMesh<ELEMENT>
377 const unsigned& ncollapsible,
378 const unsigned& ndown,
381 const double& lcollapsible,
385 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
408 this->setup_quadtree_forest();
425 template<
class ELEMENT>
438 const unsigned& ncollapsible,
439 const unsigned& ndown,
442 const double& lcollapsible,
446 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
459 AlgebraicMesh::add_geom_object_list_pt(
wall_pt);
476 const unsigned& ncollapsible,
477 const unsigned& ndown,
480 const double& lcollapsible,
485 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
498 AlgebraicMesh::add_geom_object_list_pt(
wall_pt);
519 std::ostringstream error_message;
521 <<
"It does not make sense to set the bl_squash_fct_pt \n"
522 <<
"outside the constructor as it's only used to set up the \n"
523 <<
"algebraic remesh data when the algebraic mesh is first built. \n";
524 std::string function_name =
525 "AlgebraicCollapsibleChannelMesh::bl_squash_fct_pt()\n";
528 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
544 std::ostringstream error_message;
546 <<
"It does not make sense to set the axial_spacing_fct_pt \n"
547 <<
"outside the constructor as it's only used to set up the \n"
548 <<
"algebraic remesh data when the algebraic mesh is first built. \n";
549 std::string function_name =
550 "AlgebraicCollapsibleChannelMesh::axial_spacing_fct_pt()\n";
553 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
587 template<
class ELEMENT>
589 :
public RefineableQuadMesh<ELEMENT>,
600 const unsigned& ncollapsible,
601 const unsigned& ndown,
604 const double& lcollapsible,
608 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
631 this->setup_quadtree_forest();
642 const unsigned& ncollapsible,
643 const unsigned& ndown,
646 const double& lcollapsible,
651 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
671 bl_squash_function_pt,
675 this->setup_quadtree_forest();
////////////////////////////////////////////////////////////////// //////////////////////////////////...
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...
void setup_algebraic_node_update()
Function to setup the algebraic node update.
CollapsibleChannelDomain::BLSquashFctPt Dummy_fct_pt
Dummy function pointer.
virtual ~AlgebraicCollapsibleChannelMesh()
Destructor: empty.
void update_node_update(AlgebraicNode *&node_pt)
Update the node-udate data after mesh adaptation. Empty – no update of node update required as this i...
CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
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...
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
CollapsibleChannelDomain::BLSquashFctPt & axial_spacing_fct_pt()
Function pointer for function that redistributes nodes axially. Default trivial mapping (the identity...
Collapsible channel domain.
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the macro elements near the wall to help reso...
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the macro elements near wall. Default mapping (identity) ...
Basic collapsible channel mesh. The mesh is derived from the SimpleRectangularQuadMesh so it's node a...
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
~CollapsibleChannelMesh()
destructor
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
CollapsibleChannelDomain * domain_pt()
Access function to domain.
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...
virtual CollapsibleChannelDomain::AxialSpacingFctPt & axial_spacing_fct_pt() const
Function pointer for function that redistributes the elements in the axial direction....
unsigned Ncollapsible
Number of element columns in collapsible part.
virtual CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
unsigned Nup
Number of element columns in upstream part.
virtual CollapsibleChannelDomain::AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that redistributes the elements in the axial direction....
unsigned Ndown
Number of element columns in downstream part.
CollapsibleChannelDomain * Domain_pt
Pointer to domain.
unsigned Ny
Number of element rows across channel.
////////////////////////////////////////////////////////////////// //////////////////////////////////...
virtual ~MacroElementNodeUpdateCollapsibleChannelMesh()
Destructor: empty.
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,...
///////////////////////////////////////////////////////////////////////// ///////////////////////////...
virtual ~MacroElementNodeUpdateRefineableCollapsibleChannelMesh()
Destructor: empty.
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,...
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
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...
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...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
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...
~RefineableCollapsibleChannelMesh()
Destructor(empty)
Simple rectangular 2D Quad mesh class. Nx : number of elements in the x direction.
const unsigned & ny() const
Access function for number of elements in y directions.
////////////////////////////////////////////////////////////////////// //////////////////////////////...