26 #ifndef OOMPH_MY_ALGEBRAIC_COLLAPSIBLE_CHANNEL_MESH
27 #define OOMPH_MY_ALGEBRAIC_COLLAPSIBLE_CHANNEL_MESH
30 #include "meshes/collapsible_channel_mesh.h"
47 template<
class ELEMENT>
50 public virtual CollapsibleChannelMesh<ELEMENT>
61 const unsigned& ncollapsible,
62 const unsigned& ndown,
65 const double& lcollapsible,
69 TimeStepper* time_stepper_pt=
70 &Mesh::Default_TimeStepper) :
71 CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
72 lup, lcollapsible, ldown, ly,
90 const unsigned& ncollapsible,
91 const unsigned& ndown,
94 const double& lcollapsible,
98 CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt,
99 TimeStepper* time_stepper_pt=
100 &Mesh::Default_TimeStepper) :
101 CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
102 lup, lcollapsible, ldown, ly,
107 this->Domain_pt->bl_squash_fct_pt()=bl_squash_function_pt;
110 CollapsibleChannelMesh<ELEMENT>::node_update();
128 std::ostringstream error_message;
130 <<
"It does not make sense to set the bl_squash_fct_pt \n"
131 <<
"outside the constructor as it's only used to set up the \n"
132 <<
"algebraic remesh data when the algebraic mesh is first built. \n";
133 std::string function_name =
134 "MyAlgebraicCollapsibleChannelMesh::bl_squash_fct_pt()\n";
136 throw OomphLibError(error_message.str(),
137 OOMPH_CURRENT_FUNCTION,
138 OOMPH_EXCEPTION_LOCATION);
179 template<
class ELEMENT>
181 public RefineableQuadMesh<ELEMENT>,
195 const unsigned& ncollapsible,
196 const unsigned& ndown,
199 const double& lcollapsible,
203 TimeStepper* time_stepper_pt=
204 &Mesh::Default_TimeStepper) :
205 CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
206 lup, lcollapsible, ldown, ly,
210 lup, lcollapsible, ldown, ly,
215 this->setup_quadtree_forest();
229 const unsigned& ncollapsible,
230 const unsigned& ndown,
233 const double& lcollapsible,
237 CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt,
238 TimeStepper* time_stepper_pt=
239 &Mesh::Default_TimeStepper) :
240 CollapsibleChannelMesh<ELEMENT>(nup, ncollapsible, ndown, ny,
241 lup, lcollapsible, ldown, ly,
245 lup, lcollapsible, ldown, ly,
247 bl_squash_function_pt,
251 this->setup_quadtree_forest();
267 template<
class ELEMENT>
272 double l_up=this->domain_pt()->l_up();
273 double l_collapsible=this->domain_pt()->l_collapsible();
276 unsigned nnod=this->nnode();
277 for (
unsigned j=0;j<nnod;j++)
280 AlgebraicNode* nod_pt=node_pt(j);
283 double x=nod_pt->x(0);
284 double y=nod_pt->x(1);
287 if ( (x>=l_up) && (x<=(l_up+l_collapsible)) )
291 Vector<double> zeta(1);
295 Vector<double> r_wall(2);
296 this->Wall_pt->position(zeta,r_wall);
301 if ((std::abs(r_wall[0]-x)>1.0e-15)&&(std::abs(r_wall[1]-y)>1.0e-15))
303 std::ostringstream error_stream;
305 <<
"Wall must be in its undeformed position when\n"
306 <<
"algebraic node update information is set up!\n "
307 <<
"x-discrepancy: " << std::abs(r_wall[0]-x) << std::endl
308 <<
"y-discrepancy: " << std::abs(r_wall[1]-y) << std::endl;
312 OOMPH_CURRENT_FUNCTION,
313 OOMPH_EXCEPTION_LOCATION);
318 Vector<GeomObject*> geom_object_pt(1);
321 geom_object_pt[0]=this->Wall_pt;
324 Vector<double> ref_value(3);
327 ref_value[0]=r_wall[0];
332 ref_value[1]=y/r_wall[1];
335 ref_value[2]=zeta[0];
339 nod_pt->add_node_update_info(
354 template<
class ELEMENT>
356 const unsigned& t, AlgebraicNode*& node_pt)
360 Vector<double> ref_value(node_pt->vector_ref_value());
363 Vector<GeomObject*> geom_object_pt(node_pt->vector_geom_object_pt());
366 double x_bottom=ref_value[0];
371 double fract=ref_value[1];
374 Vector<double> zeta(1);
375 zeta[0]=ref_value[2];
378 GeomObject* wall_pt=geom_object_pt[0];
381 Vector<double> r_wall(2);
382 wall_pt->position(t,zeta,r_wall);
385 node_pt->x(t,0)=x_bottom+fract*(r_wall[0]-x_bottom);
386 node_pt->x(t,1)= fract* r_wall[1];
Collapsible channel mesh with algebraic node update.
MyAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
MyAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
virtual ~MyAlgebraicCollapsibleChannelMesh()
Destructor: empty.
CollapsibleChannelDomain::BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the mesh near the walls. Default trivial mapping (the ide...
void setup_algebraic_node_update()
Function to setup the algebraic node update.
CollapsibleChannelDomain::BLSquashFctPt Dummy_fct_pt
Dummy function pointer.
void update_node_update(AlgebraicNode *&node_pt)
Update the geometric references that are used to update node after mesh adaptation....
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
MyRefineableAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, CollapsibleChannelDomain::BLSquashFctPt bl_squash_function_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
MyRefineableAlgebraicCollapsibleChannelMesh(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in upstream/collapsible/ downstream segment and across the chann...
///////////////////////////////////////////////////////////////// ///////////////////////////////////...