31 #ifndef OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER 32 #define OOMPH_COLLAPSIBLE_CHANNEL_MESH_HEADER 35 #include "../generic/refineable_quad_mesh.h" 36 #include "../generic/macro_element.h" 37 #include "../generic/domain.h" 38 #include "../generic/quad_mesh.h" 45 #include "../generic/macro_element_node_update_element.h" 49 #include "../generic/algebraic_elements.h" 69 template <
class ELEMENT>
81 const unsigned& ncollapsible,
82 const unsigned& ndown,
85 const double& lcollapsible,
188 template <
class ELEMENT>
199 const unsigned& ncollapsible,
200 const unsigned& ndown,
203 const double& lcollapsible,
210 lup, lcollapsible, ldown, ly,
215 this->setup_quadtree_forest();
242 template<
class ELEMENT>
256 const unsigned& ncollapsible,
257 const unsigned& ndown,
260 const double& lcollapsible,
267 nup, ncollapsible, ndown, ny,
268 lup, lcollapsible, ldown, ly,
273 ELEMENT* el_pt=
new ELEMENT;
274 if (dynamic_cast<MacroElementNodeUpdateElementBase*>(el_pt)==0)
276 std::ostringstream 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()
286 "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
288 "MacroElementNodeUpdateCollapsibleChannelMesh()";
291 OOMPH_CURRENT_FUNCTION,
292 OOMPH_EXCEPTION_LOCATION);
300 unsigned n_element = this->
nelement();
301 for(
unsigned i=0;
i<n_element;
i++)
304 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->
element_pt(
i));
312 std::ostringstream error_message;
314 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
316 <<
"Element must be derived from MacroElementNodeUpdateElementBase\n";
317 error_message <<
"but it is of type " <<
typeid(el_pt).name();
320 "MacroElementNodeUpdateCollapsibleChannelMesh::\n";
322 "MacroElementNodeUpdateCollapsibleChannelMesh()";
325 OOMPH_CURRENT_FUNCTION,
326 OOMPH_EXCEPTION_LOCATION);
332 geom_object_pt[0] = this->
Wall_pt;
336 el_pt->set_node_update_info(geom_object_pt);
341 geom_object_pt[0] = this->
Wall_pt;
374 template<
class ELEMENT>
388 const unsigned& ncollapsible,
389 const unsigned& ndown,
392 const double& lcollapsible,
399 nup, ncollapsible, ndown, ny,
400 lup, lcollapsible, ldown, ly,
404 nup, ncollapsible, ndown, ny,
405 lup, lcollapsible, ldown, ly,
411 this->setup_quadtree_forest();
433 template<
class ELEMENT>
448 const unsigned& ncollapsible,
449 const unsigned& ndown,
452 const double& lcollapsible,
459 lup, lcollapsible, ldown, ly,
467 setup_algebraic_node_update();
481 const unsigned& ncollapsible,
482 const unsigned& ndown,
485 const double& lcollapsible,
493 lup, lcollapsible, ldown, ly,
507 setup_algebraic_node_update();
520 std::ostringstream 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";
526 "AlgebraicCollapsibleChannelMesh::bl_squash_fct_pt()\n";
529 OOMPH_CURRENT_FUNCTION,
530 OOMPH_EXCEPTION_LOCATION);
546 std::ostringstream 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";
552 "AlgebraicCollapsibleChannelMesh::axial_spacing_fct_pt()\n";
555 OOMPH_CURRENT_FUNCTION,
556 OOMPH_EXCEPTION_LOCATION);
575 void setup_algebraic_node_update();
596 template<
class ELEMENT>
611 const unsigned& ncollapsible,
612 const unsigned& ndown,
615 const double& lcollapsible,
622 lup, lcollapsible, ldown, ly,
626 lup, lcollapsible, ldown, ly,
631 this->setup_quadtree_forest();
644 const unsigned& ncollapsible,
645 const unsigned& ndown,
648 const double& lcollapsible,
656 lup, lcollapsible, ldown, ly,
660 lup, lcollapsible, ldown, ly,
662 bl_squash_function_pt,
666 this->setup_quadtree_forest();
unsigned Ncollapsible
Number of element columns in collapsible part.
virtual ~AlgebraicCollapsibleChannelMesh()
Destructor: empty.
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. ...
CollapsibleChannelDomain::BLSquashFctPt Dummy_fct_pt
Dummy function pointer.
CollapsibleChannelDomain * Domain_pt
Pointer to domain.
CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
virtual ~MacroElementNodeUpdateCollapsibleChannelMesh()
Destructor: empty.
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...
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...
~RefineableCollapsibleChannelMesh()
Destructor(empty)
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.
Collapsible channel domain.
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'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'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...
~CollapsibleChannelMesh()
destructor
Collapsible channel mesh with algebraic node update.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
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'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.
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'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.
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...
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
virtual ~MacroElementNodeUpdateRefineableCollapsibleChannelMesh()
Destructor: empty.