30 #ifndef OOMPH_QUARTER_TUBE_MESH_HEADER 31 #define OOMPH_QUARTER_TUBE_MESH_HEADER 34 #include "../generic/refineable_brick_mesh.h" 35 #include "../generic/macro_element.h" 36 #include "../generic/domain.h" 37 #include "../generic/algebraic_elements.h" 38 #include "../generic/brick_mesh.h" 39 #include "../generic/macro_element_node_update_element.h" 69 template <
class ELEMENT>
82 const double& fract_mid,
84 const unsigned& nlayer,
165 template<
class ELEMENT>
182 const double& fract_mid,
184 const unsigned& nlayer,
188 nlayer,time_stepper_pt)
191 for (
unsigned ielem=0;ielem<QuarterTubeMesh<ELEMENT>::nelement();ielem++)
202 for (
unsigned iel=0;iel<QuarterTubeMesh<ELEMENT>::nelement();iel++)
205 ELEMENT* ref_el_pt=
dynamic_cast<ELEMENT*
>(el_pt);
207 trees_pt.push_back(octree_root_pt);
213 unsigned success_flag=
217 oomph_info <<
"Successfully built octree forest " << std::endl;
222 "Trouble in building octree forest ",
223 OOMPH_CURRENT_FUNCTION,
224 OOMPH_EXCEPTION_LOCATION);
250 template<
class ELEMENT>
269 const double& fract_mid,
271 const unsigned& nlayer,
276 nlayer,time_stepper_pt),
278 nlayer,time_stepper_pt)
282 ELEMENT* el_pt=
new ELEMENT;
283 if (dynamic_cast<MacroElementNodeUpdateElementBase*>(el_pt)==0)
285 std::ostringstream error_message;
287 <<
"Base class for ELEMENT in " 288 <<
"MacroElementNodeUpdateRefineableQuarterTubeMesh needs" 289 <<
"to be of type MacroElementNodeUpdateElement!\n";
290 error_message <<
"Whereas it is: typeid(el_pt).name()" 291 <<
typeid(el_pt).name()
295 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
297 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh()";
300 OOMPH_CURRENT_FUNCTION,
301 OOMPH_EXCEPTION_LOCATION);
309 this->setup_macro_element_node_update();
323 if (update_all_solid_nodes)
326 "Doesn't make sense to use an MacroElementNodeUpdateMesh with\n";
328 "SolidElements so specifying update_all_solid_nodes=true\n";
329 error_message +=
"doesn't make sense either\n";
332 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
333 function_name +=
"node_update()";
336 OOMPH_CURRENT_FUNCTION,
337 OOMPH_EXCEPTION_LOCATION);
350 unsigned n_element = this->
nelement();
351 for(
unsigned i=0;
i<n_element;
i++)
354 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(this->
element_pt(
i));
362 std::ostringstream error_message;
364 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
366 <<
"Element must be derived from MacroElementNodeUpdateElementBase\n";
367 error_message <<
"but it is of type " <<
typeid(el_pt).name();
370 "MacroElementNodeUpdateRefineableQuaterCircleSectorMesh::\n";
371 function_name +=
"setup_macro_element_node_update()";
374 OOMPH_CURRENT_FUNCTION,
375 OOMPH_EXCEPTION_LOCATION);
380 geom_object_pt[0] = this->
Wall_pt;
384 el_pt->set_node_update_info(geom_object_pt);
389 geom_object_pt[0] = this->
Wall_pt;
461 template<
class ELEMENT>
478 const double& fract_mid,
480 const unsigned& nlayer,
481 const double centre_box_size=1.0,
485 nlayer, time_stepper_pt),
487 nlayer, time_stepper_pt),
488 Centre_box_size(centre_box_size)
492 ELEMENT* el_pt=
new ELEMENT;
493 if (dynamic_cast<AlgebraicElementBase*>(el_pt)==0)
495 std::ostringstream error_message;
497 error_message <<
"Base class for ELEMENT in " 498 <<
"AlgebraicRefineableQuarterTubeMesh needs" 499 <<
"to be of type AlgebraicElement!\n";
500 error_message <<
"Whereas it is: typeid(el_pt).name()" 501 <<
typeid(el_pt).name()
505 " AlgebraicRefineableQuarterTubeMesh::\n";
506 function_name +=
"AlgebraicRefineableQuarterTubeMesh()";
509 OOMPH_CURRENT_FUNCTION,
510 OOMPH_EXCEPTION_LOCATION);
519 setup_algebraic_node_update();
538 std::ostringstream error_message;
539 error_message <<
"AxialSpacingFctPt has not been implemented " 540 <<
"for the AlgebraicRefineableQuarterTubeMesh\n";
543 " AlgebraicRefineableQuarterTubeMesh::AxialSpacingFctPt()";
546 OOMPH_CURRENT_FUNCTION,
547 OOMPH_EXCEPTION_LOCATION);
560 if (update_all_solid_nodes)
563 "Doesn't make sense to use an AlgebraicMesh with\n";
565 "SolidElements so specifying update_all_solid_nodes=true\n";
566 error_message +=
"doesn't make sense either\n";
569 " AlgebraicRefineableQuarterTubeMesh::";
570 function_name +=
"node_update()";
573 OOMPH_CURRENT_FUNCTION,
574 OOMPH_EXCEPTION_LOCATION);
597 node_update_central_region(t,node_pt);
600 case Lower_right_region:
603 node_update_lower_right_region(t,node_pt);
606 case Upper_left_region:
609 node_update_upper_left_region(t,node_pt);
614 std::ostringstream error_message;
615 error_message <<
"The node update fct id is " 616 <<
id <<
", but it should only be one of " 617 << Central_region <<
", " 618 << Lower_right_region <<
" or " 619 << Upper_left_region << std::endl;
621 " AlgebraicRefineableQuarterTubeMesh::";
622 function_name +=
"algebraic_node_update()";
625 OOMPH_CURRENT_FUNCTION,
626 OOMPH_EXCEPTION_LOCATION);
639 unsigned n_update=
id.size();
640 for (
unsigned i=0;
i<n_update;
i++)
642 update_node_update_in_region(node_pt,
id[
i]);
653 enum{Central_region, Lower_right_region, Upper_left_region};
663 void node_update_central_region(
const unsigned&
t,
668 void node_update_lower_right_region(
const unsigned&
t,
673 void node_update_upper_left_region(
const unsigned&
t,
677 void setup_algebraic_node_update();
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
AlgebraicRefineableQuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, const double centre_box_size=1.0, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object, start and end coordinates of the geometric object and ...
RefineableQuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for adaptive deformable quarter tube mesh class. The domain is specified by the GeomObjec...
void update_node_update(AlgebraicNode *&node_pt)
Update the node update info for specified algebraic node following any spatial mesh adaptation...
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...
virtual ~RefineableQuarterTubeMesh()
Destructor: empty.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
unsigned self_test()
Run self-test for algebraic mesh – return 0/1 for OK/failure.
Base class for brick meshes (meshes made of 3D brick elements).
MacroElementNodeUpdateRefineableQuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object, start and end coordinates on the geometric object and ...
virtual QuarterTubeDomain::AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function for axial spacing.
A general Finite Element class.
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...
QuarterTubeDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer macro elements towards the wall by mapping the ...
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
QuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object that specifies the wall, start and end coordinates on t...
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
Vector< double > Xi_hi
Upper limits for the coordinates along the wall.
unsigned long nelement() const
Return number of elements in the mesh.
unsigned self_test()
Self test: check consistentency of multiple node updates.
Vector< double > Xi_lo
Lower limits for the coordinates along the wall.
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the outer two macro elements towards the wall by mapping ...
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...
void node_update(const bool &update_all_solid_nodes=false)
Resolve mesh update: Update current nodal positions via sparse MacroElement-based update...
QuarterTubeDomain::AxialSpacingFctPt & axial_spacing_fct_pt()
Broken version of the QuarterTubeDomain function Function is broken because axial spacing isn't imple...
double Fract_mid
Fraction along wall where outer ring is to be divided.
void setup_macro_element_node_update()
Setup all the information that's required for MacroElement-based node update: Tell the elements that ...
3D quarter tube mesh class. The domain is specified by the GeomObject that identifies boundary 3...
virtual ~QuarterTubeMesh()
Destructor: empty.
Domain *& macro_domain_pt()
Broken assignment operator.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the outer two macro elements towards the wall...
GeomObject * Wall_pt
Pointer to the geometric object that represents the curved wall.
Quarter tube as domain. Domain is bounded by curved boundary which is represented by a GeomObject...
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
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.
AlgebraicMesh version of RefineableQuarterTubeMesh.
Base class for elements that allow MacroElement-based node update.
MacroElementNodeUpdate version of RefineableQuarterTubeMesh.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
double Lambda_x
Fractional width of central region.
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 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)...
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
QuarterTubeDomain * 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...
QuarterTubeDomain * domain_pt()
Access function to domain.
double Lambda_y
Fractional height of central region.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual ~MacroElementNodeUpdateRefineableQuarterTubeMesh()
Destructor: empty.
double Centre_box_size
Size of centre box.
QuarterTubeDomain * domain_pt() const
Access function to underlying domain.