CylinderMesh< ELEMENT > Class Template Reference
+ Inheritance diagram for CylinderMesh< ELEMENT >:

Public Member Functions

 CylinderMesh (const unsigned &nx1, const unsigned &nx2, const unsigned &ny1, const unsigned &ny2, const double &radius)
 
double x_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
double y_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
 CylinderMesh (const unsigned &nx1, const unsigned &nx2, const unsigned &ny1, const unsigned &ny2, const double &lx)
 
double x_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
double y_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
void assign_centreline_nodes ()
 
Nodecentreline_node_pt (const unsigned &i) const
 
double rescale_length (const double &length)
 
 CylinderMesh (const unsigned &nx1, const unsigned &nx2, const unsigned &ny1, const unsigned &ny2, const double &lx)
 
double x_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
double y_spacing_function (unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
 
void assign_centreline_nodes ()
 
Nodecentreline_node_pt (const unsigned &i) const
 
double rescale_length (const double &length)
 
- Public Member Functions inherited from oomph::RectangularQuadMesh< ELEMENT >
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
const unsignednx () const
 Return number of elements in x direction. More...
 
const unsignedny () const
 Return number of elements in y direction. More...
 
const double x_min () const
 Return the minimum value of x coordinate. More...
 
const double x_max () const
 Return the maximum value of x coordinate. More...
 
const double y_min () const
 Return the minimum value of y coordinate. More...
 
const double y_max () const
 Return the maximum value of y coordinate. More...
 
virtual void element_reorder ()
 
- Public Member Functions inherited from oomph::QuadMeshBase
 QuadMeshBase ()
 Constructor (empty) More...
 
 QuadMeshBase (const QuadMeshBase &node)=delete
 Broken copy constructor. More...
 
void operator= (const QuadMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~QuadMeshBase ()
 Destructor (empty) More...
 
void setup_boundary_element_info ()
 
void setup_boundary_element_info (std::ostream &outfile)
 
- 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 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 node_update (const bool &update_all_solid_nodes=false)
 
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...
 
virtual void read (std::ifstream &restart_file)
 Read solution from restart file. 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)
 
virtual void set_mesh_level_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...
 

Private Attributes

unsigned Nx1
 
unsigned Nx2
 
unsigned Ny1
 
unsigned Ny2
 
double Xfraction
 
double Yfraction
 
Vector< Node * > Centreline_node_pt
 

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...
 
- Protected Member Functions inherited from oomph::RectangularQuadMesh< ELEMENT >
void build_mesh (TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Generic mesh construction function: contains all the hard work. More...
 
 RectangularQuadMesh (const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, const bool &build, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
- 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 inherited from oomph::RectangularQuadMesh< ELEMENT >
unsigned Nx
 Nx: number of elements in x-direction. More...
 
unsigned Ny
 Ny: number of elements in y-direction. More...
 
unsigned Np
 Np: number of (linear) points in the element. More...
 
double Xmin
 Minimum value of x coordinate. More...
 
double Xmax
 Maximum value of x coordinate. More...
 
double Ymin
 Minimum value of y coordinate. More...
 
double Ymax
 Maximum value of y coordinate. More...
 
bool Xperiodic
 
- 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
 

Detailed Description

template<class ELEMENT>
class CylinderMesh< ELEMENT >

A Class for the mesh to be used in the rotating Disc equations The mesh is a modification of the standard RectangularQuadMesh. We define x to be the radial (r) coordinate and y to be the axial (z) coordinate in the axisymmetric coordinate system. The mesh consists of upper and lower regions and left and right regions, with uniform element spacing in each region. The idea is that one might want more closely-spaced elements near the downstream end of the domain and different numbers of elements in the upper and lower regions, to prevent there being any inherent symmetry in the mesh

Constructor & Destructor Documentation

◆ CylinderMesh() [1/3]

template<class ELEMENT >
CylinderMesh< ELEMENT >::CylinderMesh ( const unsigned nx1,
const unsigned nx2,
const unsigned ny1,
const unsigned ny2,
const double radius 
)
inline

Constructor, which "builds" the mesh. The arguments are the number of elements in each zone, the radius of the disc

72  :
73  //Call a protected constructor of the rectangular quad mesh
74  //that sets internal variables, but does not actually build the
75  //mesh. The arguments are the total number of elements in the x
76  //and y directions, xmin, xman, ymin, ymax, periodic_flag and
77  //the build flag
78  RectangularQuadMesh<ELEMENT>(nx1+nx2,ny1+ny2,0.0,radius,-1.0,1.0,
79  false,false)
80  {
81  //Set private mesh variables, number of elements in each section
82  Nx1 = nx1; Nx2 = nx2; Ny1 = ny1; Ny2 = ny2;
83 
84  //Set the fraction, at which the left and right regions are split
85  Xfraction=0.8;
86 
87  //Set the fraction at which the upper and lower regions are split
88  Yfraction=0.5;
89 
90  //Call the generic mesh construction routine
91  //(Defined in RectangularQuadMesh<ELEMENT>)
92  this->build_mesh();
93 
94  //Now reorder the elements in the best form for the frontal solver
95  //This arranges in elements in vertical slices starting from x=0 and moving
96  //along the channel to x=radius
97  this->element_reorder();
98  }
unsigned Nx2
Definition: rotating_ends.cc:61
unsigned Nx1
Definition: rotating_ends.cc:61
unsigned Ny1
Definition: rotating_ends.cc:61
unsigned Ny2
Definition: rotating_ends.cc:61
double Xfraction
Definition: rotating_ends.cc:65
double Yfraction
Definition: rotating_ends.cc:65
Definition: rectangular_quadmesh.template.h:59
virtual void element_reorder()
Definition: rectangular_quadmesh.template.cc:834
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh construction function: contains all the hard work.
Definition: rectangular_quadmesh.template.cc:43
radius
Definition: UniformPSDSelfTest.py:15

◆ CylinderMesh() [2/3]

template<class ELEMENT >
CylinderMesh< ELEMENT >::CylinderMesh ( const unsigned nx1,
const unsigned nx2,
const unsigned ny1,
const unsigned ny2,
const double lx 
)
inline
87  :
88  RectangularQuadMesh<ELEMENT>(nx1+nx2,ny1+ny2,
89  0.0,lx,0.0,1.0,false,false)
90  {
91  //Set mesh variables, number of elements in each section
92  Nx1 = nx1; Nx2 = nx2; Ny1 = ny1; Ny2 = ny2;
93 
94  //Minimum and maximum values of x and fraction of length
95  Xfraction=0.5;
96  //RectangularQuadMesh<ELEMENT>::Ymax = 1.0;
97  Yfraction=0.5;
98 
99  //Call the generic mesh construction routine
100  //(Defined in RectangularQuadMesh<ELEMENT>
101  this->build_mesh();
102 
103  //Set up the Vector Centreline_node_pt containing the nodes on the
104  //channel centreline. Note that this must be called before the
105  //elements are reordered because it relies on the element being in
106  //the order defined in build_mesh()
108 
109  //Now reorder the elements in the best form for the frontal solver
110  //This arranges in elements in vertical slices starting from x=0 and moving
111  //along the channel to x=lx
113  }
void assign_centreline_nodes()
Definition: bifurcation_tracking/track_pitch.cc:177
const double lx
Definition: ConstraintElementsUnitTest.cpp:33

◆ CylinderMesh() [3/3]

template<class ELEMENT >
CylinderMesh< ELEMENT >::CylinderMesh ( const unsigned nx1,
const unsigned nx2,
const unsigned ny1,
const unsigned ny2,
const double lx 
)
inline
94  :
95  RectangularQuadMesh<ELEMENT>(nx1+nx2,ny1+ny2,
96  0.0,lx,0.0,1.0,false,false)
97  {
98  //Set mesh variables, number of elements in each section
99  Nx1 = nx1; Nx2 = nx2; Ny1 = ny1; Ny2 = ny2;
100 
101  //Minimum and maximum values of x and fraction of length
102  Xfraction=0.5;
103  //RectangularQuadMesh<ELEMENT>::Ymax = 1.0;
104  Yfraction=0.5;
105 
106  //Call the generic mesh construction routine
107  //(Defined in RectangularQuadMesh<ELEMENT>
108  this->build_mesh();
109 
110  //Set up the Vector Centreline_node_pt containing the nodes on the
111  //channel centreline. Note that this must be called before the
112  //elements are reordered because it relies on the element being in
113  //the order defined in build_mesh()
115 
116  //Now reorder the elements in the best form for the frontal solver
117  //This arranges in elements in vertical slices starting from x=0 and moving
118  //along the channel to x=lx
120  }

Member Function Documentation

◆ assign_centreline_nodes() [1/2]

template<class ELEMENT >
void CylinderMesh< ELEMENT >::assign_centreline_nodes ( )
inline
178  {
179  //Find the number of nodes in each element
180  unsigned Nnode=this->finite_element_pt(0)->nnode_1d();
182  //Loop over all elements on the centreline
183  for(unsigned e=0;e<Nx;e++)
184  {
185  //Loop over all but the last node on each
186  for(unsigned l=0;l<(Nnode-1);l++)
187  {
188  //Add each node to the centreline Vector
190  push_back(this->finite_element_pt(Ny1*Nx+e)->node_pt(l));
191  }
192  }
193  //Add the final node to the centreline Vector
194  Centreline_node_pt.push_back(this->finite_element_pt(Ny1*Nx + Nx-1)
195  ->node_pt(Nnode-1));
196  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector< Node * > Centreline_node_pt
Definition: bifurcation_tracking/track_pitch.cc:76
virtual unsigned nnode_1d() const
Definition: elements.h:2218
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
unsigned Nx
Nx: number of elements in x-direction.
Definition: rectangular_quadmesh.template.h:63

References e(), and GlobalParameters::Nx.

◆ assign_centreline_nodes() [2/2]

template<class ELEMENT >
void CylinderMesh< ELEMENT >::assign_centreline_nodes ( )
inline
185  {
186  //Find the number of nodes in each element
187  unsigned Nnode=this->finite_element_pt(0)->nnode_1d();
189  //Loop over all elements on the centreline
190  for(unsigned e=0;e<Nx;e++)
191  {
192  //Loop over all but the last node on each
193  for(unsigned l=0;l<(Nnode-1);l++)
194  {
195  //Add each node to the centreline Vector
197  push_back(this->finite_element_pt(Ny1*Nx+e)->node_pt(l));
198  }
199  }
200  //Add the final node to the centreline Vector
201  Centreline_node_pt.push_back(this->finite_element_pt(Ny1*Nx + Nx-1)
202  ->node_pt(Nnode-1));
203  }

References e(), and GlobalParameters::Nx.

◆ centreline_node_pt() [1/2]

template<class ELEMENT >
Node* CylinderMesh< ELEMENT >::centreline_node_pt ( const unsigned i) const
inline
200  {return Centreline_node_pt[i];}
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i.

◆ centreline_node_pt() [2/2]

template<class ELEMENT >
Node* CylinderMesh< ELEMENT >::centreline_node_pt ( const unsigned i) const
inline
207  {return Centreline_node_pt[i];}

References i.

◆ rescale_length() [1/2]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::rescale_length ( const double length)
inline
204  {
205  //Save the present length
206  double old_length = this->Xmax;
207  //Set the new length
208  this->Xmax = length;
209  //Find the ratio
210  double ratio = length/old_length;
211 
212  //Loop over all nodes and scale x position by ratio
213  unsigned long n_node = this->nnode();
214  for(unsigned n=0;n<n_node;n++) {this->Node_pt[n]->x(0) *= ratio;}
215  return ratio;
216  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:183
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
double Xmax
Maximum value of x coordinate.
Definition: rectangular_quadmesh.template.h:72

References n.

◆ rescale_length() [2/2]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::rescale_length ( const double length)
inline
211  {
212  //Save the present length
213  double old_length = this->Xmax;
214  //Set the new length
215  this->Xmax = length;
216  //Find the ratio
217  double ratio = length/old_length;
218 
219  //Loop over all nodes and scale x position by ratio
220  unsigned long n_node = this->nnode();
221  for(unsigned n=0;n<n_node;n++) {this->Node_pt[n]->x(0) *= ratio;}
222  return ratio;
223  }

References n.

◆ x_spacing_function() [1/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::x_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Define the spacing of the nodes in the r (radial) direction In this mesh, there are two different regions with uniform spacing in each. Note that this can easily be changed to generate non-uniform meshes if desired

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

107  {
108  //Find the minimum and maximum values of the X (radial) coordinate
109  double x_min = this->Xmin;
110  double x_max = this->Xmax;
111  //Find the number of nodes in the element in the radial direction
112  unsigned np = this->Np;
113  //Set up some spacing parameters
114  //Region one starts at Xmin
115  //Region two starts at Xmin + Xfraction(Xmax-Xmin)
116  double x1init = x_min, x2init = x_min + Xfraction*(x_max-x_min);
117  //Calculate the spacing between the nodes in each region
118  //Assuming uniform spacing
119  //Region one has a length Xfraction*(Xmax-Xmin)
120  double x1step = Xfraction*(x_max-x_min)/((np-1)*Nx1);
121  //Region two has a length (1.0-Xfraction)*(Xmax-Xmin)
122  double x2step = (1.0-Xfraction)*(x_max-x_min)/((np-1)*Nx2);
123 
124  //Now set up the particular spacing
125  //(it's different in the two different regions)
126  if(xelement < Nx1) {return (x1init + x1step*((np-1)*xelement + xnode));}
127  else {return (x2init + x2step*((np-1)*(xelement-Nx1) + xnode));}
128  }
const double x_max() const
Return the maximum value of x coordinate.
Definition: rectangular_quadmesh.template.h:245
unsigned Np
Np: number of (linear) points in the element.
Definition: rectangular_quadmesh.template.h:67
const double x_min() const
Return the minimum value of x coordinate.
Definition: rectangular_quadmesh.template.h:238
double Xmin
Minimum value of x coordinate.
Definition: rectangular_quadmesh.template.h:70

◆ x_spacing_function() [2/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::x_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Return the value of the x-coordinate at the node given by the local node number (xnode, ynode) in the element (xelement,yelement). The description is in a "psudeo" two-dimensional coordinate system, so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and that of xnode and ynode is [0,Np-1]. The default is to return nodes that are equally spaced in the x coodinate.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

123  {
127  //Set up some spacing parameters
128  //Region one starts at Xmin
129  //Region two starts at Xmin + Xfraction(Xmax-Xmin)
130  double x1init = Xmin, x2init = Xmin + Xfraction*(Xmax-Xmin);
131  //Calculate the spacing between the nodes in each region
132  //Assuming uniform spacing
133  //Region one has a length Xfraction*(Xmax-Xmin)
134  double x1step = Xfraction*(Xmax-Xmin)/((Np-1)*Nx1);
135  //Region two has a length (1.0-Xfraction)*(Xmax-Xmin)
136  double x2step = (1.0-Xfraction)*(Xmax-Xmin)/((Np-1)*Nx2);
137 
138  //Now set up the particular spacing
139  //(it's different in the two different regions)
140  if(xelement < Nx1) {return (x1init + x1step*((Np-1)*xelement + xnode));}
141  else {return (x2init + x2step*((Np-1)*(xelement-Nx1) + xnode));}
142  }

◆ x_spacing_function() [3/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::x_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Return the value of the x-coordinate at the node given by the local node number (xnode, ynode) in the element (xelement,yelement). The description is in a "psudeo" two-dimensional coordinate system, so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and that of xnode and ynode is [0,Np-1]. The default is to return nodes that are equally spaced in the x coodinate.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

130  {
134  //Set up some spacing parameters
135  //Region one starts at Xmin
136  //Region two starts at Xmin + Xfraction(Xmax-Xmin)
137  double x1init = Xmin, x2init = Xmin + Xfraction*(Xmax-Xmin);
138  //Calculate the spacing between the nodes in each region
139  //Assuming uniform spacing
140  //Region one has a length Xfraction*(Xmax-Xmin)
141  double x1step = Xfraction*(Xmax-Xmin)/((Np-1)*Nx1);
142  //Region two has a length (1.0-Xfraction)*(Xmax-Xmin)
143  double x2step = (1.0-Xfraction)*(Xmax-Xmin)/((Np-1)*Nx2);
144 
145  //Now set up the particular spacing
146  //(it's different in the two different regions)
147  if(xelement < Nx1) {return (x1init + x1step*((Np-1)*xelement + xnode));}
148  else {return (x2init + x2step*((Np-1)*(xelement-Nx1) + xnode));}
149  }

◆ y_spacing_function() [1/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::y_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Defines the spacing of the nodes in the z (axial) direction.In this mesh there are two different regions with uniform spacing in each Note that this can easily be changed to generate non-uniform meshes if desired. This may be desirable if sharp boundary, or shear layers, develop.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

138  {
139  //Find the minimum and maximum values of the Y (axial) coordinate
140  double y_min = this->Ymin;
141  double y_max = this->Ymax;
142  //Read out the number of nodes in the y direction
143  unsigned np = this->Np;
144 
145  //Set up some spacing parameters
146  //The lower region starts at Ymin
147  //The upper region starts at Ymin + Yfraction*(Ymax-Ymin)
148  double y1init = y_min, y2init = y_min + Yfraction*(y_max-y_min);
149  //Calculate the space between each node in each region,
150  //Assumming uniform spacing
151  //Region one has a length Yfraction(Ymax-Ymin)
152  double y1step = Yfraction*(y_max-y_min)/((np-1)*Ny1);
153  //Region two has a length (1.0-Yfraction)*(Ymax-Ymin)
154  double y2step = (1.0-Yfraction)*(y_max-y_min)/((np-1)*Ny2);
155 
156  //Now return the actual node position, it's different in the two
157  //regions, of course
158  if(yelement < Ny1) {return (y1init + y1step*((np-1)*yelement + ynode));}
159  else {return (y2init + y2step*((np-1)*(yelement-Ny1) + ynode));}
160  }
const double y_min() const
Return the minimum value of y coordinate.
Definition: rectangular_quadmesh.template.h:252
const double y_max() const
Return the maximum value of y coordinate.
Definition: rectangular_quadmesh.template.h:259
double Ymax
Maximum value of y coordinate.
Definition: rectangular_quadmesh.template.h:77
double Ymin
Minimum value of y coordinate.
Definition: rectangular_quadmesh.template.h:75

◆ y_spacing_function() [2/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::y_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Return the value of the y-coordinate at the node given by the local node number (xnode, ynode) in the element (xelement,yelement). The description is in a "psudeo" two-dimensional coordinate system, so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and that of xnode and ynode is [0,Np-1]. The default it to return nodes that are equally spaced in the y coordinate.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

153  {
157 
158  //Set up some spacing parameters
159  //The lower region starts at Ymin
160  //The upper region starts at Ymin + Yfraction*(Ymax-Ymin)
161  double y1init = Ymin, y2init = Ymin + Yfraction*(Ymax-Ymin);
162  //Calculate the space between each node in each region,
163  //Assumming uniform spacing
164  //Region one has a length Yfraction(Ymax-Ymin)
165  double y1step = Yfraction*(Ymax-Ymin)/((Np-1)*Ny1);
166  //Region two has a length (1.0-Yfraction)*(Ymax-Ymin)
167  double y2step = (1.0-Yfraction)*(Ymax-Ymin)/((Np-1)*Ny2);
168 
169  //Now return the actual node position, it's different in the two
170  //regions, of course
171  if(yelement < Ny1) {return (y1init + y1step*((Np-1)*yelement + ynode));}
172  else {return (y2init + y2step*((Np-1)*(yelement-Ny1) + ynode));}
173  }

◆ y_spacing_function() [3/3]

template<class ELEMENT >
double CylinderMesh< ELEMENT >::y_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
inlinevirtual

Return the value of the y-coordinate at the node given by the local node number (xnode, ynode) in the element (xelement,yelement). The description is in a "psudeo" two-dimensional coordinate system, so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and that of xnode and ynode is [0,Np-1]. The default it to return nodes that are equally spaced in the y coordinate.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

160  {
164 
165  //Set up some spacing parameters
166  //The lower region starts at Ymin
167  //The upper region starts at Ymin + Yfraction*(Ymax-Ymin)
168  double y1init = Ymin, y2init = Ymin + Yfraction*(Ymax-Ymin);
169  //Calculate the space between each node in each region,
170  //Assumming uniform spacing
171  //Region one has a length Yfraction(Ymax-Ymin)
172  double y1step = Yfraction*(Ymax-Ymin)/((Np-1)*Ny1);
173  //Region two has a length (1.0-Yfraction)*(Ymax-Ymin)
174  double y2step = (1.0-Yfraction)*(Ymax-Ymin)/((Np-1)*Ny2);
175 
176  //Now return the actual node position, it's different in the two
177  //regions, of course
178  if(yelement < Ny1) {return (y1init + y1step*((Np-1)*yelement + ynode));}
179  else {return (y2init + y2step*((Np-1)*(yelement-Ny1) + ynode));}
180  }

Member Data Documentation

◆ Centreline_node_pt

template<class ELEMENT >
Vector< Node * > CylinderMesh< ELEMENT >::Centreline_node_pt
private

◆ Nx1

template<class ELEMENT >
unsigned CylinderMesh< ELEMENT >::Nx1
private

◆ Nx2

template<class ELEMENT >
unsigned CylinderMesh< ELEMENT >::Nx2
private

◆ Ny1

template<class ELEMENT >
unsigned CylinderMesh< ELEMENT >::Ny1
private

◆ Ny2

template<class ELEMENT >
unsigned CylinderMesh< ELEMENT >::Ny2
private

◆ Xfraction

template<class ELEMENT >
double CylinderMesh< ELEMENT >::Xfraction
private

◆ Yfraction

template<class ELEMENT >
double CylinderMesh< ELEMENT >::Yfraction
private

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