30 #ifndef MY_TIP_SPINE_MESH_HEADER
31 #define MY_TIP_SPINE_MESH_HEADER
39 using namespace oomph;
49 template <
class ELEMENT,
class INTERFACE_ELEMENT>
69 const unsigned &rotation_flag,
76 {
return Interface_element_pt[
i];}
83 {
return Bulk_element_pt[
i];}
86 unsigned long nbulk()
const {
return Bulk_element_pt.size();}
94 double scaled_R =
R/(this->
Zmax - this->
Zmin);
95 if ( (scaled_R<0.95) && (scaled_R>0.05) )
99 std::ostringstream error_stream;
102 "We can not constract so small elements so close to the origin\n"
103 <<
"Choose a different radius (actual scaled radius = "<<scaled_R<<
"\n";
121 double H = spine_node_pt->
h();
130 double norm =
sqrt( (Xax - origin_pt[0] ) * (Xax - origin_pt[0] )+ (Yax - origin_pt[1] ) * (Yax - origin_pt[1] ) +
131 (Zax - origin_pt[2] ) * (Zax - origin_pt[2]) );
134 spine_node_pt->
x(0) = origin_pt[0] +
H*
W* (Xax - origin_pt[0] )/norm;
137 spine_node_pt->
x(1) = origin_pt[1] +
H*
W* (Yax - origin_pt[1] )/norm;
140 spine_node_pt->
x(2) = origin_pt[2] +
H*
W* (Zax - origin_pt[2] )/norm;
153 double daxis =
sqrt( (this->Xax - spine_node_pt->
x(0) ) *(this->Xax - spine_node_pt->
x(0) )+(this->Yax - spine_node_pt->
x(1) ) * (this->Yax - spine_node_pt->
x(1))
154 + (this->Zax - spine_node_pt->
x(2) ) * (this->Zax - spine_node_pt->
x(2)) );
155 double init_h = ( daxis -
radius() ) ;
177 Interface_element_pt.clear();
199 virtual void build_single_layer_mesh(
TimeStepper* time_stepper_pt);
234 template<
class ELEMENT,
class INTERFACE_ELEMENT>
236 const unsigned &
nx,
const unsigned &
ny,
const unsigned &
nz,
237 const double &x_min,
const double &x_max,
const double &y_min,
238 const double &y_max,
const double &z_min,
const double &z_max,
const double &
R,
const unsigned &rotation_flag,
TimeStepper* time_stepper_pt) :
266 template<
class ELEMENT,
class INTERFACE_ELEMENT>
272 if(Rotation_flag == 1)
273 for(
unsigned i = 0;
i< this->nnode();
i++)
275 double x_node = this->node_pt(
i)->x(0);
276 double z_node = this->node_pt(
i)->x(2);
277 this->node_pt(
i)->x(0) = -z_node +1.0;
278 this->node_pt(
i)->x(2) = x_node;
281 if(Rotation_flag == 2)
282 for(
unsigned i = 0;
i< this->nnode();
i++)
284 double y_node = this->node_pt(
i)->x(1);
285 double z_node = this->node_pt(
i)->x(2);
286 this->node_pt(
i)->x(1) = z_node - 1.0;
287 this->node_pt(
i)->x(2) = -y_node;
291 unsigned n_x = this->
Nx;
292 unsigned n_y = this->
Ny;
293 unsigned n_z = this->
Nz;
298 unsigned nbulk=nelement();
299 Bulk_element_pt.reserve(nbulk);
300 for(
unsigned e=0;
e<nbulk;
e++)
302 Bulk_element_pt.push_back(this->finite_element_pt(
e));
309 unsigned n_p =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
312 Spine_pt.reserve(((n_p-1)*n_x+1)*((n_p-1)*n_y+1));
321 for(
unsigned l1=0;l1<n_p;l1++)
323 for(
unsigned l2=0;l2<n_p;l2++)
329 origin_node[0] = element_node_pt(0,l2+l1*n_p)->x(0);
330 origin_node[1] = element_node_pt(0,l2+l1*n_p)->x(1);
331 origin_node[2] = element_node_pt(0,l2+l1*n_p)->x(2);
333 double hinit = init_spine_height( element_node_pt(0,l2+l1*n_p) );
338 Spine_pt.push_back(new_spine_pt);
341 SpineNode* nod_pt=element_node_pt(0,l2+l1*n_p);
351 for(
unsigned long k=0;
k<n_z;
k++)
357 for(
unsigned l3=1;l3<n_p;l3++)
360 SpineNode* nod_pt=element_node_pt(
k*n_x*n_y,l3*n_p*n_p+l2+l1*n_p);
381 for(
unsigned j=1;
j<n_x;
j++)
384 for(
unsigned l1=0;l1<n_p;l1++)
398 for(
unsigned l2=1;l2<n_p;l2++)
403 origin_node[0] = element_node_pt(
j,l2+l1*n_p)->x(0);
404 origin_node[1] = element_node_pt(
j,l2+l1*n_p)->x(1);
405 origin_node[2] = element_node_pt(
j,l2+l1*n_p)->x(2);
407 double hinit = init_spine_height( element_node_pt(
j,l2+l1*n_p) );
412 Spine_pt.push_back(new_spine_pt);
416 SpineNode* nod_pt=element_node_pt(
j,l2+l1*n_p);
426 for(
unsigned long k=0;
k<n_z;
k++)
431 for(
unsigned l3=1;l3<n_p;l3++)
434 SpineNode* nod_pt=element_node_pt(
j+
k*n_x*n_y,l3*n_p*n_p+l2+l1*n_p);
454 for(
unsigned long i=1;
i<n_y;
i++)
475 for(
unsigned l1=1;l1<n_p;l1++)
478 for(
unsigned l2=0;l2<n_p;l2++)
483 origin_node[0] = element_node_pt(
i*n_x,l2+l1*n_p)->x(0);
484 origin_node[1] = element_node_pt(
i*n_x,l2+l1*n_p)->x(1);
485 origin_node[2] = element_node_pt(
i*n_x,l2+l1*n_p)->x(2);
487 double hinit = init_spine_height( element_node_pt(
i*n_x,l2+l1*n_p) );
493 Spine_pt.push_back(new_spine_pt);
497 SpineNode* nod_pt=element_node_pt(
i*n_x,l2+l1*n_p);
507 for(
unsigned long k=0;
k<n_z;
k++)
512 for(
unsigned l3=1;l3<n_p;l3++)
515 SpineNode* nod_pt=element_node_pt(
i*n_x+
k*n_x*n_y,l3*n_p*n_p+l2+l1*n_p);
534 for(
unsigned j=1;
j<n_x;
j++)
554 for(
unsigned l1=1;l1<n_p;l1++)
566 for(
unsigned l2=1;l2<n_p;l2++)
571 origin_node[0] = element_node_pt(
j+
i*n_x,l2+l1*n_p)->x(0);
572 origin_node[1] = element_node_pt(
j+
i*n_x,l2+l1*n_p)->x(1);
573 origin_node[2] = element_node_pt(
j+
i*n_x,l2+l1*n_p)->x(2);
574 double hinit = init_spine_height( element_node_pt(
j+
i*n_x,l2+l1*n_p) );
581 Spine_pt.push_back(new_spine_pt);
585 SpineNode* nod_pt=element_node_pt(
j+
i*n_x,l2+l1*n_p);
595 for(
unsigned long k=0;
k<n_z;
k++)
600 for(
unsigned l3=1;l3<n_p;l3++)
603 SpineNode* nod_pt=element_node_pt(
j+
i*n_x+
k*n_x*n_y,l3*n_p*n_p+l2+l1*n_p);
631 unsigned long element_count = Element_pt.size();
634 for(
unsigned l1=0;l1<n_y;l1++)
635 for(
unsigned l2=0;l2<n_x;l2++)
641 new INTERFACE_ELEMENT(finite_element_pt(n_x*n_y*(n_z-1)+l2+l1*n_x),3);
645 Element_pt.push_back(interface_element_element_pt);
648 Interface_element_pt.push_back(interface_element_element_pt);
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
@ R
Definition: StatisticsVector.h:21
coincides with the numeration of the spines
Definition: tip_spine_mesh.h:52
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: tip_spine_mesh.h:267
MyTipMesh(const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &x_min, const double &x_max, const double &y_min, const double &y_max, const double &z_min, const double &z_max, const double &R, const unsigned &rotation_flag, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Definition: tip_spine_mesh.h:235
double init_spine_height(SpineNode *spine_node_pt)
Definition: tip_spine_mesh.h:149
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
Definition: tip_spine_mesh.h:192
virtual void spine_node_update(SpineNode *spine_node_pt)
Definition: tip_spine_mesh.h:116
double Yax
Definition: tip_spine_mesh.h:205
void change_radius(double R)
Definition: tip_spine_mesh.h:92
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
double Zax
Definition: tip_spine_mesh.h:207
double Radius
Sacled radius of the canyon (must be between 0 and one.
Definition: tip_spine_mesh.h:195
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
Definition: tip_spine_mesh.h:75
double Xax
Definition: tip_spine_mesh.h:203
unsigned Rotation_flag
Definition: tip_spine_mesh.h:211
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
Definition: tip_spine_mesh.h:189
double radius()
Definition: tip_spine_mesh.h:89
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
static Steady< 0 > Default_TimeStepper
The Steady Timestepper.
Definition: mesh.h:75
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
Definition: oomph_definitions.h:222
Simple cubic 3D Brick mesh class.
Definition: simple_cubic_mesh.template.h:47
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
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:378
void set_geom_parameter(const Vector< double > &geom_parameter)
Definition: spines.h:273
double & geom_parameter(const unsigned &i)
Definition: spines.h:287
Definition: timesteppers.h:231
char char char int int * k
Definition: level2_impl.h:374
unsigned Nx
Number of elements in each direction (used by SimpleCubicMesh)
Definition: structured_cubic_point_source.cc:114
unsigned Ny
Definition: structured_cubic_point_source.cc:115
double Zmin
Set up min z coordinate.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:74
unsigned Nz
Number of elements in z-direction.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:62
double Zmax
Set up max z coordinate.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:80
double Radius
Radius of the pipe.
Definition: pipe.cc:55
const unsigned nz
Definition: ConstraintElementsUnitTest.cpp:32
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2