30 #ifndef OOMPH_QUARTER_CIRCLE_SECTOR_MESH_HEADER 31 #define OOMPH_QUARTER_CIRCLE_SECTOR_MESH_HEADER 33 #include "../generic/refineable_quad_mesh.h" 34 #include "../generic/macro_element.h" 35 #include "../generic/domain.h" 36 #include "../generic/algebraic_elements.h" 37 #include "../generic/quad_mesh.h" 38 #include "../generic/macro_element_node_update_element.h" 91 template <
class ELEMENT>
105 const double& fract_mid,
195 template <
class ELEMENT>
212 const double& fract_mid,
223 this->setup_quadtree_forest();
274 template<
class ELEMENT>
294 const double& fract_mid,
304 ELEMENT* el_pt=
new ELEMENT;
305 if (dynamic_cast<MacroElementNodeUpdateElementBase*>(el_pt)==0)
307 std::ostringstream error_message;
309 <<
"Base class for ELEMENT in " 310 <<
"MacroElementNodeUpdateRefineableQuarterCircleSectorMesh needs" 311 <<
"to be of type MacroElementNodeUpdateElement!\n";
312 error_message <<
"Whereas it is: typeid(el_pt).name()" 313 <<
typeid(el_pt).name()
317 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
319 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh()";
322 OOMPH_CURRENT_FUNCTION,
323 OOMPH_EXCEPTION_LOCATION);
331 this->setup_macro_element_node_update();
345 if (update_all_solid_nodes)
348 "Doesn't make sense to use an MacroElementNodeUpdateMesh with\n";
350 "SolidElements so specifying update_all_solid_nodes=true\n";
351 error_message +=
"doesn't make sense either\n";
354 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
355 function_name +=
"node_update()";
358 OOMPH_CURRENT_FUNCTION,
359 OOMPH_EXCEPTION_LOCATION);
372 unsigned n_element = this->
nelement();
373 for(
unsigned i=0;
i<n_element;
i++)
376 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->
element_pt(
i));
384 std::ostringstream error_message;
386 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
388 <<
"Element must be derived from MacroElementNodeUpdateElementBase\n";
389 error_message <<
"but it is of type " <<
typeid(el_pt).name();
392 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
393 function_name +=
"setup_macro_element_node_update()";
396 OOMPH_CURRENT_FUNCTION,
397 OOMPH_EXCEPTION_LOCATION);
402 geom_object_pt[0] = this->
Wall_pt;
406 el_pt->set_node_update_info(geom_object_pt);
412 geom_object_pt[0] = this->
Wall_pt;
468 template<
class ELEMENT>
488 const double& fract_mid,
497 ELEMENT* el_pt=
new ELEMENT;
498 if (dynamic_cast<AlgebraicElementBase*>(el_pt)==0)
500 std::ostringstream error_message;
502 error_message <<
"Base class for ELEMENT in " 503 <<
"AlgebraicRefineableQuarterCircleSectorMesh needs" 504 <<
"to be of type AlgebraicElement!\n";
505 error_message <<
"Whereas it is: typeid(el_pt).name()" 506 <<
typeid(el_pt).name()
510 " AlgebraicRefineableQuarterCircleSectorMesh::\n";
511 function_name +=
"AlgebraicRefineableQuarterCircleSectorMesh()";
514 OOMPH_CURRENT_FUNCTION,
515 OOMPH_EXCEPTION_LOCATION);
524 setup_algebraic_node_update();
541 if (update_all_solid_nodes)
544 "Doesn't make sense to use an AlgebraicMesh with\n";
546 "SolidElements so specifying update_all_solid_nodes=true\n";
547 error_message +=
"doesn't make sense either\n";
550 " AlgebraicRefineableQuarterCircleSectorMesh::";
551 function_name +=
"node_update()";
554 OOMPH_CURRENT_FUNCTION,
555 OOMPH_EXCEPTION_LOCATION);
580 node_update_in_central_box(t,node_pt);
584 case Lower_right_box:
587 node_update_in_lower_right_box(t,node_pt);
593 node_update_in_upper_left_box(t,node_pt);
598 std::ostringstream error_message;
599 error_message <<
"The node update fct id is " 600 <<
id <<
", but it should only be one of " 601 << Central_box <<
", " 602 << Lower_right_box <<
" or " 603 << Upper_left_box << std::endl;
605 " AlgebraicRefineableQuarterCircleSectorMesh::";
606 function_name +=
"algebraic_node_update()";
609 OOMPH_CURRENT_FUNCTION,
610 OOMPH_EXCEPTION_LOCATION);
624 unsigned n_update=
id.size();
625 for (
unsigned i=0;
i<n_update;
i++)
638 case Lower_right_box:
641 update_node_update_in_lower_right_box(node_pt);
647 update_node_update_in_upper_left_box(node_pt);
653 std::ostringstream error_message;
654 error_message <<
"Node update fct id is " <<
id[
i]
655 <<
", but it should only be one of" 656 << Central_box <<
", " 657 << Lower_right_box <<
" or " 658 << Upper_left_box << std::endl;
661 " AlgebraicRefineableQuarterCircleSectorMesh::";
662 function_name +=
"update_node_update()";
665 OOMPH_CURRENT_FUNCTION,
666 OOMPH_EXCEPTION_LOCATION);
674 enum{Central_box, Lower_right_box, Upper_left_box};
685 void node_update_in_central_box(
const unsigned&
t,
690 void node_update_in_lower_right_box(
const unsigned&
t,
695 void node_update_in_upper_left_box(
const unsigned&
t,
699 void setup_algebraic_node_update();
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 ...
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)
Update all nodal positions via sparse MacroElement-based update functions. If a Node is hanging its p...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
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 add_geom_object_list_pt(GeomObject *geom_object_pt)
Add the specified GeomObject to the list of geometric objects associated with this AlgebraicMesh; rem...
double Fract_mid
Fraction along wall where outer ring is to be divided.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
unsigned long nelement() const
Return number of elements in the mesh.
unsigned self_test()
Self test: check consistentency of multiple node updates.
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 ...
virtual ~QuarterCircleSectorMesh()
Destructor:
virtual ~RefineableQuarterCircleSectorMesh()
Destructor: Empty.
void node_update(const bool &update_all_solid_nodes=false)
Update all nodal positions via algebraic node update functions [Doesn't make sense to use this mesh w...
double Xi_lo
Lower limit for the (1D) coordinates along the wall.
double Lambda_y
Fractional height of central box.
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
QuarterCircleSectorDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
Domain *& macro_domain_pt()
Broken assignment operator.
QuarterCircleSectorDomain * Domain_pt
Pointer to Domain.
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...
unsigned self_test()
Run self-test for algebraic mesh – return 0/1 for OK/failure.
virtual ~MacroElementNodeUpdateRefineableQuarterCircleSectorMesh()
Destructor: empty.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the outer two macro elements towards the wall...
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...
Circular sector as domain. Domain is bounded by curved boundary which is represented by a GeomObject...
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
double Lambda_x
Fractional width of central box.
Base class for quad meshes (meshes made of 2D quad elements).
Base class for elements that allow MacroElement-based node update.
void update_node_update(AlgebraicNode *&node_pt)
Update the node update info for specified algebraic node following any spatial mesh adaptation...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
double Xi_hi
Upper limit for the (1D) coordinates along the wall.
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.
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...
GeomObject * Wall_pt
Pointer to the geometric object that represents the curved wall (mesh boundary 1) ...
QuarterCircleSectorDomain * domain_pt()
Access function to domain.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...