30 #ifndef COMB_TIP_MESH_HEADER
31 #define COMB_TIP_MESH_HEADER
42 using namespace oomph;
60 template <
class ELEMENT,
class INTERFACE_ELEMENT>
77 {
return Interface_element_pt[
i];}
85 {
return Bulk_element_pt[
i];}
89 unsigned long nbulk()
const {
return Bulk_element_pt.size();}
97 Bulk_element_pt.clear();
98 Interface_element_pt.clear();
127 double H = spine_node_pt->
h();
136 double norm =
sqrt( (Xax - origin_pt[0] ) * (Xax - origin_pt[0] )+ (Yax - origin_pt[1] ) * (Yax - origin_pt[1] ) +
137 (Zax - origin_pt[2] ) * (Zax - origin_pt[2]) );
140 spine_node_pt->
x(0) = origin_pt[0] +
H*
W* (Xax - origin_pt[0] )/norm;
143 spine_node_pt->
x(1) = origin_pt[1] +
H*
W* (Yax - origin_pt[1] )/norm;
146 spine_node_pt->
x(2) = origin_pt[2] +
H*
W* (Zax - origin_pt[2] )/norm;
179 unsigned long nnode = rot_mesh_pt->
nnode();
180 for(
unsigned long i = 0;
i<nnode;
i++)
183 double x_node = node_pt->
x(0);
184 double z_node = node_pt->
x(2);
185 node_pt->
x(0) = 1.0 - z_node;
186 node_pt->
x(2) = 1.0 + x_node;
191 unsigned long nspines = rot_mesh_pt->
nspine();
192 for(
unsigned long i = 0;
i<nspines;
i++)
209 unsigned long nnode = rot_mesh_pt->
nnode();
210 for(
unsigned long i = 0;
i<nnode;
i++)
213 double y_node = node_pt->
x(1);
214 double z_node = node_pt->
x(2);
215 node_pt->
x(1) = -1.0 + z_node;
216 node_pt->
x(2) = 1.0 - y_node;
221 unsigned long nspines = rot_mesh_pt->
nspine();
222 for(
unsigned long i = 0;
i<nspines;
i++)
239 virtual void build_single_layer_mesh(
TimeStepper* time_stepper_pt);
244 void change_boundaries(
Mesh *pt_mesh,
unsigned int oldbound,
unsigned int newbound,
unsigned int total_boundaries);
256 template<
class ELEMENT,
class INTERFACE_ELEMENT>
258 const unsigned &flag,
TimeStepper* time_stepper_pt):
283 template<
class ELEMENT,
class INTERFACE_ELEMENT>
299 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh1_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,0,time_stepper_pt);
309 for(
unsigned i = 0;
i< mesh1_pt->
nnode();
i++)
314 this->add_node_pt(mesh1_pt->
node_pt(
i));
318 for(
unsigned i = 0;
i< mesh1_pt->
nbulk();
i++)
337 for(
unsigned i = 0;
i< mesh1_pt->
nspine();
i++)
339 Spine_pt.push_back(mesh1_pt->
spine_pt(
i));
352 this->add_boundary_node(
b , node_pt);
359 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh2_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,1,time_stepper_pt);
364 int addmesh_map_boundary[6];
366 for(
unsigned int i =0;
i<6;
i++)
368 addmesh_map_boundary[
i] =
i;
371 addmesh_map_boundary[2] = 6;
372 addmesh_map_boundary[0] = 2;
373 addmesh_map_boundary[4] = -1;
375 add_side_spinemesh(2, mesh2_pt ,addmesh_map_boundary, 7,
Flag);
381 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh3_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,2,time_stepper_pt);
385 change_boundaries( mesh3_pt,2,3,6);
393 for(
unsigned int i =0;
i<6;
i++)
395 addmesh_map_boundary[
i] =
i;
397 addmesh_map_boundary[1] = 7;
398 addmesh_map_boundary[0] = 1;
399 addmesh_map_boundary[3] = -1;
401 add_side_spinemesh(1, mesh3_pt ,addmesh_map_boundary, 8,
Flag);
407 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh4_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,0,time_stepper_pt);
411 rotate_90_zeq1_xeq0(mesh4_pt);
416 for(
unsigned int i =0;
i<6;
i++)
418 addmesh_map_boundary[
i] =
i;
420 addmesh_map_boundary[0] = 2;
421 addmesh_map_boundary[1] =7 ;
422 addmesh_map_boundary[2] = 6;
423 addmesh_map_boundary[4] = -1;
426 add_side_spinemesh(6, mesh4_pt ,addmesh_map_boundary, 8,
Flag);
433 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh5_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,0,time_stepper_pt);
436 rotate_90_zeq1_yeq0(mesh5_pt);
440 change_boundaries( mesh5_pt,2,3,6);
444 for(
unsigned int i =0;
i<6;
i++)
446 addmesh_map_boundary[
i] =
i;
448 addmesh_map_boundary[0] = 1;
449 addmesh_map_boundary[1] = 6;
450 addmesh_map_boundary[3] = -1;
453 add_side_spinemesh(7, mesh5_pt ,addmesh_map_boundary, 8,
Flag);
463 MyTipMesh<ELEMENT,INTERFACE_ELEMENT >* mesh6_pt =
new MyTipMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,-1.0,0.0,0.0,1.0,
Radius,1,time_stepper_pt);
465 rotate_90_zeq1_xeq0(mesh6_pt);
469 change_boundaries( mesh6_pt,4,1,6);
471 for(
unsigned int i =0;
i<6;
i++)
473 addmesh_map_boundary[
i] =
i;
475 addmesh_map_boundary[0] = 6;
476 addmesh_map_boundary[1] = -1;
477 addmesh_map_boundary[2] = 4;
480 add_side_spinemesh(6, mesh6_pt ,addmesh_map_boundary, 7,
Flag);
482 std::cout<<
"The tip mesh consists of "
483 <<nbulk()<<
" bulk elements and "<<ninterface_element()
484 <<
" interface elements."<<std::endl;
510 ncount = this->nnode();
511 for(
int i = 0;
i< ncount;
i++)
513 Node* node_pt = this->node_pt(
i);
514 node_pt->
x(0) = node_pt->
x(0) *
Alpha/2;
515 node_pt->
x(1) = node_pt->
x(1) *
Length;
516 node_pt->
x(2) = node_pt->
x(2) *
Height/2;
519 unsigned long nspines = this->nspine();
520 for(
unsigned long i = 0;
i<nspines;
i++)
522 Spine* spine_pt = this->spine_pt(
i);
536 ncount = this->nboundary_node(5);
538 for(
int i = 0;
i< ncount;
i++)
546 double dorg =
sqrt( (spine_node_pt->
x(0) - x_spine )*(spine_node_pt->
x(0) - x_spine )+
547 (spine_node_pt->
x(1) - y_spine)*(spine_node_pt->
x(1) - y_spine)+
548 (spine_node_pt->
x(2) - z_spine)*(spine_node_pt->
x(2) - z_spine) );
549 spine_node_pt->
h() = dorg;
580 total_boundaries,spine_flag);
583 for(
unsigned i = 0;
i< addmesh_pt->
nbulk();
i++)
612 unsigned int oldbound,
unsigned int newbound,
unsigned int total_boundaries)
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
Scalar * b
Definition: benchVecAdd.cpp:17
Definition: comb_tip_spine_mesh.h:62
double Xax
Axis of Symmetry.
Definition: comb_tip_spine_mesh.h:164
unsigned Flag
Definition: comb_tip_spine_mesh.h:161
unsigned long ninterface_element() const
Number of elements on interface.
Definition: comb_tip_spine_mesh.h:81
void add_side_spinemesh(unsigned int bound1, MyTipMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned flag)
Definition: comb_tip_spine_mesh.h:573
virtual void spine_node_update(SpineNode *spine_node_pt)
Definition: comb_tip_spine_mesh.h:122
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: comb_tip_spine_mesh.h:284
void change_boundaries(Mesh *pt_mesh, unsigned int oldbound, unsigned int newbound, unsigned int total_boundaries)
Definition: comb_tip_spine_mesh.h:611
void rotate_90_zeq1_xeq0(SpineMesh *rot_mesh_pt)
Definition: comb_tip_spine_mesh.h:177
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
Definition: comb_tip_spine_mesh.h:173
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
Definition: comb_tip_spine_mesh.h:76
unsigned long nbulk() const
Number of elements in bulk.
Definition: comb_tip_spine_mesh.h:89
unsigned int Nel
Definition: comb_tip_spine_mesh.h:154
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
Definition: comb_tip_spine_mesh.h:170
void rotate_90_zeq1_yeq0(SpineMesh *rot_mesh_pt)
Definition: comb_tip_spine_mesh.h:207
void flush_spine_element_and_node_storage()
Definition: comb_tip_spine_mesh.h:93
double Length
Definition: comb_tip_spine_mesh.h:158
double Yax
Definition: comb_tip_spine_mesh.h:165
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: comb_tip_spine_mesh.h:84
double Alpha
Aspect ratio, lengt, heighth and radius.
Definition: comb_tip_spine_mesh.h:157
double Radius
Definition: comb_tip_spine_mesh.h:160
double Zax
Definition: comb_tip_spine_mesh.h:166
CombTipSpineMesh(const unsigned int &nel, const double &alpha, const double &length, const double &height, const double &radius, const unsigned &flag, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: comb_tip_spine_mesh.h:257
double Height
Definition: comb_tip_spine_mesh.h:159
coincides with the numeration of the spines
Definition: tip_spine_mesh.h:52
unsigned long nbulk() const
Number of elements in bulk.
Definition: tip_spine_mesh.h:86
unsigned long ninterface_element() const
Number of elements on interface.
Definition: tip_spine_mesh.h:79
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
Definition: tip_spine_mesh.h:75
void flush_spine_element_and_node_storage()
Definition: tip_spine_mesh.h:174
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: tip_spine_mesh.h:82
Definition: elements.h:1313
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
Definition: mesh.cc:243
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
static Steady< 0 > Default_TimeStepper
The Steady Timestepper.
Definition: mesh.h:75
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Definition: mesh.h:505
unsigned nboundary() const
Return number of boundaries.
Definition: mesh.h:827
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
Definition: mesh.cc:204
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
virtual bool is_on_boundary() const
Definition: nodes.h:1373
virtual void remove_from_boundary(const unsigned &b)
Definition: nodes.cc:2350
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
Definition: spines.h:648
unsigned long nspine() const
Return the number of spines in the mesh.
Definition: spines.h:635
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
Definition: spines.h:623
void node_update(const bool &update_all_solid_nodes=false)
Definition: spines.cc:84
double & h()
Access function to spine height.
Definition: spines.h:397
SpineMesh *& spine_mesh_pt()
Definition: spines.h:391
Spine *& spine_pt()
Access function to spine.
Definition: spines.h:372
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
Definition: spines.h:384
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:378
double & geom_parameter(const unsigned &i)
Definition: spines.h:287
Definition: timesteppers.h:231
RealScalar alpha
Definition: level1_cplx_impl.h:151
double Height
Height of domain.
Definition: flow_past_oscillating_cylinder.cc:316
double Radius
Radius of the pipe.
Definition: pipe.cc:55
double Length
Length of the pipe.
Definition: pipe.cc:52
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53
void merge_spine_meshes(MESH1 *mesh_pt, unsigned bound1, MESH2 *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned spine_flag)
Definition: merge_meshes.h:32
unsigned Flag
Flag for solution.
Definition: navier_stokes_preconditioners.cc:42
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10