STSpineMesh< ELEMENT, INTERFACE_ELEMENT > Class Template Reference

#include <st_mesh.h>

+ Inheritance diagram for STSpineMesh< ELEMENT, INTERFACE_ELEMENT >:

Public Member Functions

 STSpineMesh (const unsigned int &nel_can, const unsigned int &nel, const unsigned int &nel_liq, const double &alpha, const double &length_can, const double &length_tip, const double &length_liq, const double &height, const double &radius, 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 *& interface_line_element_pt (const unsigned long &i)
 Access functions for pointers to interface line elements. More...
 
unsigned long ninterfaceline () const
 Number of elements on the line 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...
 
FiniteElement *& bulk_outlet_element_pt (const unsigned long &i)
 
unsigned long nbulkoutlet () const
 
FiniteElement *& bulk_inlet_element_pt (const unsigned long &i)
 
unsigned long nbulkinlet () const
 
int face_index_outlet ()
 
int face_index_inlet ()
 
void full_output (std::ostream &outfile, const unsigned &n_plot)
 
void surface_output (std::ostream &outfile, const unsigned &n_plot)
 
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

virtual void build_single_layer_mesh (TimeStepper *time_stepper_pt)
 
void add_side_spinemesh (unsigned int bound1, CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned flag)
 
void add_mesh (unsigned int bound1, Mesh *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned spine_flag)
 
- 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_can
 
unsigned int Nel
 
unsigned int Nel_liq
 
double Alpha
 Aspect ratio, length, height and radius. More...
 
double Length_can
 
double Length_tip
 
double Length_liq
 
double Height
 
double Radius
 
double Xsim
 
double Zsim
 
double Ysim
 
int Face_index_outlet
 
int Face_index_inlet
 
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...
 
Vector< FiniteElement * > Bulk_outlet_element_pt
 Vector of pointers to the bulk outlet elements in the fluid layer. More...
 
Vector< FiniteElement * > Bulk_inlet_element_pt
 Vector of pointers to the bulk inlet elements in the fluid layer. More...
 
Vector< FiniteElement * > Interface_line_element_pt
 
- 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 STSpineMesh< ELEMENT, INTERFACE_ELEMENT >

Mesh for the Saffman-Taylor problem in a cell of arbitrary aspect ratio The mesh contains a layer of spinified fluid elements (of type ELEMENT; e.g SpineElement<CrozierRaviartElement<2>) in the boundary 5

Remarck, we set the flag of every mesh twice. it is not logical but saves programming time

Constructor & Destructor Documentation

◆ STSpineMesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::STSpineMesh ( const unsigned int nel_can,
const unsigned int nel,
const unsigned int nel_liq,
const double alpha,
const double length_can,
const double length_tip,
const double length_liq,
const double height,
const double radius,
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>)

302  :
303  Nel_can(nel_can), Nel(nel), Nel_liq(nel_liq), Alpha(alpha), Length_can(length_can), Length_tip(length_tip), Length_liq(length_liq), Height(height), Radius(radius)
304 {
305  // We've called the "generic" constructor for the RectangularQuadMesh
306  // which doesn't do much...
307  // Now set up the parameters that characterise the mesh geometry
308  // then call the constructor
309 
310 
311  // Now build the mesh:
312 
313 
314  build_single_layer_mesh(time_stepper_pt);
315 
316 }
unsigned int Nel
Definition: st_mesh.h:235
unsigned int Nel_liq
Definition: st_mesh.h:236
double Length_liq
Definition: st_mesh.h:242
double Length_tip
Definition: st_mesh.h:241
double Height
Definition: st_mesh.h:243
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: st_mesh.h:325
unsigned int Nel_can
Definition: st_mesh.h:234
double Alpha
Aspect ratio, length, height and radius.
Definition: st_mesh.h:239
double Radius
Definition: st_mesh.h:244
double Length_can
Definition: st_mesh.h:240
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 STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh().

Member Function Documentation

◆ add_mesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_mesh ( unsigned int  bound1,
Mesh addmesh_pt,
int addmesh_map_boundary,
int  total_boundaries,
unsigned  spine_flag 
)
protected

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

533 {
534 
535  int bound2 = -1;
536 
537  Mesh *mesh_pt = this;
538 
539 //Map of the commom nodes from the nodes in the added mesh to the old mesh (It is needed for the added elements to point to the old nodes and not duplicate this nodes)
540  std::map<Node*,Node*> map_bound_node;
541 
542 // We have to look for the shared boundary of the second mwsh. We identify it giving a value of -1 in the mappring of the old to the new boundary conditions
543  for(unsigned i = 0; i<addmesh_pt->nboundary(); i++)
544  {
545  if(addmesh_map_boundary[i] == -1)
546  bound2 = i;
547  }
548 
549 //#ifdef PARANOID
550 
551  if(bound2 == -1) {
552  throw OomphLibError("Error setting the shared boundary conditions\n",
555  }
556 
557 
558 // Another control. Test that the two shared boundaries have the same number of nodes
559  if(addmesh_pt->nboundary_node(bound2) != mesh_pt->nboundary_node(bound1) )
560  {
561  std::ostringstream error_stream;
562  error_stream
563  <<"Different number of nodes in the shared boundaries:\n" <<
564  "Boundary "<<bound1<<" in the original mesh has "
565  <<mesh_pt->nboundary_node(bound1)<<" nodes \n"<<
566  "and Boundary "<<bound2<<" in the added mesh has "
567  <<addmesh_pt->nboundary_node(bound2)<<" nodes.\n";
568 
569  throw OomphLibError(error_stream.str(),
572  }
573 
574 //#endif
575 
576 //We create the mappping
577 
578  //square distance between two nodes
579  double d;
580 // Minimun distance between two nodes (only useful in case of error)
581  double dmin;
582  //Dimession of the space
583  unsigned dim = addmesh_pt->node_pt(0)->ndim();
584 
585  unsigned long nodecounter;
586 
587 
588 
589  for( unsigned long i = 0; i< addmesh_pt->nboundary_node(bound2);i++)
590  {
591  nodecounter =0;
592  dmin = 100.0;
593  do
594  {
595  d = 0.0;
596  for(unsigned int k=0;k<dim;k++)
597  {
598  d += (addmesh_pt->boundary_node_pt(bound2,i)->x(k) - mesh_pt->boundary_node_pt(bound1,nodecounter)->x(k) )*
599  (addmesh_pt->boundary_node_pt(bound2,i)->x(k) - mesh_pt->boundary_node_pt(bound1,nodecounter)->x(k) );
600  }
601 
602 
603  nodecounter++;
604  if(dmin>d) dmin = d;
605 
606  }while((nodecounter < mesh_pt->nboundary_node(bound1)) && (d>1E-10));
607 
608  if((nodecounter == mesh_pt->nboundary_node(bound1)) && (d>1E-10))
609  {
610  std::ostringstream error_stream;
611  error_stream
612  <<"Error doing the mapping between shared boundaries:\n" <<
613  "it could not be found minimum distance in node "<<i<<"\n"
614  <<"Minimum found distance = "<<sqrt(dmin)<<"\n"
615  <<"Position in the added mesh = "
616  <<addmesh_pt->boundary_node_pt(bound2,i)->x(0)<<" "
617  <<addmesh_pt->boundary_node_pt(bound2,i)->x(1)<<" "
618  <<addmesh_pt->boundary_node_pt(bound2,i)->x(2)<<"\n";
619 
620  throw OomphLibError(error_stream.str(),
623  }
624  else
625  {
626 
627  // Creating the nodes map
628  map_bound_node[addmesh_pt->boundary_node_pt(bound2,i)] = mesh_pt->boundary_node_pt(bound1,nodecounter-1);
629 
630  }
631 
632 
633  }
634  //Now we loop over the elements of the added mesh on the shared boundary and reasign the node pointers to the ones
635  // of the original mesh.
636 
637 // REMARCK!!!!! the boundary_element scheme was not implemented in the mesh design, so that we have to loop over all the elements
638 
639 
640  for(unsigned int i = 0; i< addmesh_pt->nelement(); i++ )
641  {
642 
643 //Pointer to the element
644  ELEMENT* el_pt = dynamic_cast<ELEMENT*>( addmesh_pt->element_pt(i));
645 
646  // Loop over the nodes in the element
647  for(unsigned j =0;j< el_pt->nnode();j++)
648  {
649  //In case the node is in the boundary (and therefore in the map), we reasign the node
650  if(map_bound_node[ el_pt->node_pt(j) ] != 0)
651  {
652  el_pt->node_pt(j) = map_bound_node[ el_pt->node_pt(j)];
653  }
654  }
655  }
656 
657 
658 //We add the nodes which are not in the shared boundary
659 
660 
661  unsigned long n_nodes_addmesh = addmesh_pt->nnode();
662  unsigned int zaehler = 0;
663  for(unsigned j=0;j<n_nodes_addmesh;j++)
664  {
665  if( map_bound_node[ addmesh_pt->node_pt(j)] == 0)
666  {
667  SpineNode* nod_pt = dynamic_cast<SpineNode*>(addmesh_pt->node_pt(j));
668  nod_pt->spine_mesh_pt() = this;
669  nod_pt->node_update_fct_id() = spine_flag;
670  mesh_pt->add_node_pt( addmesh_pt->node_pt(j) );
671  }
672  else
673  {
674  zaehler++;
675  }
676  }
677 
678 
679 //#ifdef PARANOID
680 
681 // Another control
682  if(zaehler != addmesh_pt->nboundary_node(bound2))
683  {
684  std::ostringstream error_stream;
685  error_stream
686  <<"You have added "
687  <<(zaehler-addmesh_pt->nboundary_node(bound2))
688  <<" nodes too much to the mesh.\n"
689  <<"(This control should be removed in case we do not want to copy all the nodes of the shared boundaries)\n";
690 
691  throw OomphLibError(error_stream.str(),
694  }
695 
696 
697 //#endif
698 
699  //We add the elements to the mesh
700 
701  for(unsigned i = 0; i< addmesh_pt->nelement(); i++)
702  {
703  ELEMENT* el_pt = dynamic_cast<ELEMENT*>( addmesh_pt->element_pt(i));
704  // FiniteElement* el_pt = addmesh_pt->finite_element_pt(i);
705  Element_pt.push_back(el_pt);
706  Bulk_element_pt.push_back(el_pt );
707  }
708 
709 
710  // We reset the number of boundaries
711  mesh_pt->set_nboundary(total_boundaries);
712 
713 
714  //We reset the boundary conditions of the old mesh (the shared boundary is not more in a boundary)
715  mesh_pt->remove_boundary_nodes(bound1);
716 
717 
718 
719  //We reset the boundary conditions of the new nodes
720  for(int i=0;i<(int)(addmesh_pt->nboundary());i++)
721  {
722  //Loop over the boundary nodes
723  for(unsigned long j =0;j<addmesh_pt->nboundary_node(i);j++)
724  {
725 
726  //We do not reset the commom boundary,whose nodes will be deleted at the end
727  if(i!=bound2)
728  {
729  //Create a pointer to the node
730  Node* node_pt = addmesh_pt->boundary_node_pt(i,j);
731 
732  // We remove the old boundaries in case it is not yet included in a new boundary
733  bool alr_included = 0;
734  for(unsigned k =0;k<this->nboundary_node(i);k++)
735  {
736  if(node_pt == this->boundary_node_pt(i,k) )
737  alr_included = 1;
738  }
739  if(!alr_included)
741 
742  // We test again not to include the nodes which will be deleted
743  if( map_bound_node[node_pt] == 0)
744  {
745  mesh_pt->add_boundary_node( addmesh_map_boundary[i], node_pt );
746  }
747  // if not we have to include to the boundarie (in the case that they were not included before)the maped nodes
748  else
749  {
750  Node* map_node_pt = map_bound_node[node_pt];
751  if(!map_node_pt->is_on_boundary(addmesh_map_boundary[i]) )
752  mesh_pt->add_boundary_node(addmesh_map_boundary[i], map_node_pt );
753  }
754  }
755  }
756  }
757 
758 
759 // At the end we remove the shared nodes of the second mesh for avoiding problems with memory leaking
760 
761  for(unsigned long j =0;j<addmesh_pt->nboundary_node(bound2);j++)
762  delete addmesh_pt->boundary_node_pt(bound2,j);
763 
764  // We reset the number of boundaries
765  mesh_pt->set_nboundary(total_boundaries);
766 
767 // Small control
768 //#ifdef PARANOID
769  for(unsigned i = 0; i<mesh_pt->nboundary(); i ++)
770  {
771  std::cout<<"Boundary "<<i
772  <<" has "<<mesh_pt->nboundary_node(i)<<" nodes."<<std::endl;
773  }
774 //#endif
775 
776  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
Definition: st_mesh.h:263
Definition: mesh.h:67
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
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 *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
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 bool is_on_boundary() const
Definition: nodes.h:1373
virtual void remove_from_boundary(const unsigned &b)
Definition: nodes.cc:2350
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
Definition: oomph_definitions.h:222
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
Definition: spines.h:648
Definition: spines.h:328
SpineMesh *& spine_mesh_pt()
Definition: spines.h:391
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
Definition: spines.h:384
#define dmin(a, b)
Definition: datatypes.h:24
return int(ret)+1
char char char int int * k
Definition: level2_impl.h:374
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
#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

References oomph::Mesh::add_boundary_node(), oomph::Mesh::add_node_pt(), oomph::Mesh::boundary_node_pt(), dmin, Global_Physical_Variables::E, oomph::Mesh::element_pt(), i, int(), oomph::Node::is_on_boundary(), j, k, oomph::Mesh::nboundary(), oomph::Mesh::nboundary_node(), oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::SpineNode::node_update_fct_id(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Mesh::remove_boundary_nodes(), oomph::Node::remove_from_boundary(), oomph::Mesh::set_nboundary(), oomph::SpineNode::spine_mesh_pt(), sqrt(), and oomph::Node::x().

◆ add_side_spinemesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh ( unsigned int  bound1,
CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT > *  addmesh_pt,
int addmesh_map_boundary,
int  total_boundaries,
unsigned  flag 
)
protected
499 {
500 
501 
502  //Call the generic function
503  MeshHelper::merge_spine_meshes(this,bound1,addmesh_pt,addmesh_map_boundary,
504  total_boundaries,spine_flag);
505 
506 // add the bulk elements to the mesh
507  for(unsigned i = 0; i< addmesh_pt->nbulk(); i++)
508  {
509  this->Bulk_element_pt.push_back(addmesh_pt->bulk_element_pt(i));
510  }
511 
512  // add the interface elements to the mesh
513 for(unsigned i = 0; i< addmesh_pt->ninterface_element(); i++)
514  {
515  this->Interface_element_pt.push_back(addmesh_pt->interface_element_pt(i));
516  }
517 
518 }
unsigned long ninterface_element() const
Number of elements on interface.
Definition: comb_tip_spine_mesh.h:81
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
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: comb_tip_spine_mesh.h:84
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
Definition: st_mesh.h:266
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 CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), i, CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), oomph::MeshHelper::merge_spine_meshes(), CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), and CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element().

◆ build_single_layer_mesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void STSpineMesh< 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

327 {
328 
329 
330 // Axis pf simmetry
331  Xsim = 0.0;
332  Ysim = 0.0;
333  Zsim = 1.0 * Height/2;
334 
335 
336  // Build first canion mesh with flag 0
338 
339  mesh1_pt->node_update();
340 
341 // We copy this mesh to our problem mesh
342 
343 
344 // add the nodes to the mesh
345 //we reasign the spine_nodes to point to the ptoblem mesh
346  for(unsigned i = 0; i< mesh1_pt->nnode(); i++)
347  {
348  //Set spine update flag equal to 0 for the nodes of this function
349  mesh1_pt->node_pt(i)->node_update_fct_id() = 0;
350  mesh1_pt->node_pt(i)->spine_mesh_pt() = this;
351  this->add_node_pt(mesh1_pt->node_pt(i));
352  }
353 
354  // add the bulk elements to the mesh
355  for(unsigned i = 0; i< mesh1_pt->nbulk(); i++)
356  {
357  Bulk_element_pt.push_back(mesh1_pt->bulk_element_pt(i));
358  }
359 
360  // add the interface elements to the mesh
361 for(unsigned i = 0; i< mesh1_pt->ninterface_element(); i++)
362  {
363  Interface_element_pt.push_back(mesh1_pt->interface_element_pt(i));
364  }
365 
366 // add all the elements to the mesh
367 for(unsigned i = 0; i< mesh1_pt->nelement(); i++)
368  {
369  Element_pt.push_back(mesh1_pt->element_pt(i));
370  }
371 
372 
373  // add the spines to the mesh
374 for(unsigned i = 0; i< mesh1_pt->nspine(); i++)
375  {
376  Spine_pt.push_back(mesh1_pt->spine_pt(i));
377  }
378 
379 //add the boundaries
380  set_nboundary( mesh1_pt->nboundary());
381 
382 for(unsigned b =0; b< mesh1_pt->nboundary(); b++)
383  {
384  for(unsigned i = 0; i<mesh1_pt->nboundary_node(b); i++)
385  {
386  // We remove the node from the old boundary mesh ( This is not necessary and it is mainly wrotten for avoiding the warning message)
387  Node* node_pt = mesh1_pt->boundary_node_pt(b,i );
389  this->add_boundary_node( b , node_pt);
390  }
391  }
392 
393 // Set the outlet bulk elements
394 
395  for(unsigned long e =0;e< mesh1_pt->nbulkoutlet();e++)
396  Bulk_outlet_element_pt.push_back(mesh1_pt->bulk_outlet_element_pt(e));
397 
398  this->Face_index_outlet = mesh1_pt->face_index_outlet();
399 
400  for(unsigned long e =0;e< mesh1_pt->ninterfaceline();e++)
402 
403 
404 
405 //We create the tip mesh with flag 1
407 
408 //Resignation pointer for the boundary conditions of the second mesh
409  int addmesh_map_boundary[7];
410 
411  for(unsigned int i =0;i<7;i++)
412  {
413  addmesh_map_boundary[i] = i;
414  }
415  addmesh_map_boundary[3] = -1;
416 
417 // Add the tip mesh
418  add_side_spinemesh(1, mesh2_pt ,addmesh_map_boundary, 7,1);
419 
420  std::cout<<"Tip mesh added"<<std::endl;
421 
422 //Creating the cubic mesh
423  double lycubicmin = -(Length_tip + Length_liq);
424  double lycubicmax = -Length_tip;
425  unsigned Nzcubic = 2*Nel;
426  double heightcubic = Height;
427  double alphacubic = Alpha/2;
428 
429  SimpleCubicMesh<ELEMENT >* mesh3_pt = new SimpleCubicMesh<ELEMENT >(Nel,Nel_liq,Nzcubic,0,alphacubic,lycubicmin,lycubicmax,0, heightcubic,time_stepper_pt);
430 
431 
432 // Set the inlet elementes
433  // int nxin = mesh3_pt->nx(); //It is not working in this way (ask Andrew)
434  // int nyin = mesh3_pt->ny();
435  // int nzin = mesh3_pt->nz();
436  int nxin = Nel;
437  int nyin = Nel_liq;
438  int nzin = Nzcubic;
439 
440  int jin = 0;
441  for(int k =0; k<nzin;k++)
442  {
443  for(int i =0; i<nxin;i++)
444  {
445  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh3_pt->element_pt(i+jin*nxin+k*nxin*nyin));
446  Bulk_inlet_element_pt.push_back(el_pt);
447  }
448  }
449 
450  // Constant coordinate for the face inlet elementes
451  Face_index_inlet = -2;
452 
453 //Resignation pointer for the boundary conditions of the third mesh
454  for(unsigned int i =0;i<7;i++)
455  {
456  addmesh_map_boundary[i] = i;
457  }
458  addmesh_map_boundary[3] = -1;
459  addmesh_map_boundary[5] = 6;
460 
461 
462 
463 // Add the cubic mesh with flag 2
464  add_mesh(1, mesh3_pt, addmesh_map_boundary,7,2);
465 
466 // cout<<"Cubic mesh added"<<endl;
467 
468  std::cout<<"The complete mesh consists of "<<nbulk()<< " bulk elements and "<<ninterface_element()<<" interface elements"<<std::endl;
469 
470 // At the end we destroy the block meshes in two steps
471 
472 // 1. We disconect the meshesh from the nodes and elements (if not we delete them at the time we delete the meshes)
475  mesh3_pt->flush_element_and_node_storage();
476 
477 //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)
478  delete mesh1_pt;
479  delete mesh2_pt;
480  delete mesh3_pt;
481 
482 
483 
484 }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
Definition: comb_can_spine_mesh.h:55
unsigned long nbulk() const
Number of elements in bulk.
Definition: comb_can_spine_mesh.h:89
int face_index_outlet()
Definition: comb_can_spine_mesh.h:86
FiniteElement *& interface_line_element_pt(const unsigned long &i)
Definition: comb_can_spine_mesh.h:80
unsigned long ninterface_element() const
Number of elements on interface.
Definition: comb_can_spine_mesh.h:92
FiniteElement *& bulk_outlet_element_pt(const unsigned long &i)
Definition: comb_can_spine_mesh.h:75
unsigned long nbulkoutlet() const
Definition: comb_can_spine_mesh.h:95
void flush_spine_element_and_node_storage()
Definition: comb_can_spine_mesh.h:100
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: comb_can_spine_mesh.h:71
unsigned long ninterfaceline() const
Definition: comb_can_spine_mesh.h:98
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
Definition: comb_can_spine_mesh.h:67
Definition: comb_tip_spine_mesh.h:62
void flush_spine_element_and_node_storage()
Definition: comb_tip_spine_mesh.h:93
int Face_index_inlet
Definition: st_mesh.h:258
int Face_index_outlet
Definition: st_mesh.h:255
Vector< FiniteElement * > Interface_line_element_pt
Definition: st_mesh.h:275
double Xsim
Definition: st_mesh.h:247
unsigned long ninterface_element() const
Number of elements on interface.
Definition: st_mesh.h:73
double Ysim
Definition: st_mesh.h:251
unsigned long nbulk() const
Number of elements in bulk.
Definition: st_mesh.h:88
Vector< FiniteElement * > Bulk_inlet_element_pt
Vector of pointers to the bulk inlet elements in the fluid layer.
Definition: st_mesh.h:272
void add_mesh(unsigned int bound1, Mesh *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned spine_flag)
Definition: st_mesh.h:531
void add_side_spinemesh(unsigned int bound1, CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned flag)
Definition: st_mesh.h:497
Vector< FiniteElement * > Bulk_outlet_element_pt
Vector of pointers to the bulk outlet elements in the fluid layer.
Definition: st_mesh.h:269
double Zsim
Definition: st_mesh.h:248
void flush_element_and_node_storage()
Definition: mesh.h:407
Simple cubic 3D Brick mesh class.
Definition: simple_cubic_mesh.template.h:47
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.
Definition: spines.h:616
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

References TanhSolnForAdvectionDiffusion::Alpha, b, oomph::Mesh::boundary_node_pt(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_outlet_element_pt(), e(), oomph::Mesh::element_pt(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::face_index_outlet(), oomph::Mesh::flush_element_and_node_storage(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage(), CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage(), GlobalParameters::Height, i, CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::interface_line_element_pt(), k, Global_Physical_Variables::Length_can, Global_Physical_Variables::Length_liq, Global_Physical_Variables::Length_tip, oomph::Mesh::nboundary(), oomph::Mesh::nboundary_node(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulkoutlet(), oomph::Mesh::nelement(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::ninterfaceline(), 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(), and oomph::SpineMesh::spine_pt().

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

◆ bulk_element_pt()

template<class ELEMENT , class INTERFACE_ELEMENT >
FiniteElement* & STSpineMesh< 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.

◆ bulk_inlet_element_pt()

template<class ELEMENT , class INTERFACE_ELEMENT >
FiniteElement* & STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_inlet_element_pt ( const unsigned long &  i)
inline
101  {return Bulk_inlet_element_pt[i];}

References i.

◆ bulk_outlet_element_pt()

template<class ELEMENT , class INTERFACE_ELEMENT >
FiniteElement* & STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_outlet_element_pt ( const unsigned long &  i)
inline
92  {return Bulk_outlet_element_pt[i];}

References i.

◆ face_index_inlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::face_index_inlet ( )
inline
113 {return Face_index_inlet;}

◆ face_index_outlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::face_index_outlet ( )
inline
110 {return Face_index_outlet;}

◆ full_output()

template<class ELEMENT , class INTERFACE_ELEMENT >
void STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::full_output ( std::ostream &  outfile,
const unsigned n_plot 
)
inline

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

132  {
133  //Loop over the elements and call their output functions
134  //Assign Element_pt_range
135  unsigned long Element_pt_range = Bulk_element_pt.size();
136  for(unsigned long e=0;e<Element_pt_range;e++)
137  {
138  // Try to cast to Navier Stokes Element
140  if (el_pt==0)
141  {
142  oomph_info << "Can't execute output(...) for non Navier Stokes Elements"
143  << std::endl;
144  }
145  else
146  {
147  el_pt->full_output(outfile,n_plot);
148  }
149  }
150  }
Definition: navier_stokes_elements.h:395
void full_output(std::ostream &outfile)
Definition: navier_stokes_elements.h:1180
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References e(), oomph::NavierStokesEquations< DIM >::full_output(), and oomph::oomph_info.

◆ interface_element_pt()

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

Access functions for pointers to interface elements.

70  {return Interface_element_pt[i];}

References i.

◆ interface_line_element_pt()

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

Access functions for pointers to interface line elements.

77  {return Interface_line_element_pt[i];}

References i.

◆ nbulk()

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

Number of elements in bulk.

88 {return Bulk_element_pt.size();}

◆ nbulkinlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulkinlet ( ) const
inline
104 {return Bulk_inlet_element_pt.size();}

◆ nbulkoutlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulkoutlet ( ) const
inline
95 {return Bulk_outlet_element_pt.size();}

◆ ninterface_element()

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

Number of elements on interface.

73 {return Interface_element_pt.size();}

◆ ninterfaceline()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::ninterfaceline ( ) const
inline

Number of elements on the line interface.

81 {return Interface_line_element_pt.size();}

◆ spine_node_update()

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

Update function for given spine node – this must be implemented by all specific SpineMeshes.

Implements oomph::SpineMesh.

177  {
178 
179  //Get de flag
180  unsigned flag = spine_node_pt->node_update_fct_id();
181 
182 // Lets first chech whether it is a real SpinNode (not in the liquid mesh)
183  if(flag != 2)
184  {
185  //Get fraction along the spine
186  double W = spine_node_pt->fraction();
187  //Get spine height
188  double H = spine_node_pt->h();
189  //Get the position of the node at the origin
190  Vector<double> origin_pt(3);
191  origin_pt[0] = spine_node_pt->spine_pt()->geom_parameter(0);
192  origin_pt[1] = spine_node_pt->spine_pt()->geom_parameter(1);
193  origin_pt[2] = spine_node_pt->spine_pt()->geom_parameter(2);
194 
195 
196 
197  if(flag ==0) // Canyon mesh
198  {
199  //set scale norm vector
200  double norm = sqrt( (Xsim - origin_pt[0] ) * (Xsim - origin_pt[0] )+(Zsim - origin_pt[2] ) * (Zsim - origin_pt[2]) );
201 
202  //Set th x coordinate
203  spine_node_pt->x(0) = origin_pt[0] + H*W* (Xsim - origin_pt[0] )/norm;
204 
205  //Set the value of z
206  spine_node_pt->x(2) = origin_pt[2] + H*W* (Zsim - origin_pt[2] )/norm;
207 
208 
209  }
210 
211  if(flag ==1) //Tip mesh
212  {
213 
214  //set scale norm vector
215  double norm = sqrt( (Xsim - origin_pt[0] ) * (Xsim - origin_pt[0] )+ (Ysim - origin_pt[1] ) * (Ysim - origin_pt[1] ) +
216  (Zsim- origin_pt[2] ) * (Zsim - origin_pt[2]) );
217 
218  //Set the x coordinate
219  spine_node_pt->x(0) = origin_pt[0] + H*W* (Xsim - origin_pt[0] )/norm;
220 
221  //Set the y coordinate
222  spine_node_pt->x(1) = origin_pt[1] + H*W* (Ysim - origin_pt[1] )/norm;
223 
224  //Set the value of z
225  spine_node_pt->x(2) = origin_pt[2] + H*W* (Zsim - origin_pt[2] )/norm;
226  }
227  }
228  }
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
double & h()
Access function to spine height.
Definition: spines.h:397
Spine *& spine_pt()
Access function to spine.
Definition: spines.h:372
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:378
double & geom_parameter(const unsigned &i)
Definition: spines.h:287
@ W
Definition: quadtree.h:63

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

◆ surface_output()

template<class ELEMENT , class INTERFACE_ELEMENT >
void STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::surface_output ( std::ostream &  outfile,
const unsigned n_plot 
)
inline
154  {
155  //Loop over the elements and call their output functions
156  //Assign Element_pt_range
157  unsigned long Element_pt_range = Interface_element_pt.size();
158  for(unsigned long e=0;e<Element_pt_range;e++)
159  {
160  // Try to cast to Navier Stokes Element
161  FiniteElement* el_pt=dynamic_cast<FiniteElement* >(Interface_element_pt[e]);
162  if (el_pt==0)
163  {
164  oomph_info << "Can't execute surface output(...) for non Finite Element elements"
165  << std::endl;
166  }
167  else
168  {
169  el_pt->output(outfile,n_plot);
170  }
171  }
172  }
Definition: elements.h:1313
virtual void output(std::ostream &outfile)
Definition: elements.h:3050

References e(), oomph::oomph_info, and oomph::FiniteElement::output().

Member Data Documentation

◆ Alpha

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

Aspect ratio, length, height and radius.

◆ Bulk_element_pt

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

Vector of pointers to element in the fluid layer.

◆ Bulk_inlet_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Bulk_inlet_element_pt
protected

Vector of pointers to the bulk inlet elements in the fluid layer.

◆ Bulk_outlet_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Bulk_outlet_element_pt
protected

Vector of pointers to the bulk outlet elements in the fluid layer.

◆ Face_index_inlet

template<class ELEMENT , class INTERFACE_ELEMENT >
int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Face_index_inlet
protected

◆ Face_index_outlet

template<class ELEMENT , class INTERFACE_ELEMENT >
int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Face_index_outlet
protected

◆ Height

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

◆ Interface_element_pt

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

Vector of pointers to interface elements.

◆ Interface_line_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Interface_line_element_pt
protected

◆ Length_can

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Length_can
protected

◆ Length_liq

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Length_liq
protected

◆ Length_tip

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Length_tip
protected

◆ Nel

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

◆ Nel_can

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Nel_can
protected

◆ Nel_liq

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Nel_liq
protected

◆ Radius

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

◆ Xsim

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Xsim
protected

◆ Ysim

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Ysim
protected

◆ Zsim

template<class ELEMENT , class INTERFACE_ELEMENT >
double STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Zsim
protected

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