CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT > Class Template Reference

#include <comb_can_spine_mesh.h>

+ Inheritance diagram for CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >:

Public Member Functions

 CombCanSpineMesh (const unsigned int &nel_xz, const unsigned int &nel_y, const double &alpha, const double &length, const double &height, const double &radius, const unsigned int &flag, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
FiniteElement *& interface_element_pt (const unsigned long &i)
 Access functions for pointers to interface elements. More...
 
FiniteElement *& bulk_element_pt (const unsigned long &i)
 Access functions for pointers to elements in bulk. More...
 
FiniteElement *& bulk_outlet_element_pt (const unsigned long &i)
 
FiniteElement *& interface_line_element_pt (const unsigned long &i)
 
int face_index_outlet ()
 
unsigned long nbulk () const
 Number of elements in bulk. More...
 
unsigned long ninterface_element () const
 Number of elements on interface. More...
 
unsigned long nbulkoutlet () const
 
unsigned long ninterfaceline () const
 
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 (SpineMesh *rot_mesh_pt)
 
void add_outlet_bulk_elements (SimpleCubicMesh< ELEMENT > *add_mesh_pt)
 
void add_line_interface_elements (MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *add_mesh_pt)
 
virtual void build_single_layer_mesh (TimeStepper *time_stepper_pt)
 
void add_side_spinemesh (unsigned int bound1, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned 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_xz
 
unsigned int Nel_y
 
double Alpha
 Aspect ratio, length, height and radius. More...
 
double Length
 
double Height
 
double Radius
 
unsigned int Flag
 
double Xsim
 Axis of Symmetry. More...
 
double Zsim
 
int Face_index_outlet
 
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 * > 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 CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >

This mesh combines a number of CanyonMeshes into a Canyon around an entire quarter tube.

Constructor & Destructor Documentation

◆ CombCanSpineMesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::CombCanSpineMesh ( const unsigned int nel_xz,
const unsigned int nel_y,
const double alpha,
const double length,
const double height,
const double radius,
const unsigned int 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>)

251  :
252  Nel_xz(nel_xz), Nel_y(nel_y), Alpha(alpha), Length(length), Height(height), Radius(radius), Flag(flag)
253 {
254  // We've called the "generic" constructor for the RectangularQuadMesh
255  // which doesn't do much...
256  // Now set up the parameters that characterise the mesh geometry
257  // then call the constructor
258 
259 
260  // Periodic?
261 // MySimpleCubicQuadMesh<ELEMENT >::Xperiodic = false;
262 
263  // Now build the mesh:
264 
265 
266  build_single_layer_mesh(time_stepper_pt);
267 
268 }
double Height
Definition: comb_can_spine_mesh.h:146
double Radius
Definition: comb_can_spine_mesh.h:147
unsigned int Nel_y
Definition: comb_can_spine_mesh.h:141
double Length
Definition: comb_can_spine_mesh.h:145
double Alpha
Aspect ratio, length, height and radius.
Definition: comb_can_spine_mesh.h:144
unsigned int Flag
Definition: comb_can_spine_mesh.h:148
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: comb_can_spine_mesh.h:277
unsigned int Nel_xz
Definition: comb_can_spine_mesh.h:140
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 CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh().

Member Function Documentation

◆ add_line_interface_elements()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_line_interface_elements ( MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *  add_mesh_pt)
inlineprotected
217  {
218  int nx = add_mesh_pt->nx();
219  int ny = add_mesh_pt->ny();
220  int j = ny -1;
221  for(int i =0; i<nx;i++)
222  {
223  INTERFACE_ELEMENT *el_pt = dynamic_cast<INTERFACE_ELEMENT*>(add_mesh_pt->interface_element_pt(i+j*nx));
224  Interface_line_element_pt.push_back(el_pt);
225  }
226  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector< FiniteElement * > Interface_line_element_pt
Definition: comb_can_spine_mesh.h:169
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
Definition: canyon_spine_mesh.h:75
const unsigned & ny() const
Access function for number of elements in y directions.
Definition: simple_cubic_mesh.template.h:114
const unsigned & nx() const
Access function for number of elements in x directions.
Definition: simple_cubic_mesh.template.h:108
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References i, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), j, Mesh_Parameters::nx, oomph::SimpleCubicMesh< ELEMENT >::nx(), Mesh_Parameters::ny, and oomph::SimpleCubicMesh< ELEMENT >::ny().

◆ add_outlet_bulk_elements()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_outlet_bulk_elements ( SimpleCubicMesh< ELEMENT > *  add_mesh_pt)
inlineprotected
199  {
200  int nx = add_mesh_pt->nx();
201  int ny = add_mesh_pt->ny();
202  int nz = add_mesh_pt->nz();
203  int j = ny -1;
204  for(int k =0; k<nz;k++)
205  {
206  for(int i =0; i<nx;i++)
207  {
208  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(add_mesh_pt->element_pt(i+j*nx+k*nx*ny));
209  Bulk_outlet_element_pt.push_back(el_pt);
210  }
211  }
212 
213  }
Vector< FiniteElement * > Bulk_outlet_element_pt
Vector of pointers to the bulk outlet elements in the fluid layer.
Definition: comb_can_spine_mesh.h:166
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
const unsigned & nz() const
Access function for number of elements in y directions.
Definition: simple_cubic_mesh.template.h:120
char char char int int * k
Definition: level2_impl.h:374
const unsigned nz
Definition: ConstraintElementsUnitTest.cpp:32

References oomph::Mesh::element_pt(), i, j, k, Mesh_Parameters::nx, oomph::SimpleCubicMesh< ELEMENT >::nx(), Mesh_Parameters::ny, oomph::SimpleCubicMesh< ELEMENT >::ny(), Mesh_Parameters::nz, and oomph::SimpleCubicMesh< ELEMENT >::nz().

◆ add_side_spinemesh()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::add_side_spinemesh ( unsigned int  bound1,
MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *  addmesh_pt,
int addmesh_map_boundary,
int  total_boundaries,
unsigned  flag 
)
protected
516 {
517 
518  //Call the generic function
519  MeshHelper::merge_spine_meshes(this,bound1,addmesh_pt,addmesh_map_boundary,
520  total_boundaries,spine_flag);
521 
522 // add the bulk elements to the mesh
523  for(unsigned i = 0; i< addmesh_pt->nbulk(); i++)
524  {
525  this->Bulk_element_pt.push_back(addmesh_pt->bulk_element_pt(i));
526  }
527 
528  // add the interface elements to the mesh
529 for(unsigned i = 0; i< addmesh_pt->ninterface_element(); i++)
530  {
531  this->Interface_element_pt.push_back(addmesh_pt->interface_element_pt(i));
532  }
533 
534 }
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
Definition: comb_can_spine_mesh.h:160
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
Definition: comb_can_spine_mesh.h:163
unsigned long ninterface_element() const
Number of elements on interface.
Definition: canyon_spine_mesh.h:79
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
Definition: canyon_spine_mesh.h:83
unsigned long nbulk() const
Number of elements in bulk.
Definition: canyon_spine_mesh.h:87
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 MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), i, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), oomph::MeshHelper::merge_spine_meshes(), MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), and MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element().

◆ build_single_layer_mesh()

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

279 {
280 
281 
282 // Axis pf simmetry
283  Xsim = 0.0;
284  Zsim = 1.0;
285 
286 // Fixed coordinate for the outlet bulk elements
287 
288  Face_index_outlet = 2;
289 
290  unsigned n_x = Nel_xz;
291  unsigned n_y = Nel_y;
292  unsigned n_z = Nel_xz;
293 
294  // Build the first canion mesh:
295 MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT >* mesh1_pt = new MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,0.0,1.0,0.0,1.0,Radius,0,time_stepper_pt);
296 
297 
298 //mesh1_pt->output("can1.dat");
299 
300 // We copy this mesh to our problem mesh
301 
302 
303 // add the nodes to the mesh
304 //we reasign the spine_nodes to point to the ptoblem mesh
305  for(unsigned i = 0; i< mesh1_pt->nnode(); i++)
306  {
307  //Set spine update flag equal to 0 for the nodes of this function
308  mesh1_pt->node_pt(i)->node_update_fct_id() = Flag;
309  mesh1_pt->node_pt(i)->spine_mesh_pt() = this;
310  this->add_node_pt(mesh1_pt->node_pt(i));
311  }
312 
313  // add the bulk elements to the mesh
314  for(unsigned i = 0; i< mesh1_pt->nbulk(); i++)
315  {
316  Bulk_element_pt.push_back(mesh1_pt->bulk_element_pt(i));
317  }
318 
319  // add the interface elements to the mesh
320 for(unsigned i = 0; i< mesh1_pt->ninterface_element(); i++)
321  {
322  Interface_element_pt.push_back(mesh1_pt->interface_element_pt(i));
323  }
324 
325 // add all the elements to the mesh
326 for(unsigned i = 0; i< mesh1_pt->nelement(); i++)
327  {
328  Element_pt.push_back(mesh1_pt->element_pt(i));
329  }
330 
331 
332  // add the spines to the mesh
333 for(unsigned i = 0; i< mesh1_pt->nspine(); i++)
334  {
335  Spine_pt.push_back(mesh1_pt->spine_pt(i));
336  }
337 
338 //add the boundaries
339  set_nboundary( mesh1_pt->nboundary());
340 
341 for(unsigned b =0; b< mesh1_pt->nboundary(); b++)
342  {
343  for(unsigned i = 0; i<mesh1_pt->nboundary_node(b); i++)
344  {
345  // We remove the node from the old boundary mesh ( This is not necessary and it is mainly wrotten for avoiding the warning message)
346  Node* node_pt = mesh1_pt->boundary_node_pt(b,i );
348  this->add_boundary_node( b , node_pt);
349  }
350  }
351 
352 // add the outlet bulk and interface line elements
353  add_outlet_bulk_elements(mesh1_pt);
354  add_line_interface_elements(mesh1_pt);
355 
356 //We create a second mesh
357  MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT >* mesh2_pt = new MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,0.0,1.0,0.0,1.0,Radius,1,time_stepper_pt);
358 
359 
360  //mesh2_pt->output("can2.dat");
361 
362 //Resignation pointer for the boundary conditions of the second mesh
363  int addmesh_map_boundary[6];
364 
365  for(unsigned int i =0;i<6;i++)
366  {
367  addmesh_map_boundary[i] = i;
368  }
369 
370  addmesh_map_boundary[0] = 2;
371  addmesh_map_boundary[2] = 6;
372  addmesh_map_boundary[4] = -1;
373 
374 // add the outlet bulk and interface line elements
375  add_outlet_bulk_elements(mesh2_pt);
376  add_line_interface_elements(mesh2_pt);
377 
378  add_side_spinemesh(2, mesh2_pt ,addmesh_map_boundary, 7,Flag);
379 
380 
381 //We create a third mesh
382  MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT >* mesh3_pt = new MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,0.0,1.0,0.0,1.0,Radius,0,time_stepper_pt);
383 
384 //We rotate the mesh
385  rotate_90(mesh3_pt);
386 
387  //mesh3_pt->output("can3.dat");
388 
389 //Resignation pointer for the boundary conditions of the third mesh
390 
391  for(unsigned int i =0;i<6;i++)
392  {
393  addmesh_map_boundary[i] = i;
394  }
395 
396  addmesh_map_boundary[2] = 6;
397  addmesh_map_boundary[0] = 2;
398  addmesh_map_boundary[4] = -1;
399 
400  add_side_spinemesh(6, mesh3_pt ,addmesh_map_boundary, 7,Flag);
401 
402 // add the outlet bulk and interface line elements
403  add_outlet_bulk_elements(mesh3_pt);
404  add_line_interface_elements(mesh3_pt);
405 
406 //We create a fourth mesh
407  MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT >* mesh4_pt = new MyCanyonMesh<ELEMENT,INTERFACE_ELEMENT > (n_x,n_y,n_z,0.0,1.0,0.0,1.0,0.0,1.0,Radius,1,time_stepper_pt);
408 
409 //We rotate the mesh
410  rotate_90(mesh4_pt);
411 
412  //mesh4_pt->output("can4.dat");
413 
414 //Resignation pointer for the boundary conditions of the third mesh
415 
416  for(unsigned int i =0;i<6;i++)
417  {
418  addmesh_map_boundary[i] = i;
419  }
420 
421  addmesh_map_boundary[2] = 4;
422  addmesh_map_boundary[0] = 6;
423  addmesh_map_boundary[4] = -1;
424 
425 // add the outlet bulk and interface line elements
426  add_outlet_bulk_elements(mesh4_pt);
427  add_line_interface_elements(mesh4_pt);
428 
429  add_side_spinemesh(6, mesh4_pt ,addmesh_map_boundary, 7,Flag);
430 
431 
432  std::cout
433  <<"The canyon mesh consists of "
434  <<nbulk()<<" bulk elements and "
435  <<ninterface_element()<< " interface elements."<<std::endl;
436 
437 
438 // At the end we destroy the block meshes in two steps
439 
440 // 1. We disconect the meshesh from the nodes and elements (if not we delete them at the time we delete the meshes)
445 
446 //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)
447  delete mesh1_pt;
448  delete mesh2_pt;
449  delete mesh3_pt;
450  delete mesh4_pt;
451 
452 
453 // until now we have just worked with a square channel
454 // introduce the aspect ratio and different lenght (there is a factor 2 becasue 1 = halve height= b/2)
455  int ncount;
456  ncount = this->nnode();
457  for(int i = 0; i< ncount; i++)
458  {
459  Node* node_pt = this->node_pt(i);
460  node_pt->x(0) = node_pt->x(0) * Alpha/2;
461  node_pt->x(1) = node_pt->x(1) * Length;
462  node_pt->x(2) = node_pt->x(2) * Height/2;
463  }
464 
465 // Update also the origin of the spines
466  unsigned long nspines = this->nspine();
467  for(unsigned long i = 0; i<nspines;i++)
468  {
469  Spine* spine_pt = this->spine_pt(i);
470  double x_spine = spine_pt->geom_parameter(0);
471  double y_spine = spine_pt->geom_parameter(1);
472  double z_spine = spine_pt->geom_parameter(2);
473  spine_pt->geom_parameter(0) = x_spine *Alpha/2.0;
474  spine_pt->geom_parameter(1) = y_spine * Length;
475  spine_pt->geom_parameter(2) = z_spine * Height/2.0;
476  }
477 
478 
479  Zsim = Zsim * Height/2.0;
480 
481 // Update the spines heigth according to the new geometry
482  ncount = this->nboundary_node(5);
483 
484  for(int i = 0; i< ncount; i++)
485  {
486  SpineNode* spine_node_pt = dynamic_cast<SpineNode*>(this->boundary_node_pt(5,i));
487  Spine* spine_pt = spine_node_pt->spine_pt();
488  double x_spine = spine_pt->geom_parameter(0);
489  double z_spine = spine_pt->geom_parameter(2);
490 
491  double dorg = sqrt( (spine_node_pt->x(0) - x_spine)*(spine_node_pt->x(0) - x_spine)+
492  (spine_node_pt->x(2) - z_spine)*(spine_node_pt->x(2) - z_spine) );
493  spine_node_pt->h() = dorg;
494 
495  }
496 
497  //Get the position of the node at the origin
498 // SpineNode* origin_pt = dynamic_cast<SpineNode*>(spine_node_pt->spine_pt()->geom_data_pt(0));
499 
500 
501 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
Scalar * b
Definition: benchVecAdd.cpp:17
unsigned long nbulk() const
Number of elements in bulk.
Definition: comb_can_spine_mesh.h:89
void add_side_spinemesh(unsigned int bound1, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *addmesh_pt, int *addmesh_map_boundary, int total_boundaries, unsigned flag)
Definition: comb_can_spine_mesh.h:514
unsigned long ninterface_element() const
Number of elements on interface.
Definition: comb_can_spine_mesh.h:92
void add_line_interface_elements(MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT > *add_mesh_pt)
Definition: comb_can_spine_mesh.h:216
int Face_index_outlet
Definition: comb_can_spine_mesh.h:155
void add_outlet_bulk_elements(SimpleCubicMesh< ELEMENT > *add_mesh_pt)
Definition: comb_can_spine_mesh.h:198
void rotate_90(SpineMesh *rot_mesh_pt)
Definition: comb_can_spine_mesh.h:171
double Xsim
Axis of Symmetry.
Definition: comb_can_spine_mesh.h:151
double Zsim
Definition: comb_can_spine_mesh.h:152
Definition: canyon_spine_mesh.h:48
void flush_spine_element_and_node_storage()
Definition: canyon_spine_mesh.h:171
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
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
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(), MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::bulk_element_pt(), oomph::Mesh::element_pt(), oomph::PressureAdvectionDiffusionValidation::Flag, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage(), oomph::Spine::geom_parameter(), oomph::SpineNode::h(), GlobalParameters::Height, i, MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt(), Global_Physical_Variables::Length, oomph::Mesh::nboundary(), oomph::Mesh::nboundary_node(), MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::nbulk(), oomph::Mesh::nelement(), MyCanyonMesh< ELEMENT, INTERFACE_ELEMENT >::ninterface_element(), oomph::Mesh::nnode(), oomph::SpineMesh::node_pt(), 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 CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::CombCanSpineMesh().

◆ bulk_element_pt()

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

Access functions for pointers to elements in bulk.

72  {return Bulk_element_pt[i];}

References i.

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

◆ bulk_outlet_element_pt()

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

◆ face_index_outlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
int CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::face_index_outlet ( )
inline

◆ flush_spine_element_and_node_storage()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::flush_spine_element_and_node_storage ( )
inline
101  {
102  //Clear vectors of pointers to the nodes and elements
103  Node_pt.clear();
104  Bulk_element_pt.clear();
105  Interface_element_pt.clear();
106  Element_pt.clear();
107  Spine_pt.clear();
108  }
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* & CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::interface_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to interface elements.

68  {return Interface_element_pt[i];}

References i.

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

◆ interface_line_element_pt()

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

◆ nbulk()

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

Number of elements in bulk.

89 {return Bulk_element_pt.size();}

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

◆ nbulkoutlet()

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned long CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::nbulkoutlet ( ) const
inline

◆ ninterface_element()

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

Number of elements on interface.

92 {return Interface_element_pt.size();}

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

◆ ninterfaceline()

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

◆ rotate_90()

template<class ELEMENT , class INTERFACE_ELEMENT >
void CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::rotate_90 ( SpineMesh rot_mesh_pt)
inlineprotected
172  {
173  unsigned long nnode = rot_mesh_pt->nnode();
174  for(unsigned long i = 0; i<nnode;i++)
175  {
176  Node* node_pt = rot_mesh_pt->node_pt(i);
177  double x_node = node_pt->x(0);
178  double z_node = node_pt->x(2);
179  node_pt->x(0) = 1.0 - z_node;
180  node_pt->x(2) = 1.0 + x_node;
181  }
182 // We rotate as well the geometric parameters which were originally set as the coordinate of the node at the origin of the spine
183  unsigned long nspines = rot_mesh_pt->nspine();
184  for(unsigned long i = 0; i<nspines;i++)
185  {
186  Spine* spine_pt = rot_mesh_pt->spine_pt(i);
187  double x_spine = spine_pt->geom_parameter(0);
188  double z_spine = spine_pt->geom_parameter(2);
189  spine_pt->geom_parameter(0) = 1.0 - z_spine;
190  spine_pt->geom_parameter(2) = 1.0 + x_spine;
191  }
192 
193  //we update again the nodes
194  rot_mesh_pt->node_update();
195  }
void node_update(const bool &update_all_solid_nodes=false)
Definition: spines.cc:84

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 CombCanSpineMesh< 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.

112  {
113  //Get fraction along the spine
114  double W = spine_node_pt->fraction();
115  //Get spine height
116  double H = spine_node_pt->h();
117 
118  //Get the position of the node at the origin
119  Vector<double> origin_pt(3);
120  origin_pt[0] = spine_node_pt->spine_pt()->geom_parameter(0);
121  origin_pt[2] = spine_node_pt->spine_pt()->geom_parameter(2);
122 
123  //set scale norm vector
124  double norm =
125  sqrt( (Xsim - origin_pt[0] ) * (Xsim - origin_pt[0] ) +
126  (Zsim - origin_pt[2] ) * (Zsim - origin_pt[2]) );
127 
128  //Set th x coordinate
129  spine_node_pt->x(0) = origin_pt[0] + H*W* (Xsim - origin_pt[0] )/norm;
130 
131  //Set the value of z
132  spine_node_pt->x(2) = origin_pt[2] + H*W* (Zsim - origin_pt[2] )/norm;
133 
134  }
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 CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Alpha
protected

Aspect ratio, length, height and radius.

◆ Bulk_element_pt

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

Vector of pointers to element in the fluid layer.

◆ Bulk_outlet_element_pt

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

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

◆ Face_index_outlet

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

◆ Flag

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Flag
protected

◆ Height

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

◆ Interface_element_pt

template<class ELEMENT , class INTERFACE_ELEMENT >
Vector<FiniteElement *> CombCanSpineMesh< 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 *> CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Interface_line_element_pt
protected

◆ Length

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

◆ Nel_xz

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Nel_xz
protected

◆ Nel_y

template<class ELEMENT , class INTERFACE_ELEMENT >
unsigned int CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::Nel_y
protected

◆ Radius

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

◆ Xsim

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

Axis of Symmetry.

◆ Zsim

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

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