26#ifndef OOMPH_FISH_MESH_HEADER
27#define OOMPH_FISH_MESH_HEADER
52 template<
class ELEMENT>
123 template<
class ELEMENT>
132 :
FishMesh<ELEMENT>(time_stepper_pt)
179 class MacroElementNodeUpdateNode;
191 template<
class ELEMENT>
207 ELEMENT*
el_pt =
new ELEMENT;
210 std::ostringstream error_message;
211 error_message <<
"Base class for ELEMENT in "
212 <<
"MacroElementNodeUpdateRefineableFishMesh needs"
213 <<
"to be of type MacroElementNodeUpdateElement!\n";
214 error_message <<
"Whereas it is: typeid(el_pt).name()"
218 "MacroElementNodeUpdateRefineableFishMesh::\n";
219 function_name +=
"MacroElementNodeUpdateRefineableFishMesh()";
232 for (
unsigned i = 0;
i < n_element;
i++)
243 std::ostringstream error_message;
245 <<
"Failed to upcast to MacroElementNodeUpdateElementBase\n";
246 error_message <<
"Element must be derived from "
247 "MacroElementNodeUpdateElementBase\n";
248 error_message <<
"but it is of type " <<
typeid(
el_pt).
name();
251 "MacroElementNodeUpdateRefineableFishMesh::\n";
252 function_name +=
"MacroElementNodeUpdateRefinableFishMesh()";
261 geom_object_pt[0] = this->
Back_pt;
265 el_pt->set_node_update_info(geom_object_pt);
270 geom_object_pt[0] = this->
Back_pt;
290 std::string error_message =
291 "Doesn't make sense to use an MacroElementNodeUpdateMesh with\n";
293 "SolidElements so specifying update_all_solid_nodes=true\n";
294 error_message +=
"doesn't make sense either\n";
297 "MacroElementNodeUpdateRefineableFishMesh::";
318 template<
class ELEMENT>
326 :
FishMesh<ELEMENT>(time_stepper_pt)
369 std::ostringstream error_message;
370 error_message <<
"The node update fct id is " <<
id
371 <<
", but it should only be one of " << this->
Lower_body
373 <<
" or " << this->
Upper_fin << std::endl;
375 "AlgebraicFishMesh::algebraic_node_update()";
393 std::string error_message =
394 "Doesn't make sense to use an AlgebraicMesh with\n";
396 "SolidElements so specifying update_all_solid_nodes=true\n";
397 error_message +=
"doesn't make sense either\n";
399 std::string
function_name =
"AlgebraicFishMesh::node_update()";
432 zeta[0] = 0.5 * (xi_nose + xi_tail);
440 std::ostringstream error_message;
441 error_message <<
"AlgebraicFishMesh only works with GeomObjects\n"
442 <<
"that do not contain sub-elements (e.g. GeomObjects\n"
443 <<
"that represent a wall finite element mesh!\n"
444 <<
"Back_pt : " << this->
Back_pt << std::endl
446 <<
"s[0] : " <<
s[0] << std::endl
447 <<
"zeta[0] : " <<
zeta[0] << std::endl;
479 template<
class ELEMENT>
492 :
FishMesh<ELEMENT>(time_stepper_pt),
Fish shaped mesh with algebraic node update function for nodes.
virtual ~AlgebraicFishMesh()
Destructor: empty.
void setup_algebraic_node_update()
Setup algebraic update operation for all nodes (separate function because this task needs to be perfo...
virtual void node_update(const bool &update_all_solid_nodes=false)
Resolve the node update function (we neither want the broken empty one in the Mesh base class nor the...
AlgebraicFishMesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to timestepper. (defaults to (Steady) default timestepper defined in Mesh)
void node_update_in_body(const unsigned &t, AlgebraicNode *&node_pt)
Algebraic update function for nodes in upper/lower body.
void update_node_update(AlgebraicNode *&node_pt)
Update the geometric references that are used to update node after mesh adaptation....
AlgebraicFishMesh(GeomObject *back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer GeomObject that defines the fish's back and pointer to timestepper (default...
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
void node_update_in_fin(const unsigned &t, AlgebraicNode *&node_pt)
Algebraic update function for nodes in upper/lower fin.
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
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 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.
Algebraic nodes are nodes with an algebraic positional update function.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
Refineable fish shaped mesh with algebraic node update function.
AlgebraicRefineableFishMesh(GeomObject *back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer GeomObject that defines the fish's back and pointer to timestepper....
virtual ~AlgebraicRefineableFishMesh()
Destructor: empty.
void node_update(const bool &update_all_solid_nodes=false)
Resolve node update function: Use the one defined in the AlgebraicFishMesh (where the bool flag is ex...
AlgebraicRefineableFishMesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to timestepper. (defaults to (Steady) default timestepper defined in Mesh)
Fish shaped domain, represented by four MacroElements. Shape is parametrised by GeomObject that repre...
double & xi_nose()
Start coordinate on wall (near nose)
double & xi_tail()
End coordinate on wall (near tail)
Fish shaped mesh. The geometry is defined by the Domain object FishDomain.
GeomObject * Back_pt
Pointer to fish back.
virtual ~FishMesh()
Destructor: Kill the geom object that represents the fish's back (if necessary)
FishDomain *& domain_pt()
Access function to FishDomain.
void build_mesh(TimeStepper *time_stepper_pt)
Build the mesh, using the geometric object identified by Back_pt.
GeomObject *& fish_back_pt()
Access function to geom object that represents the fish's back.
bool Must_kill_fish_back
Do I need to kill the fish back geom object?
FishDomain * Domain_pt
Pointer to domain.
A geometric object is an object that provides a parametrised description of its shape via the functio...
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
A geometric object may be composed of may sub-objects (e.g. a finite-element representation of a boun...
Base class for elements that allow MacroElement-based node update.
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...
Domain *& macro_domain_pt()
Broken assignment operator.
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...
Refineable fish shaped mesh with MacroElement-based node update. The fish's back is represented by a ...
void node_update(const bool &update_all_solid_nodes=false)
Resolve mesh update: NodeUpdate current nodal positions via sparse MacroElement-based update....
virtual ~MacroElementNodeUpdateRefineableFishMesh()
Destructor: empty.
MacroElementNodeUpdateRefineableFishMesh(GeomObject *back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer GeomObject that defines the fish's back and pointer to timestepper (default...
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....
Base class for quad meshes (meshes made of 2D quad elements).
Refineable fish shaped mesh. The geometry is defined by the Domain object FishDomain.
void setup_adaptivity()
Setup all the information that's required for spatial adaptivity: Set pointers to macro elements and ...
RefineableFishMesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to timestepper – defaults to (Steady) default timestepper defined in the Me...
RefineableFishMesh(GeomObject *back_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer GeomObject that defines the fish's back and pointer to timestepper (default...
virtual ~RefineableFishMesh()
Destructor: Empty – all cleanup gets handled in the base classes.
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).