CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT > Class Template Reference

#include <comb_tip_spine_mesh.h>

+ Inheritance diagram for CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >:

Public Member Functions

 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)
 
FiniteElement *& interface_element_pt (const unsigned long &i)
 Access functions for pointers to interface elements. More...
 
unsigned long ninterface_element () const
 Number of elements on interface. More...
 
FiniteElement *& bulk_element_pt (const unsigned long &i)
 Access functions for pointers to elements in bulk. More...
 
unsigned long nbulk () const
 Number of elements in bulk. More...
 
void flush_spine_element_and_node_storage ()
 
virtual void spine_node_update (SpineNode *spine_node_pt)
 
- Public Member Functions inherited from oomph::SpineMesh
virtual ~SpineMesh ()
 Destructor to clean up the memory allocated to the spines. More...
 
Spine *& spine_pt (const unsigned long &i)
 Return the i-th spine in the mesh. More...
 
const Spinespine_pt (const unsigned long &i) const
 Return the i-th spine in the mesh (const version) More...
 
unsigned long nspine () const
 Return the number of spines in the mesh. More...
 
void add_spine_pt (Spine *const &spine_pt)
 Add a spine to the mesh. More...
 
SpineNodenode_pt (const unsigned long &n)
 Return a pointer to the n-th global SpineNode. More...
 
SpineNodeelement_node_pt (const unsigned long &e, const unsigned &n)
 
unsigned long assign_global_spine_eqn_numbers (Vector< double * > &Dof_pt)
 Assign spines to Spine_pt vector of element. More...
 
void describe_spine_dofs (std::ostream &out, const std::string &current_string) const
 
void set_mesh_level_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void set_spine_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 Assign time stepper to spines data. More...
 
void set_consistent_pinned_spine_values_for_continuation (ContinuationStorageScheme *const &continuation_stepper_pt)
 
bool does_pointer_correspond_to_spine_data (double *const &parameter_pt)
 
void node_update (const bool &update_all_solid_nodes=false)
 
void dump (std::ofstream &dump_file) const
 Overload the dump function so that the spine data is dumped. More...
 
void read (std::ifstream &restart_file)
 Overload the read function so that the spine data is also read. More...
 
- Public Member Functions inherited from oomph::Mesh
 Mesh ()
 Default constructor. More...
 
 Mesh (const Vector< Mesh * > &sub_mesh_pt)
 
void merge_meshes (const Vector< Mesh * > &sub_mesh_pt)
 
virtual void setup_boundary_element_info ()
 
virtual void setup_boundary_element_info (std::ostream &outfile)
 
virtual void reset_boundary_element_info (Vector< unsigned > &ntmp_boundary_elements, Vector< Vector< unsigned >> &ntmp_boundary_elements_in_region, Vector< FiniteElement * > &deleted_elements)
 Virtual function to perform the reset boundary elements info rutines. More...
 
template<class BULK_ELEMENT >
void doc_boundary_coordinates (const unsigned &b, std::ofstream &the_file)
 
virtual void scale_mesh (const double &factor)
 
 Mesh (const Mesh &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Mesh &)=delete
 Broken assignment operator. More...
 
virtual ~Mesh ()
 Virtual Destructor to clean up all memory. More...
 
void flush_element_and_node_storage ()
 
void flush_element_storage ()
 
void flush_node_storage ()
 
Node *& node_pt (const unsigned long &n)
 Return pointer to global node n. More...
 
Nodenode_pt (const unsigned long &n) const
 Return pointer to global node n (const version) More...
 
GeneralisedElement *& element_pt (const unsigned long &e)
 Return pointer to element e. More...
 
GeneralisedElementelement_pt (const unsigned long &e) const
 Return pointer to element e (const version) More...
 
const Vector< GeneralisedElement * > & element_pt () const
 Return reference to the Vector of elements. More...
 
Vector< GeneralisedElement * > & element_pt ()
 Return reference to the Vector of elements. More...
 
FiniteElementfinite_element_pt (const unsigned &e) const
 
Node *& boundary_node_pt (const unsigned &b, const unsigned &n)
 Return pointer to node n on boundary b. More...
 
Nodeboundary_node_pt (const unsigned &b, const unsigned &n) const
 Return pointer to node n on boundary b. More...
 
void set_nboundary (const unsigned &nbound)
 Set the number of boundaries in the mesh. More...
 
void remove_boundary_nodes ()
 Clear all pointers to boundary nodes. More...
 
void remove_boundary_nodes (const unsigned &b)
 
void remove_boundary_node (const unsigned &b, Node *const &node_pt)
 Remove a node from the boundary b. More...
 
void add_boundary_node (const unsigned &b, Node *const &node_pt)
 Add a (pointer to) a node to the b-th boundary. More...
 
void copy_boundary_node_data_from_nodes ()
 
bool boundary_coordinate_exists (const unsigned &i) const
 Indicate whether the i-th boundary has an intrinsic coordinate. More...
 
unsigned long nelement () const
 Return number of elements in the mesh. More...
 
unsigned long nnode () const
 Return number of nodes in the mesh. More...
 
unsigned ndof_types () const
 Return number of dof types in mesh. More...
 
unsigned elemental_dimension () const
 Return number of elemental dimension in mesh. More...
 
unsigned nodal_dimension () const
 Return number of nodal dimension in mesh. More...
 
void add_node_pt (Node *const &node_pt)
 Add a (pointer to a) node to the mesh. More...
 
void add_element_pt (GeneralisedElement *const &element_pt)
 Add a (pointer to) an element to the mesh. More...
 
virtual void reorder_nodes (const bool &use_old_ordering=true)
 
virtual void get_node_reordering (Vector< Node * > &reordering, const bool &use_old_ordering=true) const
 
template<class BULK_ELEMENT , template< class > class FACE_ELEMENT>
void build_face_mesh (const unsigned &b, Mesh *const &face_mesh_pt)
 
unsigned self_test ()
 Self-test: Check elements and nodes. Return 0 for OK. More...
 
void max_and_min_element_size (double &max_size, double &min_size)
 
double total_size ()
 
void check_inverted_elements (bool &mesh_has_inverted_elements, std::ofstream &inverted_element_file)
 
void check_inverted_elements (bool &mesh_has_inverted_elements)
 
unsigned check_for_repeated_nodes (const double &epsilon=1.0e-12)
 
Vector< Node * > prune_dead_nodes ()
 
unsigned nboundary () const
 Return number of boundaries. More...
 
unsigned long nboundary_node (const unsigned &ibound) const
 Return number of nodes on a particular boundary. More...
 
FiniteElementboundary_element_pt (const unsigned &b, const unsigned &e) const
 Return pointer to e-th finite element on boundary b. More...
 
Nodeget_some_non_boundary_node () const
 
unsigned nboundary_element (const unsigned &b) const
 Return number of finite elements that are adjacent to boundary b. More...
 
int face_index_at_boundary (const unsigned &b, const unsigned &e) const
 
virtual void dump (std::ofstream &dump_file, const bool &use_old_ordering=true) const
 Dump the data in the mesh into a file for restart. More...
 
void dump (const std::string &dump_file_name, const bool &use_old_ordering=true) const
 Dump the data in the mesh into a file for restart. More...
 
void output_paraview (std::ofstream &file_out, const unsigned &nplot) const
 
void output_fct_paraview (std::ofstream &file_out, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
 
void output_fct_paraview (std::ofstream &file_out, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
void output (std::ostream &outfile)
 Output for all elements. More...
 
void output (std::ostream &outfile, const unsigned &n_plot)
 Output at f(n_plot) points in each element. More...
 
void output (FILE *file_pt)
 Output for all elements (C-style output) More...
 
void output (FILE *file_pt, const unsigned &nplot)
 Output at f(n_plot) points in each element (C-style output) More...
 
void output (const std::string &output_filename)
 Output for all elements. More...
 
void output (const std::string &output_filename, const unsigned &n_plot)
 Output at f(n_plot) points in each element. More...
 
void output_fct (std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt)
 Output a given Vector function at f(n_plot) points in each element. More...
 
void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt)
 
void output_boundaries (std::ostream &outfile)
 Output the nodes on the boundaries (into separate tecplot zones) More...
 
void output_boundaries (const std::string &output_filename)
 
void assign_initial_values_impulsive ()
 Assign initial values for an impulsive start. More...
 
void shift_time_values ()
 
void calculate_predictions ()
 
void set_nodal_and_elemental_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void set_consistent_pinned_values_for_continuation (ContinuationStorageScheme *const &continuation_stepper_pt)
 Set consistent values for pinned data in continuation. More...
 
bool does_pointer_correspond_to_mesh_data (double *const &parameter_pt)
 Does the double pointer correspond to any mesh data. More...
 
void set_nodal_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 Set the timestepper associated with the nodal data in the mesh. More...
 
void set_elemental_internal_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
virtual void compute_norm (double &norm)
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 Returns the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
bool is_mesh_distributed () const
 Boolean to indicate if Mesh has been distributed. More...
 
OomphCommunicatorcommunicator_pt () const
 
void delete_all_external_storage ()
 Wipe the storage for all externally-based elements. More...
 

Protected Member Functions

void rotate_90_zeq1_xeq0 (SpineMesh *rot_mesh_pt)
 
void rotate_90_zeq1_yeq0 (SpineMesh *rot_mesh_pt)
 
virtual void build_single_layer_mesh (TimeStepper *time_stepper_pt)
 
void add_side_spinemesh (unsigned int bound1, MyTipMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned flag)
 
void change_boundaries (Mesh *pt_mesh, unsigned int oldbound, unsigned int newbound, unsigned int total_boundaries)
 
- Protected Member Functions inherited from oomph::Mesh
unsigned long assign_global_eqn_numbers (Vector< double * > &Dof_pt)
 Assign (global) equation numbers to the nodes. More...
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign local equation numbers in all elements. More...
 
void convert_to_boundary_node (Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
 
void convert_to_boundary_node (Node *&node_pt)
 

Protected Attributes

unsigned int Nel
 
double Alpha
 Aspect ratio, lengt, heighth and radius. More...
 
double Length
 
double Height
 
double Radius
 
unsigned Flag
 
double Xax
 Axis of Symmetry. More...
 
double Yax
 
double Zax
 
Vector< FiniteElement * > Bulk_element_pt
 Vector of pointers to element in the fluid layer. More...
 
Vector< FiniteElement * > Interface_element_pt
 Vector of pointers to interface elements. More...
 
- Protected Attributes inherited from oomph::SpineMesh
Vector< Spine * > Spine_pt
 A Spine mesh contains a Vector of pointers to spines. More...
 
- Protected Attributes inherited from oomph::Mesh
Vector< Vector< Node * > > Boundary_node_pt
 
bool Lookup_for_elements_next_boundary_is_setup
 
Vector< Vector< FiniteElement * > > Boundary_element_pt
 
Vector< Vector< int > > Face_index_at_boundary
 
Vector< Node * > Node_pt
 Vector of pointers to nodes. More...
 
Vector< GeneralisedElement * > Element_pt
 Vector of pointers to generalised elements. More...
 
std::vector< boolBoundary_coordinate_exists
 

Additional Inherited Members

- Public Types inherited from oomph::Mesh
typedef void(FiniteElement::* SteadyExactSolutionFctPt) (const Vector< double > &x, Vector< double > &soln)
 
typedef void(FiniteElement::* UnsteadyExactSolutionFctPt) (const double &time, const Vector< double > &x, Vector< double > &soln)
 
- Static Public Attributes inherited from oomph::Mesh
static Steady< 0 > Default_TimeStepper
 The Steady Timestepper. More...
 
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
 Static boolean flag to control warning about mesh level timesteppers. More...
 

Detailed Description

template<class ELEMENT, class INTERFACE_ELEMENT>
class CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >

Single-layer spine mesh class derived from standard cubic 3D mesh. The mesh contains a layer of spinified fluid elements (of type ELEMENT; e.g SpineElement<CrozierRaviartElement<2>) of type INTERFACE_ELEMENT, e.g. SpineSurfaceNavierStokesInterfaceElement<ELEMENT> for 3D planar problems.

This mesh has been carefully desihned so that the numeration of the nodes on the boundaries 0 and 5 (bottom and top) coincides with the numeration of the spines

Constructor & Destructor Documentation

◆ CombTipSpineMesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::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 
)

Constructor: Pass number of elements in x-direction, number of The composed mesh is too complicated for giving xmin,xmax etc.. Nevertheless we keep nx, ny, nz making reference

Constructor for spine 3D mesh:

The mesh contains a layer of spinified fluid elements (of type ELEMENT; e.g SpineElement<CrozierRaviartElement<2>)

258  :
259  Nel(nel), Alpha(alpha), Length(length), Height(height), Radius(radius), Flag(flag)
260 {
261  // We've called the "generic" constructor for the RectangularQuadMesh
262  // which doesn't do much...
263  // Now set up the parameters that characterise the mesh geometry
264  // then call the constructor
265 
266 
267  // Periodic?
268 // MySimpleCubicQuadMesh<ELEMENT >::Xperiodic = false;
269 
270  // Now build the mesh:
271 
272 
273  build_single_layer_mesh(time_stepper_pt);
274 
275 }
unsigned Flag
Definition: comb_tip_spine_mesh.h:161
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: comb_tip_spine_mesh.h:284
unsigned int Nel
Definition: comb_tip_spine_mesh.h:154
double Length
Definition: comb_tip_spine_mesh.h:158
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 Height
Definition: comb_tip_spine_mesh.h:159
RealScalar alpha
Definition: level1_cplx_impl.h:151
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
radius
Definition: UniformPSDSelfTest.py:15

References CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh().

Member Function Documentation

◆ add_side_spinemesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh ( unsigned int  bound1,
MyTipMesh< ELEMENT, INTERFACE_ELEMENT > *  addmesh_pt,
int addmesh_map_boundary,
int  total_boundaries,
unsigned  flag 
)
protected
575 {
576 
577 
578  //Call the generic function
579  MeshHelper::merge_spine_meshes(this,bound1,addmesh_pt,addmesh_map_boundary,
580  total_boundaries,spine_flag);
581 
582 // add the bulk elements to the mesh
583  for(unsigned i = 0; i< addmesh_pt->nbulk(); i++)
584  {
585  this->Bulk_element_pt.push_back(addmesh_pt->bulk_element_pt(i));
586  }
587 
588  // add the interface elements to the mesh
589 for(unsigned i = 0; i< addmesh_pt->ninterface_element(); i++)
590  {
591  this->Interface_element_pt.push_back(addmesh_pt->interface_element_pt(i));
592  }
593 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
Definition: comb_tip_spine_mesh.h:173
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
Definition: comb_tip_spine_mesh.h:170
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
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: tip_spine_mesh.h:82
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

References MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), i, MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), oomph::MeshHelper::merge_spine_meshes(), MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), and MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element().

◆ build_single_layer_mesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh ( TimeStepper time_stepper_pt)
protectedvirtual

Helper function to actually build the single-layer spine mesh (called from various constructors)

Helper function that actually builds the single-layer spine mesh based on the parameters set in the various constructors

286 {
287 
288 
289 // Axis pf simmetry
290  Xax = 0.0;
291  Yax = 0.0;
292  Zax = 1.0;
293 
294  unsigned n_x = Nel;
295  unsigned n_y = Nel;
296  unsigned n_z = Nel;
297 
298  // Build the first canion mesh:
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);
300 
301  mesh1_pt->node_update();
302 
303  //mesh1_pt->output("tip1.dat");
304 // We copy this mesh to our problem mesh
305 
306 
307 // add the nodes to the mesh
308 //we reasign the spine_nodes to point to the ptoblem mesh
309  for(unsigned i = 0; i< mesh1_pt->nnode(); i++)
310  {
311  //Set spine update flag equal to Flag for the nodes of this function
312  mesh1_pt->node_pt(i)->node_update_fct_id() = Flag;
313  mesh1_pt->node_pt(i)->spine_mesh_pt() = this;
314  this->add_node_pt(mesh1_pt->node_pt(i));
315  }
316 
317  // add the bulk elements to the mesh
318  for(unsigned i = 0; i< mesh1_pt->nbulk(); i++)
319  {
320  Bulk_element_pt.push_back(mesh1_pt->bulk_element_pt(i));
321  }
322 
323  // add the interface elements to the mesh
324 for(unsigned i = 0; i< mesh1_pt->ninterface_element(); i++)
325  {
326  Interface_element_pt.push_back(mesh1_pt->interface_element_pt(i));
327  }
328 
329 // add all the elements to the mesh
330 for(unsigned i = 0; i< mesh1_pt->nelement(); i++)
331  {
332  Element_pt.push_back(mesh1_pt->element_pt(i));
333  }
334 
335 
336  // add the spines to the mesh
337 for(unsigned i = 0; i< mesh1_pt->nspine(); i++)
338  {
339  Spine_pt.push_back(mesh1_pt->spine_pt(i));
340  }
341 
342 //add the boundaries
343  set_nboundary( mesh1_pt->nboundary());
344 
345 for(unsigned b =0; b< mesh1_pt->nboundary(); b++)
346  {
347  for(unsigned i = 0; i<mesh1_pt->nboundary_node(b); i++)
348  {
349  // We remove the node from the old boundary mesh ( This is not necessary and it is mainly wrotten for avoiding the warning message)
350  Node* node_pt = mesh1_pt->boundary_node_pt(b,i );
352  this->add_boundary_node( b , node_pt);
353  }
354  }
355 
356 
357 
358 //We create a second mesh
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);
360 
361  //mesh2_pt->output("tip2.dat");
362 
363 //Resignation pointer for the boundary conditions of the second mesh
364  int addmesh_map_boundary[6];
365 
366  for(unsigned int i =0;i<6;i++)
367  {
368  addmesh_map_boundary[i] = i;
369  }
370 
371  addmesh_map_boundary[2] = 6;
372  addmesh_map_boundary[0] = 2;
373  addmesh_map_boundary[4] = -1;
374 
375  add_side_spinemesh(2, mesh2_pt ,addmesh_map_boundary, 7,Flag);
376 // cout<<"After adding 2 the mesh has "<<nbulk()<<" bulk elements"<<endl;
377 
378 
379 
380 //We create a third mesh
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);
382 
383  //mesh3_pt->output("tip3.dat");
384 
385  change_boundaries( mesh3_pt,2,3,6);
386 
387  //std::cout<<"After change the boundary 2 have "
388  // <<mesh3_pt->nboundary_node(2)<<" nodes"<<std::endl;
389 
390 
391 //Resignation pointer for the boundary conditions of the third mesh
392 
393  for(unsigned int i =0;i<6;i++)
394  {
395  addmesh_map_boundary[i] = i;
396  }
397  addmesh_map_boundary[1] = 7;
398  addmesh_map_boundary[0] = 1;
399  addmesh_map_boundary[3] = -1;
400 
401  add_side_spinemesh(1, mesh3_pt ,addmesh_map_boundary, 8,Flag);
402 
403 // cout<<"After adding 3 the mesh has "<<nbulk()<<" bulk elements"<<endl;
404 
405 
406 //We create a fourth mesh
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);
408 
409 
410 // We miror the mesh twice
411  rotate_90_zeq1_xeq0(mesh4_pt);
412 
413  // mesh4_pt->output("tip4.dat");
414 //Resignation pointer for the boundary conditions of the fifth mesh
415 
416  for(unsigned int i =0;i<6;i++)
417  {
418  addmesh_map_boundary[i] = i;
419  }
420  addmesh_map_boundary[0] = 2;
421  addmesh_map_boundary[1] =7 ;
422  addmesh_map_boundary[2] = 6;
423  addmesh_map_boundary[4] = -1;
424 //cout<<"Before adding 4 the mesh has "<<nnode()<<" nodes "<<endl;
425 
426  add_side_spinemesh(6, mesh4_pt ,addmesh_map_boundary, 8,Flag);
427 
428 
429 
430 
431 //cout<<"After adding 4 the mesh has "<<nnode()<<" nodes "<<endl;
432 //We create a fourth mesh
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);
434 
435 // We miror the mesh twice
436  rotate_90_zeq1_yeq0(mesh5_pt);
437 
438  //mesh5_pt->output("tip5.dat");
439 
440  change_boundaries( mesh5_pt,2,3,6);
441 
442 //Resignation pointer for the boundary conditions of the fourth mesh
443 
444  for(unsigned int i =0;i<6;i++)
445  {
446  addmesh_map_boundary[i] = i;
447  }
448  addmesh_map_boundary[0] = 1;
449  addmesh_map_boundary[1] = 6;
450  addmesh_map_boundary[3] = -1;
451 
452 // Add to the general mesh
453  add_side_spinemesh(7, mesh5_pt ,addmesh_map_boundary, 8,Flag);
454 
455 // cout<<"After adding 5 in the tip mesh the boundary 1 has"<<this->nboundary_node(1)<<"nodes"<<endl;
456 
457 // cout<<"After adding 5 the mesh has "<<nbulk()<<" bulk elements"<<endl;
458 
459 
460 
461 
462 // We create the last mesh
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);
464 
465  rotate_90_zeq1_xeq0(mesh6_pt);
466 
467  // mesh6_pt->output("tip6.dat");
468 
469  change_boundaries( mesh6_pt,4,1,6);
470 
471  for(unsigned int i =0;i<6;i++)
472  {
473  addmesh_map_boundary[i] = i;
474  }
475  addmesh_map_boundary[0] = 6;
476  addmesh_map_boundary[1] = -1;
477  addmesh_map_boundary[2] = 4;
478 
479 // Add to the general mesh
480  add_side_spinemesh(6, mesh6_pt ,addmesh_map_boundary, 7,Flag);
481 
482  std::cout<<"The tip mesh consists of "
483  <<nbulk()<<" bulk elements and "<<ninterface_element()
484  << " interface elements."<<std::endl;
485 
486 // At the end we destroy the block meshes in two steps
487 
488 // 1. We disconect the meshesh from the nodes and elements (if not we delete them at the time we delete the meshes)
495 
496 //2. Simply delete (this function can give a segmentation fault error when there are spines still attached to the old update functions written in the constructor)
497  delete mesh1_pt;
498  delete mesh2_pt;
499  delete mesh3_pt;
500  delete mesh4_pt;
501  delete mesh5_pt;
502  delete mesh6_pt;
503 
504 
505 
506 
507 // until now we have just worked with a square channel
508 // introduce the aspect ratio and different lenght (there is a factor 2 becasue 1 = halve height= b/2)
509  int ncount;
510  ncount = this->nnode();
511  for(int i = 0; i< ncount; i++)
512  {
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;
517  }
518 // Update also the origin of the spines
519  unsigned long nspines = this->nspine();
520  for(unsigned long i = 0; i<nspines;i++)
521  {
522  Spine* spine_pt = this->spine_pt(i);
523  double x_spine = spine_pt->geom_parameter(0);
524  double y_spine = spine_pt->geom_parameter(1);
525  double z_spine = spine_pt->geom_parameter(2);
526  spine_pt->geom_parameter(0) = x_spine *Alpha/2.0;
527  spine_pt->geom_parameter(1) = y_spine * Length;
528  spine_pt->geom_parameter(2) = z_spine * Height/2.0;
529  }
530 
531 
532 // Update the axis of simmetry
533  Zax = Zax * Height/2.0;
534 
535 // Update the spines heigth according to the new geometry
536  ncount = this->nboundary_node(5);
537 
538  for(int i = 0; i< ncount; i++)
539  {
540  SpineNode* spine_node_pt = dynamic_cast<SpineNode*>(this->boundary_node_pt(5,i));
541  Spine* spine_pt = spine_node_pt->spine_pt();
542  double x_spine = spine_pt->geom_parameter(0);
543  double y_spine = spine_pt->geom_parameter(1);
544  double z_spine = spine_pt->geom_parameter(2);
545 
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;
550 
551  }
552 
553 
554 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
Scalar * b
Definition: benchVecAdd.cpp:17
double Xax
Axis of Symmetry.
Definition: comb_tip_spine_mesh.h:164
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
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
unsigned long nbulk() const
Number of elements in bulk.
Definition: comb_tip_spine_mesh.h:89
void rotate_90_zeq1_yeq0(SpineMesh *rot_mesh_pt)
Definition: comb_tip_spine_mesh.h:207
double Yax
Definition: comb_tip_spine_mesh.h:165
double Zax
Definition: comb_tip_spine_mesh.h:166
coincides with the numeration of the spines
Definition: tip_spine_mesh.h:52
void flush_spine_element_and_node_storage()
Definition: tip_spine_mesh.h:174
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
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
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
Definition: mesh.h:611
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:186
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
virtual void remove_from_boundary(const unsigned &b)
Definition: nodes.cc:2350
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.
Definition: spines.h:616
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
Definition: spines.h:328
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
Definition: spines.h:64
double & geom_parameter(const unsigned &i)
Definition: spines.h:287

References TanhSolnForAdvectionDiffusion::Alpha, b, oomph::Mesh::boundary_node_pt(), MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), oomph::Mesh::element_pt(), oomph::PressureAdvectionDiffusionValidation::Flag, MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage(), oomph::Spine::geom_parameter(), oomph::SpineNode::h(), GlobalParameters::Height, i, MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), Global_Physical_Variables::Length, oomph::Mesh::nboundary(), oomph::Mesh::nboundary_node(), MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), oomph::Mesh::nelement(), MyTipMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element(), oomph::Mesh::nnode(), oomph::SpineMesh::node_pt(), oomph::SpineMesh::node_update(), oomph::SpineNode::node_update_fct_id(), oomph::SpineMesh::nspine(), Global_Physical_Variables::Radius, oomph::Node::remove_from_boundary(), oomph::SpineNode::spine_mesh_pt(), oomph::SpineNode::spine_pt(), oomph::SpineMesh::spine_pt(), sqrt(), and oomph::Node::x().

Referenced by CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::CombTipSpineMesh().

◆ bulk_element_pt()

template<class ELEMENT , class INTERFACE_ELEMENT >
FiniteElement* & CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to elements in bulk.

85  {return Bulk_element_pt[i];}

References i.

Referenced by STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh().

◆ change_boundaries()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::change_boundaries ( Mesh pt_mesh,
unsigned int  oldbound,
unsigned int  newbound,
unsigned int  total_boundaries 
)
protected

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

613 {
614 
615  for(unsigned int i = 0; i<pt_mesh->nboundary_node(oldbound);i++)
616  {
617  if( !(pt_mesh->boundary_node_pt(oldbound,i)->is_on_boundary(newbound)) ) //Do not add the nodes which were before on the boundary
618  pt_mesh->add_boundary_node(newbound, pt_mesh->boundary_node_pt(oldbound,i) );
619  }
620  pt_mesh->remove_boundary_nodes(oldbound);
621  pt_mesh->set_nboundary(total_boundaries);
622 
623 }
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
Definition: mesh.cc:204
virtual bool is_on_boundary() const
Definition: nodes.h:1373

References oomph::Mesh::add_boundary_node(), oomph::Mesh::boundary_node_pt(), i, oomph::Node::is_on_boundary(), oomph::Mesh::nboundary_node(), oomph::Mesh::remove_boundary_nodes(), and oomph::Mesh::set_nboundary().

◆ flush_spine_element_and_node_storage()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage ( )
inline
94  {
95  //Clear vectors of pointers to the nodes and elements
96  Node_pt.clear();
97  Bulk_element_pt.clear();
98  Interface_element_pt.clear();
99  Element_pt.clear();
100  Spine_pt.clear();
101  }
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:183

Referenced by STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh().

◆ interface_element_pt()

template<class ELEMENT , class INTERFACE_ELEMENT >
FiniteElement* & CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to interface elements.

77  {return Interface_element_pt[i];}

References i.

Referenced by STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh().

◆ nbulk()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk ( ) const
inline

Number of elements in bulk.

89 {return Bulk_element_pt.size();}

Referenced by STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh().

◆ ninterface_element()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element ( ) const
inline

Number of elements on interface.

81 {return Interface_element_pt.size();}

Referenced by STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh().

◆ rotate_90_zeq1_xeq0()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::rotate_90_zeq1_xeq0 ( SpineMesh rot_mesh_pt)
inlineprotected
178  {
179  unsigned long nnode = rot_mesh_pt->nnode();
180  for(unsigned long i = 0; i<nnode;i++)
181  {
182  Node* node_pt = rot_mesh_pt->node_pt(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;
187  }
188 
189 
190 // We rotate as well the geometric parameters which were originally set as the coordinate of the node at the origin of the spine
191  unsigned long nspines = rot_mesh_pt->nspine();
192  for(unsigned long i = 0; i<nspines;i++)
193  {
194  Spine* spine_pt = rot_mesh_pt->spine_pt(i);
195  double x_spine = spine_pt->geom_parameter(0);
196  double z_spine = spine_pt->geom_parameter(2);
197  spine_pt->geom_parameter(0) = 1.0 - z_spine;
198  spine_pt->geom_parameter(2) = 1.0 + x_spine;
199  }
200 
201  //we update again the nodes
202  rot_mesh_pt->node_update();
203  }

References oomph::Spine::geom_parameter(), i, oomph::Mesh::nnode(), oomph::SpineMesh::node_pt(), oomph::SpineMesh::node_update(), oomph::SpineMesh::nspine(), oomph::SpineMesh::spine_pt(), and oomph::Node::x().

◆ rotate_90_zeq1_yeq0()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::rotate_90_zeq1_yeq0 ( SpineMesh rot_mesh_pt)
inlineprotected
208  {
209  unsigned long nnode = rot_mesh_pt->nnode();
210  for(unsigned long i = 0; i<nnode;i++)
211  {
212  Node* node_pt = rot_mesh_pt->node_pt(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;
217  }
218 
219  // We rotate as well the geometric parameters which were originally set as the coordinate of the node at the origin of the spine
220 
221  unsigned long nspines = rot_mesh_pt->nspine();
222  for(unsigned long i = 0; i<nspines;i++)
223  {
224  Spine* spine_pt = rot_mesh_pt->spine_pt(i);
225  double y_spine = spine_pt->geom_parameter(1);
226  double z_spine = spine_pt->geom_parameter(2);
227  spine_pt->geom_parameter(1) = -1.0 + z_spine;
228  spine_pt->geom_parameter(2) = 1.0 - y_spine;
229  }
230 
231  //we update again the nodes
232  rot_mesh_pt->node_update();
233  }

References oomph::Spine::geom_parameter(), i, oomph::Mesh::nnode(), oomph::SpineMesh::node_pt(), oomph::SpineMesh::node_update(), oomph::SpineMesh::nspine(), oomph::SpineMesh::spine_pt(), and oomph::Node::x().

◆ spine_node_update()

template<class ELEMENT , class INTERFACE_ELEMENT >
virtual void CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::spine_node_update ( SpineNode spine_node_pt)
inlinevirtual

General node update function implements pure virtual function defined in SpineMesh base class and performs specific node update actions: along vertical spines

Implements oomph::SpineMesh.

123  {
124  //Get fraction along the spine
125  double W = spine_node_pt->fraction();
126  //Get spine height
127  double H = spine_node_pt->h();
128  //Get the position of the node at the origin
129  // SpineNode* origin_pt = dynamic_cast<SpineNode*>(spine_node_pt->spine_pt()->geom_data_pt(0));
130  Vector<double> origin_pt(3);
131  origin_pt[0] = spine_node_pt->spine_pt()->geom_parameter(0);
132  origin_pt[1] = spine_node_pt->spine_pt()->geom_parameter(1);
133  origin_pt[2] = spine_node_pt->spine_pt()->geom_parameter(2);
134 
135  //set scale norm vector
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]) );
138 
139  //Set the x coordinate
140  spine_node_pt->x(0) = origin_pt[0] + H*W* (Xax - origin_pt[0] )/norm;
141 
142  //Set the y coordinate
143  spine_node_pt->x(1) = origin_pt[1] + H*W* (Yax - origin_pt[1] )/norm;
144 
145  //Set the value of z
146  spine_node_pt->x(2) = origin_pt[2] + H*W* (Zax - origin_pt[2] )/norm;
147 
148 
149  }
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:378
@ W
Definition: quadtree.h:63

References oomph::SpineNode::fraction(), oomph::Spine::geom_parameter(), H, oomph::SpineNode::h(), oomph::SpineNode::spine_pt(), sqrt(), oomph::QuadTreeNames::W, and oomph::Node::x().

Member Data Documentation

◆ Alpha

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Alpha
protected

Aspect ratio, lengt, heighth and radius.

◆ Bulk_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Bulk_element_pt
protected

Vector of pointers to element in the fluid layer.

◆ Flag

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Flag
protected

◆ Height

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Height
protected

◆ Interface_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Interface_element_pt
protected

Vector of pointers to interface elements.

◆ Length

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Length
protected

◆ Nel

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Nel
protected

◆ Radius

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Radius
protected

◆ Xax

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Xax
protected

Axis of Symmetry.

◆ Yax

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Yax
protected

◆ Zax

template<class ELEMENT , class INTERFACE_ELEMENT >
double CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Zax
protected

The documentation for this class was generated from the following file: