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,
184 template<
class ELEMENT>
199 const double& fract_mid,
203 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
223 class MacroElementNodeUpdateNode;
257 template<
class ELEMENT>
273 const double& fract_mid,
278 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
281 ELEMENT* el_pt =
new ELEMENT;
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;
293 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
295 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh()";
298 OOMPH_CURRENT_FUNCTION,
299 OOMPH_EXCEPTION_LOCATION);
321 if (update_all_solid_nodes)
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";
330 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
331 function_name +=
"node_update()";
334 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
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));
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();
366 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
367 function_name +=
"setup_macro_element_node_update()";
370 OOMPH_CURRENT_FUNCTION,
371 OOMPH_EXCEPTION_LOCATION);
376 geom_object_pt[0] = this->
Wall_pt;
380 el_pt->set_node_update_info(geom_object_pt);
385 geom_object_pt[0] = this->
Wall_pt;
438 template<
class ELEMENT>
454 const double& fract_mid,
458 wall_pt, xi_lo, fract_mid, xi_hi, time_stepper_pt)
461 ELEMENT* el_pt =
new ELEMENT;
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;
473 " AlgebraicRefineableQuarterCircleSectorMesh::\n";
474 function_name +=
"AlgebraicRefineableQuarterCircleSectorMesh()";
477 OOMPH_CURRENT_FUNCTION,
478 OOMPH_EXCEPTION_LOCATION);
504 if (update_all_solid_nodes)
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";
513 " AlgebraicRefineableQuarterCircleSectorMesh::";
514 function_name +=
"node_update()";
517 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
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
562 " AlgebraicRefineableQuarterCircleSectorMesh::";
563 function_name +=
"algebraic_node_update()";
566 OOMPH_CURRENT_FUNCTION,
567 OOMPH_EXCEPTION_LOCATION);
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]
613 " AlgebraicRefineableQuarterCircleSectorMesh::";
614 function_name +=
"update_node_update()";
617 OOMPH_CURRENT_FUNCTION,
618 OOMPH_EXCEPTION_LOCATION);
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
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...
unsigned self_test()
Self test: check consistentency of multiple node updates.
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...
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
////////////////////////////////////////////////////////////////////
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
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.
/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
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...
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...
Domain *& macro_domain_pt()
Broken assignment operator.
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 ...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
unsigned long nelement() const
Return number of elements in the mesh.
An OomphLibError object which should be thrown when an run-time error is encountered....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
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:
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
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.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...