26 #ifndef OOMPH_QUARTER_CIRCLE_SECTOR_MESH_HEADER
27 #define OOMPH_QUARTER_CIRCLE_SECTOR_MESH_HEADER
29 #include "../generic/refineable_quad_mesh.h"
30 #include "../generic/macro_element.h"
31 #include "../generic/domain.h"
32 #include "../generic/algebraic_elements.h"
33 #include "../generic/quad_mesh.h"
34 #include "../generic/macro_element_node_update_element.h"
85 template<
class ELEMENT>
97 const double& fract_mid,
99 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
184 template<
class ELEMENT>
187 public virtual RefineableQuadMesh<ELEMENT>
199 const double& fract_mid,
201 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
203 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
209 this->setup_quadtree_forest();
223 class MacroElementNodeUpdateNode;
257 template<
class ELEMENT>
259 :
public virtual MacroElementNodeUpdateMesh,
273 const double& fract_mid,
275 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
276 : MacroElementNodeUpdateMesh(),
278 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
281 ELEMENT* el_pt =
new ELEMENT;
282 if (
dynamic_cast<MacroElementNodeUpdateElementBase*
>(el_pt) == 0)
284 std::ostringstream error_message;
286 <<
"Base class for ELEMENT in "
287 <<
"MacroElementNodeUpdateRefineableQuarterCircleSectorMesh needs"
288 <<
"to be of type MacroElementNodeUpdateElement!\n";
289 error_message <<
"Whereas it is: typeid(el_pt).name()"
290 <<
typeid(el_pt).name() << std::endl;
292 std::string function_name =
293 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
295 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh()";
297 throw OomphLibError(error_message.str(),
298 OOMPH_CURRENT_FUNCTION,
299 OOMPH_EXCEPTION_LOCATION);
321 if (update_all_solid_nodes)
323 std::string error_message =
324 "Doesn't make sense to use an MacroElementNodeUpdateMesh with\n";
326 "SolidElements so specifying update_all_solid_nodes=true\n";
327 error_message +=
"doesn't make sense either\n";
329 std::string function_name =
330 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
331 function_name +=
"node_update()";
334 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
337 MacroElementNodeUpdateMesh::node_update();
346 unsigned n_element = this->nelement();
347 for (
unsigned i = 0; i < n_element; i++)
350 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(this->element_pt(i));
354 MacroElementNodeUpdateElementBase* m_el_pt =
355 dynamic_cast<MacroElementNodeUpdateElementBase*
>(el_pt);
358 std::ostringstream error_message;
360 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
361 error_message <<
"Element must be derived from "
362 "MacroElementNodeUpdateElementBase\n";
363 error_message <<
"but it is of type " <<
typeid(el_pt).name();
365 std::string function_name =
366 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
367 function_name +=
"setup_macro_element_node_update()";
369 throw OomphLibError(error_message.str(),
370 OOMPH_CURRENT_FUNCTION,
371 OOMPH_EXCEPTION_LOCATION);
375 Vector<GeomObject*> geom_object_pt(1);
376 geom_object_pt[0] = this->
Wall_pt;
380 el_pt->set_node_update_info(geom_object_pt);
384 Vector<GeomObject*> geom_object_pt(1);
385 geom_object_pt[0] = this->
Wall_pt;
386 MacroElementNodeUpdateMesh::set_geom_object_vector_pt(geom_object_pt);
389 MacroElementNodeUpdateMesh::macro_domain_pt() = this->
domain_pt();
438 template<
class ELEMENT>
440 :
public virtual AlgebraicMesh,
454 const double& fract_mid,
456 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
458 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
461 ELEMENT* el_pt =
new ELEMENT;
462 if (
dynamic_cast<AlgebraicElementBase*
>(el_pt) == 0)
464 std::ostringstream error_message;
466 error_message <<
"Base class for ELEMENT in "
467 <<
"AlgebraicRefineableQuarterCircleSectorMesh needs"
468 <<
"to be of type AlgebraicElement!\n";
469 error_message <<
"Whereas it is: typeid(el_pt).name()"
470 <<
typeid(el_pt).name() << std::endl;
472 std::string function_name =
473 " AlgebraicRefineableQuarterCircleSectorMesh::\n";
474 function_name +=
"AlgebraicRefineableQuarterCircleSectorMesh()";
476 throw OomphLibError(error_message.str(),
477 OOMPH_CURRENT_FUNCTION,
478 OOMPH_EXCEPTION_LOCATION);
484 AlgebraicMesh::add_geom_object_list_pt(
wall_pt);
493 return AlgebraicMesh::self_test();
504 if (update_all_solid_nodes)
506 std::string error_message =
507 "Doesn't make sense to use an AlgebraicMesh with\n";
509 "SolidElements so specifying update_all_solid_nodes=true\n";
510 error_message +=
"doesn't make sense either\n";
512 std::string function_name =
513 " AlgebraicRefineableQuarterCircleSectorMesh::";
514 function_name +=
"node_update()";
517 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
520 AlgebraicMesh::node_update();
531 unsigned id = node_pt->node_update_fct_id();
556 std::ostringstream error_message;
557 error_message <<
"The node update fct id is " <<
id
558 <<
", but it should only be one of " <<
Central_box
561 std::string function_name =
562 " AlgebraicRefineableQuarterCircleSectorMesh::";
563 function_name +=
"algebraic_node_update()";
565 throw OomphLibError(error_message.str(),
566 OOMPH_CURRENT_FUNCTION,
567 OOMPH_EXCEPTION_LOCATION);
577 node_pt->node_update_fct_id(
id);
580 unsigned n_update =
id.size();
581 for (
unsigned i = 0; i < n_update; i++)
606 std::ostringstream error_message;
607 error_message <<
"Node update fct id is " <<
id[i]
612 std::string function_name =
613 " AlgebraicRefineableQuarterCircleSectorMesh::";
614 function_name +=
"update_node_update()";
616 throw OomphLibError(error_message.str(),
617 OOMPH_CURRENT_FUNCTION,
618 OOMPH_EXCEPTION_LOCATION);
646 AlgebraicNode*& node_pt);
651 AlgebraicNode*& node_pt);
Algebraic version of RefineableQuarterCircleSectorMesh.
void update_node_update(AlgebraicNode *&node_pt)
Update the node update info for specified algebraic node following any spatial mesh adaptation.
double Lambda_y
Fractional height of central box.
void node_update(const bool &update_all_solid_nodes=false)
Resolve mesh update: Update current nodal positions via algebraic node update. [Doesn't make sense to...
void setup_algebraic_node_update()
Setup algebraic update operation for all nodes.
AlgebraicRefineableQuarterCircleSectorMesh(GeomObject *wall_pt, const double &xi_lo, const double &fract_mid, const double &xi_hi, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object, start and end coordinates on the geometric object and ...
unsigned self_test()
Run self-test for algebraic mesh – return 0/1 for OK/failure.
void update_node_update_in_lower_right_box(AlgebraicNode *&node_pt)
Update algebraic node update function for nodes in lower right box.
void node_update_in_central_box(const unsigned &t, AlgebraicNode *&node_pt)
Algebraic update function for a node that is located in the central box.
void node_update_in_lower_right_box(const unsigned &t, AlgebraicNode *&node_pt)
Algebraic update function for a node that is located in the lower right box.
void update_node_update_in_upper_left_box(AlgebraicNode *&node_pt)
Update algebraic node update function for nodes in upper left box.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Implement the algebraic node update function for a node at time level t (t=0: present; t>0: previous)...
void node_update_in_upper_left_box(const unsigned &t, AlgebraicNode *&node_pt)
Algebraic update function for a node that is located in the upper left box.
double Lambda_x
Fractional width of central box.
MacroElementNodeUpdate version of RefineableQuarterCircleSectorMesh.
virtual ~MacroElementNodeUpdateRefineableQuarterCircleSectorMesh()
Destructor: empty.
void setup_macro_element_node_update()
Setup all the information that's required for MacroElement-based node update: Tell the elements that ...
void node_update(const bool &update_all_solid_nodes=false)
Resolve mesh update: Update current nodal positions via sparse MacroElement-based update....
MacroElementNodeUpdateRefineableQuarterCircleSectorMesh(GeomObject *wall_pt, const double &xi_lo, const double &fract_mid, const double &xi_hi, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object, start and end coordinates on the geometric object and ...
Circular sector as domain. Domain is bounded by curved boundary which is represented by a GeomObject....
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the outer two macro elements towards the wall...
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
2D quarter ring mesh class. The domain is specified by the GeomObject that identifies boundary 1.
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
double Fract_mid
Fraction along wall where outer ring is to be divided.
double Xi_hi
Upper limit for the (1D) coordinates along the wall.
GeomObject * Wall_pt
Pointer to the geometric object that represents the curved wall (mesh boundary 1)
QuarterCircleSectorMesh(GeomObject *wall_pt, const double &xi_lo, const double &fract_mid, const double &xi_hi, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object that specifies the wall, start and end coordinates on t...
QuarterCircleSectorDomain * Domain_pt
Pointer to Domain.
QuarterCircleSectorDomain * domain_pt()
Access function to domain.
QuarterCircleSectorDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
double Xi_lo
Lower limit for the (1D) coordinates along the wall.
virtual ~QuarterCircleSectorMesh()
Destructor:
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
RefineableQuarterCircleSectorMesh(GeomObject *wall_pt, const double &xi_lo, const double &fract_mid, const double &xi_hi, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object that specifies the wall, start and end coordinates on t...
virtual ~RefineableQuarterCircleSectorMesh()
Destructor: Empty.
////////////////////////////////////////////////////////////////////// //////////////////////////////...