oomph::TwoLayerSpineMesh< ELEMENT > Class Template Reference

#include <two_layer_spine_mesh.template.h>

+ Inheritance diagram for oomph::TwoLayerSpineMesh< ELEMENT >:

Public Member Functions

 TwoLayerSpineMesh (const unsigned &nx, const unsigned &ny1, const unsigned &ny2, const double &lx, const double &h1, const double &h2, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 TwoLayerSpineMesh (const unsigned &nx, const unsigned &ny1, const unsigned &ny2, const double &lx, const double &h1, const double &h2, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 TwoLayerSpineMesh (const unsigned &nx, const unsigned &ny1, const unsigned &ny2, const double &lx, const double &h1, const double &h2, const bool &periodic_in_x, const bool &build_mesh, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
FiniteElement *& upper_layer_element_pt (const unsigned long &i)
 Access functions for pointers to elements in upper layer. More...
 
FiniteElement *& lower_layer_element_pt (const unsigned long &i)
 Access functions for pointers to elements in bottom layer. More...
 
unsigned long nupper () const
 Number of elements in upper layer. More...
 
unsigned long nlower () const
 Number of elements in top layer. More...
 
FiniteElement *& interface_upper_boundary_element_pt (const unsigned long &i)
 Access functions for pointers to elements in upper layer. More...
 
FiniteElement *& interface_lower_boundary_element_pt (const unsigned long &i)
 Access functions for pointers to elements in bottom layer. More...
 
unsigned long ninterface_upper () const
 Number of elements in upper layer. More...
 
unsigned long ninterface_lower () const
 Number of elements in top layer. More...
 
int interface_upper_face_index_at_boundary (const unsigned &e)
 
int interface_lower_face_index_at_boundary (const unsigned &e)
 
void spine_node_update (SpineNode *spine_node_pt)
 
- 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 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...
 
- 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...
 

Protected Member Functions

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 spine_node_update_lower (SpineNode *spine_node_pt)
 Update function for the lower part of the domain. More...
 
void spine_node_update_upper (SpineNode *spine_node_pt)
 Update function for the upper part of the domain. More...
 
virtual void build_two_layer_mesh (TimeStepper *time_stepper_pt)
 
- 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

unsigned Ny1
 Number of elements in lower layer. More...
 
unsigned Ny2
 Number of elements in upper layer. More...
 
double H1
 Height of the lower layer. More...
 
double H2
 Height of the upper layer. More...
 
Vector< FiniteElement * > Lower_layer_element_pt
 Vector of pointers to element in the upper layer. More...
 
Vector< FiniteElement * > Upper_layer_element_pt
 Vector of pointers to element in the lower layer. More...
 
Vector< FiniteElement * > Interface_lower_boundary_element_pt
 
Vector< FiniteElement * > Interface_upper_boundary_element_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
 
- Protected Attributes inherited from oomph::SpineMesh
Vector< Spine * > Spine_pt
 A Spine mesh contains a Vector of pointers to spines. More...
 

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 oomph::TwoLayerSpineMesh< ELEMENT >

Two-layer spine mesh class derived from standard 2D mesh. The mesh contains two layers of spinified fluid elements (of type ELEMENT; e.g SpineElement<QCrouzeixRaviartElement<2>).

This mesh paritions the elements into those above and below a notional interface and relabels boundaries so that the mesh is as follows

3

| | 4 | | 2

| 6 |

| | 5 | | 1

| |

0 Update information for the nodes in response to changes in spine length is given, but additional equations must be specified in order to completely specify the problem.

Constructor & Destructor Documentation

◆ TwoLayerSpineMesh() [1/3]

template<class ELEMENT >
oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh ( const unsigned nx,
const unsigned ny1,
const unsigned ny2,
const double lx,
const double h1,
const double h2,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers and pointer to timestepper (defaults to Steady timestepper)

Constuctor for spine 2D mesh: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers, and pointer to timestepper (defaults to Static timestepper).

The mesh contains two layers of elements (of type ELEMENT; e.g SpineElement<QCrouzeixRaviartElement<2>) and an interfacial layer of corresponding Spine interface elements of type INTERFACE_ELEMENT, e.g. SpineLineFluidInterfaceElement<ELEMENT> for 2D planar problems.

56  : RectangularQuadMesh<ELEMENT>(
57  nx, ny1 + ny2, 0.0, lx, 0.0, h1 + h2, false, false, time_stepper_pt)
58  {
59  // Mesh can only be built with 2D Qelements.
60  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
61 
62  // Mesh can only be built with spine elements
63  MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
64 
65  // We've called the "generic" constructor for the RectangularQuadMesh
66  // which doesn't do much...
67  // Now set up the parameters that characterise the mesh geometry
68  // then call the build function
69 
70  // Number of elements in bottom and top layers
71  Ny1 = ny1;
72  Ny2 = ny2;
73 
74  // Set height of upper and lower layers
75  H1 = h1;
76  H2 = h2;
77 
78  // Now build the mesh:
79  build_two_layer_mesh(time_stepper_pt);
80  }
const unsigned & nx() const
Return number of elements in x direction.
Definition: rectangular_quadmesh.template.h:224
double H2
Height of the upper layer.
Definition: two_layer_spine_mesh.template.h:210
unsigned Ny2
Number of elements in upper layer.
Definition: two_layer_spine_mesh.template.h:204
unsigned Ny1
Number of elements in lower layer.
Definition: two_layer_spine_mesh.template.h:201
double H1
Height of the lower layer.
Definition: two_layer_spine_mesh.template.h:207
virtual void build_two_layer_mesh(TimeStepper *time_stepper_pt)
Definition: two_layer_spine_mesh.template.cc:267
const double lx
Definition: ConstraintElementsUnitTest.cpp:33

◆ TwoLayerSpineMesh() [2/3]

template<class ELEMENT >
oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh ( const unsigned nx,
const unsigned ny1,
const unsigned ny2,
const double lx,
const double h1,
const double h2,
const bool periodic_in_x,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers, a boolean flag to make the mesh periodic in the x-direction, and pointer to timestepper (defaults to Steady timestepper)

Constuctor for spine 2D mesh: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers, a boolean flag to make the mesh periodic in the x-direction, and pointer to timestepper (defaults to Static timestepper).

The mesh contains two layers of elements (of type ELEMENT; e.g SpineElement<QCrouzeixRaviartElement<2>) and an interfacial layer of corresponding Spine interface elements of type INTERFACE_ELEMENT, e.g. SpineLineFluidInterfaceElement<ELEMENT> for 2D planar problems.

106  : RectangularQuadMesh<ELEMENT>(nx,
107  ny1 + ny2,
108  0.0,
109  lx,
110  0.0,
111  h1 + h2,
112  periodic_in_x,
113  false,
114  time_stepper_pt)
115  {
116  // Mesh can only be built with 2D Qelements.
117  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
118 
119  // Mesh can only be built with spine elements
120  MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
121 
122  // We've called the "generic" constructor for the RectangularQuadMesh
123  // which doesn't do much...
124  // Now set up the parameters that characterise the mesh geometry
125  // then call the constructor
126 
127  // Number of elements in bottom and top layers
128  Ny1 = ny1;
129  Ny2 = ny2;
130 
131  // Set height of upper and lower layers
132  H1 = h1;
133  H2 = h2;
134 
135  // Now build the mesh:
136  build_two_layer_mesh(time_stepper_pt);
137  }

◆ TwoLayerSpineMesh() [3/3]

template<class ELEMENT >
oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh ( const unsigned nx,
const unsigned ny1,
const unsigned ny2,
const double lx,
const double h1,
const double h2,
const bool periodic_in_x,
const bool build_mesh,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers, a boolean flag to make the mesh periodic in the x-direction, a boolean flag to specify whether or not to call the "build_two_layer_mesh" function, and pointer to timestepper (defaults to Steady timestepper)

Constuctor for spine 2D mesh: Pass number of elements in x-direction, number of elements in y-direction in bottom and top layer, respectively, axial length and height of top and bottom layers, a boolean flag to make the mesh periodic in the x-direction, a boolean flag to specify whether or not to call the "build_two_layer_mesh" function, and pointer to timestepper (defaults to Static timestepper).

The mesh contains two layers of elements (of type ELEMENT; e.g SpineElement<QCrouzeixRaviartElement<2>) and an interfacial layer of corresponding Spine interface elements of type INTERFACE_ELEMENT, e.g. SpineLineFluidInterfaceElement<ELEMENT> for 2D planar problems.

165  : RectangularQuadMesh<ELEMENT>(nx,
166  ny1 + ny2,
167  0.0,
168  lx,
169  0.0,
170  h1 + h2,
171  periodic_in_x,
172  false,
173  time_stepper_pt)
174  {
175  // Mesh can only be built with 2D Qelements.
176  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
177 
178  // Mesh can only be built with spine elements
179  MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
180 
181  // We've called the "generic" constructor for the RectangularQuadMesh
182  // which doesn't do much...
183  // Now set up the parameters that characterise the mesh geometry
184  // then call the constructor
185 
186  // Number of elements in bottom and top layers
187  Ny1 = ny1;
188  Ny2 = ny2;
189 
190  // Set height of upper and lower layers
191  H1 = h1;
192  H2 = h2;
193 
194  // Only build the mesh here if build_mesh=true
195  // This is useful when calling this constructor from a derived class
196  // (such as Axisym2x6TwoLayerSpineMesh) where the mesh building
197  // needs to be called from *its* constructor and this constructor is
198  // only used to pass arguments to the RectangularQuadMesh constructor.
199  if (build_mesh)
200  {
201  build_two_layer_mesh(time_stepper_pt);
202  }
203  }
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

References oomph::RectangularQuadMesh< ELEMENT >::build_mesh(), oomph::TwoLayerSpineMesh< ELEMENT >::build_two_layer_mesh(), oomph::TwoLayerSpineMesh< ELEMENT >::H1, oomph::TwoLayerSpineMesh< ELEMENT >::H2, oomph::TwoLayerSpineMesh< ELEMENT >::Ny1, and oomph::TwoLayerSpineMesh< ELEMENT >::Ny2.

Member Function Documentation

◆ build_two_layer_mesh()

template<class ELEMENT >
void oomph::TwoLayerSpineMesh< ELEMENT >::build_two_layer_mesh ( TimeStepper time_stepper_pt)
protectedvirtual

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

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

269  {
270  // Build the underlying quad mesh:
272 
273  // Reset the number of boundaries
274  set_nboundary(7);
275 
276  // Set up the pointers to elements in the upper and lower fluid
277  // Calculate numbers of nodes in upper and lower regions
278  unsigned long n_lower = this->Nx * Ny1;
279  unsigned long n_upper = this->Nx * Ny2;
280  // Loop over lower elements and push back
281  Lower_layer_element_pt.reserve(n_lower);
282  for (unsigned e = 0; e < n_lower; e++)
283  {
284  Lower_layer_element_pt.push_back(this->finite_element_pt(e));
285  }
286  // Loop over upper elements and push back
287  Upper_layer_element_pt.reserve(n_upper);
288  for (unsigned e = n_lower; e < (n_lower + n_upper); e++)
289  {
290  Upper_layer_element_pt.push_back(this->finite_element_pt(e));
291  }
292 
293  // Set the elements adjacent to the interface
296  {
297  unsigned count_lower = this->Nx * (this->Ny1 - 1);
298  unsigned count_upper = count_lower + this->Nx;
299  for (unsigned e = 0; e < this->Nx; e++)
300  {
302  this->finite_element_pt(count_lower);
303  ++count_lower;
305  this->finite_element_pt(count_upper);
306  ++count_upper;
307  }
308  }
309 
310  // Relabel the boundary nodes
311  // Storage for the boundary coordinates that will be transferred directly
312  Vector<double> b_coord;
313  {
314  // Store the interface level
315  const double y_interface = H1 - this->Ymin;
316 
317  // Nodes on boundary 3 are now on boundaries 4 and 5
318  unsigned n_boundary_node = this->nboundary_node(3);
319  // Loop over the nodes remove them from boundary 3
320  // and add them to boundary 4 or 5 depending on their y coordinate
321  for (unsigned n = 0; n < n_boundary_node; n++)
322  {
323  // Cache pointer to the node
324  Node* const nod_pt = this->boundary_node_pt(3, n);
325  // Get the boundary coordinates if set
327  {
328  b_coord.resize(nod_pt->ncoordinates_on_boundary(3));
329  nod_pt->get_coordinates_on_boundary(3, b_coord);
330  // Indicate that the boundary coordinates are to be set on the
331  // new boundaries
332  this->Boundary_coordinate_exists[4] = true;
333  this->Boundary_coordinate_exists[5] = true;
334  }
335 
336  // Now remove the node from the boundary
337  nod_pt->remove_from_boundary(3);
338 
339  // Find the height of the node
340  double y = nod_pt->x(1);
341  // If it's above or equal to the interface, it's on boundary 4
342  if (y >= y_interface)
343  {
344  this->add_boundary_node(4, nod_pt);
345  // Add the boundary coordinate if it has been set up
346  if (this->Boundary_coordinate_exists[4])
347  {
348  nod_pt->set_coordinates_on_boundary(4, b_coord);
349  }
350  }
351  // otherwise it's on boundary 5
352  if (y <= y_interface)
353  {
354  this->add_boundary_node(5, nod_pt);
355  // Add the boundary coordinate if it has been set up
356  if (this->Boundary_coordinate_exists[5])
357  {
358  nod_pt->set_coordinates_on_boundary(5, b_coord);
359  }
360  }
361  }
362 
363  // Now clear the boundary node information from boundary 3
364  this->Boundary_node_pt[3].clear();
365 
366  // Relabel the nodes on boundary 2 to be on boundary 3
367  n_boundary_node = this->nboundary_node(2);
368  // Loop over the nodes remove them from boundary 2
369  // and add them to boundary 3
370  for (unsigned n = 0; n < n_boundary_node; n++)
371  {
372  // Cache pointer to the node
373  Node* const nod_pt = this->boundary_node_pt(2, n);
374  // Get the boundary coordinates if set
375  if (this->boundary_coordinate_exists(2))
376  {
377  b_coord.resize(nod_pt->ncoordinates_on_boundary(2));
378  nod_pt->get_coordinates_on_boundary(2, b_coord);
379  this->Boundary_coordinate_exists[3] = true;
380  }
381 
382  // Now remove the node from the boundary 2
383  nod_pt->remove_from_boundary(2);
384  // and add to boundary 3
385  this->add_boundary_node(3, nod_pt);
386  if (this->Boundary_coordinate_exists[3])
387  {
388  nod_pt->set_coordinates_on_boundary(3, b_coord);
389  }
390  }
391 
392  // Clear the information from boundary 2
393  this->Boundary_node_pt[2].clear();
394 
395  std::list<Node*> nodes_to_be_removed;
396 
397  // Nodes on boundary 1 are now on boundaries 1 and 2
398  n_boundary_node = this->nboundary_node(1);
399  // Loop over the nodes remove some of them from boundary 1
400  for (unsigned n = 0; n < n_boundary_node; n++)
401  {
402  // Cache pointer to the node
403  Node* const nod_pt = this->boundary_node_pt(1, n);
404 
405  // Find the height of the node
406  double y = nod_pt->x(1);
407  // If it's above or equal to the interface it's on boundary 2
408  if (y >= y_interface)
409  {
410  // Get the boundary coordinates if set
411  if (this->boundary_coordinate_exists(1))
412  {
413  b_coord.resize(nod_pt->ncoordinates_on_boundary(1));
414  nod_pt->get_coordinates_on_boundary(1, b_coord);
415  this->Boundary_coordinate_exists[2] = true;
416  }
417 
418  // Now remove the node from the boundary 1 if above interace
419  if (y > y_interface)
420  {
421  nodes_to_be_removed.push_back(nod_pt);
422  }
423  // Always add to boundary 2
424  this->add_boundary_node(2, nod_pt);
425  // Add the boundary coordinate if it has been set up
426  if (this->Boundary_coordinate_exists[2])
427  {
428  nod_pt->set_coordinates_on_boundary(2, b_coord);
429  }
430  }
431  }
432 
433  // Loop over the nodes that are to be removed from boundary 1 and remove
434  // them
435  for (std::list<Node*>::iterator it = nodes_to_be_removed.begin();
436  it != nodes_to_be_removed.end();
437  ++it)
438  {
439  this->remove_boundary_node(1, *it);
440  }
441  nodes_to_be_removed.clear();
442  }
443  // Allocate memory for the spines and fractions along spines
444  //---------------------------------------------------------
445 
446  // Read out number of linear points in the element
447  unsigned n_p = dynamic_cast<ELEMENT*>(finite_element_pt(0))->nnode_1d();
448 
449 
450  // Add the nodes on the interface to the boundary 6
451  // Storage for boundary coordinates (x-coordinate)
452  b_coord.resize(1);
454  // Starting index of the nodes
455  unsigned n_start = 0;
456  for (unsigned e = 0; e < this->Nx; e++)
457  {
458  // If we are past the
459  if (e > 0)
460  {
461  n_start = 1;
462  }
463  // Get the layer of elements just above the interface
464  FiniteElement* el_pt = this->finite_element_pt(this->Nx * this->Ny1 + e);
465  // The first n_p nodes lie on the boundary
466  for (unsigned n = n_start; n < n_p; n++)
467  {
468  Node* nod_pt = el_pt->node_pt(n);
469  this->convert_to_boundary_node(nod_pt);
470  this->add_boundary_node(6, nod_pt);
471  b_coord[0] = nod_pt->x(0);
472  nod_pt->set_coordinates_on_boundary(6, b_coord);
473  }
474  }
475 
476  // Allocate store for the spines:
477  if (this->Xperiodic)
478  {
479  Spine_pt.reserve((n_p - 1) * this->Nx);
480  }
481  else
482  {
483  Spine_pt.reserve((n_p - 1) * this->Nx + 1);
484  }
485 
486 
487  // FIRST SPINE
488  //-----------
489 
490  // Element 0
491  // Node 0
492  // Assign the new spine of height of the lower layer
493  Spine* new_spine_pt = new Spine(H1);
494  Spine_pt.push_back(new_spine_pt);
495 
496  // Get pointer to node
497  SpineNode* nod_pt = element_node_pt(0, 0);
498 
499  // Set the pointer to the spine
500  nod_pt->spine_pt() = new_spine_pt;
501  // Set the fraction
502  nod_pt->fraction() = 0.0;
503  // Pointer to the mesh that implements the update fct
504  nod_pt->spine_mesh_pt() = this;
505  // ID of update function within this mesh: 0 = lower; 1 = upper
506  nod_pt->node_update_fct_id() = 0;
507 
508  // Loop vertically along the spine
509  // Loop over the elements in fluid 1
510  for (unsigned long i = 0; i < Ny1; i++)
511  {
512  // Loop over the vertical nodes, apart from the first
513  for (unsigned l1 = 1; l1 < n_p; l1++)
514  {
515  // Get pointer to node
516  SpineNode* nod_pt = element_node_pt(i * this->Nx, l1 * n_p);
517  // Set the pointer to the spine
518  nod_pt->spine_pt() = new_spine_pt;
519  // Set the fraction
520  nod_pt->fraction() = (nod_pt->x(1) - this->Ymin) / (H1);
521  // Pointer to the mesh that implements the update fct
522  nod_pt->spine_mesh_pt() = this;
523  // ID of update function within this mesh: 0 = lower; 1 = upper
524  nod_pt->node_update_fct_id() = 0;
525  }
526  }
527 
528  // Loop over the elements in fluid 2
529  for (unsigned long i = 0; i < Ny2; i++)
530  {
531  // Loop over vertical nodes, apart from the first
532  for (unsigned l1 = 1; l1 < n_p; l1++)
533  {
534  // Get pointer to node
535  SpineNode* nod_pt = element_node_pt((Ny1 + i) * this->Nx, l1 * n_p);
536 
537  // Set the pointer to the spine
538  nod_pt->spine_pt() = new_spine_pt;
539  // Set the fraction
540  nod_pt->fraction() = (nod_pt->x(1) - (this->Ymin + H1)) / (H2);
541  // Pointer to the mesh that implements the update fct
542  nod_pt->spine_mesh_pt() = this;
543  // ID of update function within this mesh: 0 = lower; 1 = upper
544  nod_pt->node_update_fct_id() = 1;
545  }
546  }
547 
548 
549  // LOOP OVER OTHER SPINES
550  //----------------------
551 
552  // Now loop over the elements horizontally
553  for (unsigned long j = 0; j < this->Nx; j++)
554  {
555  // Loop over the nodes in the elements horizontally, ignoring
556  // the first column
557 
558  // Last spine needs special treatment in x-periodic meshes:
559  unsigned n_pmax = n_p;
560  if ((this->Xperiodic) && (j == this->Nx - 1)) n_pmax = n_p - 1;
561 
562  for (unsigned l2 = 1; l2 < n_pmax; l2++)
563  {
564  // Assign the new spine with length the height of the lower layer
565  new_spine_pt = new Spine(H1);
566  Spine_pt.push_back(new_spine_pt);
567 
568  // Get pointer to node
569  SpineNode* nod_pt = element_node_pt(j, l2);
570 
571  // Set the pointer to the spine
572  nod_pt->spine_pt() = new_spine_pt;
573  // Set the fraction
574  nod_pt->fraction() = 0.0;
575  // Pointer to the mesh that implements the update fct
576  nod_pt->spine_mesh_pt() = this;
577  // ID of update function within this mesh: 0 = lower; 1 = upper
578  nod_pt->node_update_fct_id() = 0;
579 
580  // Loop vertically along the spine
581  // Loop over the elements in fluid 1
582  for (unsigned long i = 0; i < Ny1; i++)
583  {
584  // Loop over the vertical nodes, apart from the first
585  for (unsigned l1 = 1; l1 < n_p; l1++)
586  {
587  // Get pointer to node
588  SpineNode* nod_pt =
589  element_node_pt(i * this->Nx + j, l1 * n_p + l2);
590  // Set the pointer to the spine
591  nod_pt->spine_pt() = new_spine_pt;
592  // Set the fraction
593  nod_pt->fraction() = (nod_pt->x(1) - this->Ymin) / H1;
594  // Pointer to the mesh that implements the update fct
595  nod_pt->spine_mesh_pt() = this;
596  // ID of update function within this mesh: 0 = lower; 1 = upper
597  nod_pt->node_update_fct_id() = 0;
598  }
599  }
600 
601  // Loop over the elements in fluid 2
602  for (unsigned long i = 0; i < Ny2; i++)
603  {
604  // Loop over vertical nodes, apart from the first
605  for (unsigned l1 = 1; l1 < n_p; l1++)
606  {
607  // Get pointer to node
608  SpineNode* nod_pt =
609  element_node_pt((Ny1 + i) * this->Nx + j, l1 * n_p + l2);
610 
611  // Set the pointer to the spine
612  nod_pt->spine_pt() = new_spine_pt;
613  // Set the fraction
614  nod_pt->fraction() = (nod_pt->x(1) - (this->Ymin + H1)) / H2;
615  // Pointer to the mesh that implements the update fct
616  nod_pt->spine_mesh_pt() = this;
617  // ID of update function within this mesh: 0 = lower; 1 = upper
618  nod_pt->node_update_fct_id() = 1;
619  }
620  }
621  }
622  }
623 
624 
625  // Last spine needs special treatment for periodic meshes
626  // because it's the same as the first one...
627  if (this->Xperiodic)
628  {
629  // Last spine is the same as first one...
630  Spine* final_spine_pt = Spine_pt[0];
631 
632  // Get pointer to node
633  SpineNode* nod_pt = element_node_pt((this->Nx - 1), (n_p - 1));
634 
635  // Set the pointer to the spine
636  nod_pt->spine_pt() = final_spine_pt;
637  // Set the fraction to be the same as for the nodes on the first row
638  nod_pt->fraction() = element_node_pt(0, 0)->fraction();
639  // Pointer to the mesh that implements the update fct
640  nod_pt->spine_mesh_pt() = element_node_pt(0, 0)->spine_mesh_pt();
641  // ID of update function within this mesh: 0 = lower; 1 = upper
642  nod_pt->node_update_fct_id() =
644 
645  // Now loop vertically along the spine
646  for (unsigned i = 0; i < (Ny1 + Ny2); i++)
647  {
648  // Loop over the vertical nodes, apart from the first
649  for (unsigned l1 = 1; l1 < n_p; l1++)
650  {
651  // Get pointer to node
652  SpineNode* nod_pt = element_node_pt(i * this->Nx + (this->Nx - 1),
653  l1 * n_p + (n_p - 1));
654 
655  // Set the pointer to the spine
656  nod_pt->spine_pt() = final_spine_pt;
657  // Set the fraction to be the same as in first row
658  nod_pt->fraction() =
659  element_node_pt(i * this->Nx, l1 * n_p)->fraction();
660  // ID of update function within this mesh: 0 = lower; 1 = upper
661  nod_pt->node_update_fct_id() =
662  element_node_pt(i * this->Nx, l1 * n_p)->node_update_fct_id();
663  // Pointer to the mesh that implements the update fct
664  nod_pt->spine_mesh_pt() =
665  element_node_pt(i * this->Nx, l1 * n_p)->spine_mesh_pt();
666  }
667  }
668  }
669 
670 
671  // Assign the 1D Line elements
672  //---------------------------
673 
674  // Get the present number of elements
675  /*unsigned long element_count = Element_pt.size();
676 
677  //Loop over the horizontal elements
678  for(unsigned i=0;i<this->Nx;i++)
679  {
680  //Construct a new 1D line element on the face on which the local
681  //coordinate 1 is fixed at its max. value (1) -- Face 2
682  FiniteElement *interface_element_element_pt =
683  new INTERFACE_ELEMENT(finite_element_pt(this->Nx*(Ny1-1)+i),2);
684 
685  //Push it back onto the stack
686  Element_pt.push_back(interface_element_element_pt);
687 
688  //Push it back onto the stack of interface elements
689  Interface_element_pt.push_back(interface_element_element_pt);
690 
691  element_count++;
692  }*/
693 
694  // Setup the boundary information
696  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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 remove_boundary_node(const unsigned &b, Node *const &node_pt)
Remove a node from the boundary b.
Definition: mesh.cc:221
std::vector< bool > Boundary_coordinate_exists
Definition: mesh.h:190
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Definition: mesh.h:505
virtual void setup_boundary_element_info()
Definition: mesh.h:275
void convert_to_boundary_node(Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
Definition: mesh.cc:2590
Vector< Vector< Node * > > Boundary_node_pt
Definition: mesh.h:83
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
Definition: mesh.h:565
unsigned Nx
Nx: number of elements in x-direction.
Definition: rectangular_quadmesh.template.h:63
bool Xperiodic
Definition: rectangular_quadmesh.template.h:81
double Ymin
Minimum value of y coordinate.
Definition: rectangular_quadmesh.template.h:75
Vector< Spine * > Spine_pt
A Spine mesh contains a Vector of pointers to spines.
Definition: spines.h:616
SpineNode * element_node_pt(const unsigned long &e, const unsigned &n)
Definition: spines.h:669
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
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:378
Vector< FiniteElement * > Upper_layer_element_pt
Vector of pointers to element in the lower layer.
Definition: two_layer_spine_mesh.template.h:216
Vector< FiniteElement * > Lower_layer_element_pt
Vector of pointers to element in the upper layer.
Definition: two_layer_spine_mesh.template.h:213
Vector< FiniteElement * > Interface_upper_boundary_element_pt
Definition: two_layer_spine_mesh.template.h:224
Vector< FiniteElement * > Interface_lower_boundary_element_pt
Definition: two_layer_spine_mesh.template.h:220
Scalar * y
Definition: level1_cplx_impl.h:128
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh().

◆ interface_lower_boundary_element_pt()

template<class ELEMENT >
FiniteElement*& oomph::TwoLayerSpineMesh< ELEMENT >::interface_lower_boundary_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to elements in bottom layer.

142  {
144  }

References i, and oomph::TwoLayerSpineMesh< ELEMENT >::Interface_lower_boundary_element_pt.

◆ interface_lower_face_index_at_boundary()

template<class ELEMENT >
int oomph::TwoLayerSpineMesh< ELEMENT >::interface_lower_face_index_at_boundary ( const unsigned e)
inline

Index of the face of the elements next to the interface in the lower region (always 2)

168  {
169  return 2;
170  }

◆ interface_upper_boundary_element_pt()

template<class ELEMENT >
FiniteElement*& oomph::TwoLayerSpineMesh< ELEMENT >::interface_upper_boundary_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to elements in upper layer.

136  {
138  }

References i, and oomph::TwoLayerSpineMesh< ELEMENT >::Interface_upper_boundary_element_pt.

◆ interface_upper_face_index_at_boundary()

template<class ELEMENT >
int oomph::TwoLayerSpineMesh< ELEMENT >::interface_upper_face_index_at_boundary ( const unsigned e)
inline

Index of the face of the elements next to the interface in the upper region (always -2)

161  {
162  return -2;
163  }

◆ lower_layer_element_pt()

template<class ELEMENT >
FiniteElement*& oomph::TwoLayerSpineMesh< ELEMENT >::lower_layer_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to elements in bottom layer.

118  {
119  return Lower_layer_element_pt[i];
120  }

References i, and oomph::TwoLayerSpineMesh< ELEMENT >::Lower_layer_element_pt.

◆ ninterface_lower()

template<class ELEMENT >
unsigned long oomph::TwoLayerSpineMesh< ELEMENT >::ninterface_lower ( ) const
inline

Number of elements in top layer.

154  {
156  }

References oomph::TwoLayerSpineMesh< ELEMENT >::Interface_lower_boundary_element_pt.

◆ ninterface_upper()

template<class ELEMENT >
unsigned long oomph::TwoLayerSpineMesh< ELEMENT >::ninterface_upper ( ) const
inline

Number of elements in upper layer.

148  {
150  }

References oomph::TwoLayerSpineMesh< ELEMENT >::Interface_upper_boundary_element_pt.

◆ nlower()

template<class ELEMENT >
unsigned long oomph::TwoLayerSpineMesh< ELEMENT >::nlower ( ) const
inline

◆ nupper()

template<class ELEMENT >
unsigned long oomph::TwoLayerSpineMesh< ELEMENT >::nupper ( ) const
inline

Number of elements in upper layer.

124  {
125  return Upper_layer_element_pt.size();
126  }

References oomph::TwoLayerSpineMesh< ELEMENT >::Upper_layer_element_pt.

◆ spine_node_update()

template<class ELEMENT >
void oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update ( SpineNode spine_node_pt)
inlinevirtual

General node update function implements pure virtual function defined in SpineMesh base class and performs specific update actions, depending on the node update fct id stored for each node.

Implements oomph::SpineMesh.

176  {
177  unsigned id = spine_node_pt->node_update_fct_id();
178  switch (id)
179  {
180  case 0:
181  spine_node_update_lower(spine_node_pt);
182  break;
183 
184  case 1:
185  spine_node_update_upper(spine_node_pt);
186  break;
187 
188  default:
189  std::ostringstream error_message;
190  error_message << "Unknown id passed to spine_node_update " << id
191  << std::endl;
192  throw OomphLibError(error_message.str(),
195  }
196  }
void spine_node_update_lower(SpineNode *spine_node_pt)
Update function for the lower part of the domain.
Definition: two_layer_spine_mesh.template.h:242
void spine_node_update_upper(SpineNode *spine_node_pt)
Update function for the upper part of the domain.
Definition: two_layer_spine_mesh.template.h:254
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::SpineNode::node_update_fct_id(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update_lower(), and oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update_upper().

◆ spine_node_update_lower()

template<class ELEMENT >
void oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update_lower ( SpineNode spine_node_pt)
inlineprotected

Update function for the lower part of the domain.

243  {
244  // Get fraction along the spine
245  double W = spine_node_pt->fraction();
246  // Get spine height
247  double H = spine_node_pt->h();
248  // Set the value of y
249  spine_node_pt->x(1) = this->Ymin + W * H;
250  }
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
@ W
Definition: quadtree.h:63

References oomph::SpineNode::fraction(), H, oomph::SpineNode::h(), oomph::QuadTreeNames::W, oomph::Node::x(), and oomph::RectangularQuadMesh< ELEMENT >::Ymin.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update().

◆ spine_node_update_upper()

template<class ELEMENT >
void oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update_upper ( SpineNode spine_node_pt)
inlineprotected

Update function for the upper part of the domain.

255  {
256  // Get fraction alon the spine
257  double W = spine_node_pt->fraction();
258 
259  // Get spine height
260  double H = spine_node_pt->h();
261 
262  // Set the value of y
263  spine_node_pt->x(1) =
264  (this->Ymin + H) + W * (this->Ymax - (this->Ymin + H));
265  }
double Ymax
Maximum value of y coordinate.
Definition: rectangular_quadmesh.template.h:77

References oomph::SpineNode::fraction(), H, oomph::SpineNode::h(), oomph::QuadTreeNames::W, oomph::Node::x(), oomph::RectangularQuadMesh< ELEMENT >::Ymax, and oomph::RectangularQuadMesh< ELEMENT >::Ymin.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::spine_node_update().

◆ upper_layer_element_pt()

template<class ELEMENT >
FiniteElement*& oomph::TwoLayerSpineMesh< ELEMENT >::upper_layer_element_pt ( const unsigned long &  i)
inline

Access functions for pointers to elements in upper layer.

112  {
113  return Upper_layer_element_pt[i];
114  }

References i, and oomph::TwoLayerSpineMesh< ELEMENT >::Upper_layer_element_pt.

◆ x_spacing_function()

template<class ELEMENT >
double oomph::TwoLayerSpineMesh< ELEMENT >::x_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
protectedvirtual

The spacing function for the x co-ordinates with two regions.

The spacing function for the x co-ordinate, which is the same as the default function.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

215  {
216  // Calculate the values of equal increments in nodal values
217  double xstep = (this->Xmax - this->Xmin) / ((this->Np - 1) * this->Nx);
218  // Return the appropriate value
219  return (this->Xmin + xstep * ((this->Np - 1) * xelement + xnode));
220  }
unsigned Np
Np: number of (linear) points in the element.
Definition: rectangular_quadmesh.template.h:67
double Xmax
Maximum value of x coordinate.
Definition: rectangular_quadmesh.template.h:72
double Xmin
Minimum value of x coordinate.
Definition: rectangular_quadmesh.template.h:70

References GlobalParameters::Nx.

◆ y_spacing_function()

template<class ELEMENT >
double oomph::TwoLayerSpineMesh< ELEMENT >::y_spacing_function ( unsigned  xelement,
unsigned  xnode,
unsigned  yelement,
unsigned  ynode 
)
protectedvirtual

The spacing function for the y co-ordinates with three regions in each fluid.

The spacing function for the y co-ordinates, which splits the region into two regions (1 and 2), according to the heights H1 and H2, with Ny1 and Ny2 elements respectively.

Reimplemented from oomph::RectangularQuadMesh< ELEMENT >.

231  {
232  // Set up some spacing parameters
233  // The lower region a starts at Ymin
235  // The upper region a ends at Ymax
237  // Number of nodes per element
238  unsigned n_p = RectangularQuadMesh<ELEMENT>::Np;
239  // The lower region starts at Ymin
240  double y1init = Ymin;
241  // The upper region starts at H1 - Ymin
242  double y2init = H1 - Ymin;
243  // Calculate the space between each node in each region,
244  // Assumming uniform spacing
245  // Lower region has a length (H1-Ymin)
246  double y1step = (H1 - Ymin) / ((n_p - 1) * Ny1);
247  // Upper region has a length (Ymax-H1)
248  double y2step = (Ymax - H1) / ((n_p - 1) * Ny2);
249 
250  // Now return the actual node position, it's different in the two
251  // regions, of course
252  if (yelement < Ny1)
253  {
254  return (y1init + y1step * ((n_p - 1) * yelement + ynode));
255  }
256  else
257  {
258  return (y2init + y2step * ((n_p - 1) * (yelement - Ny1) + ynode));
259  }
260  }

Member Data Documentation

◆ H1

template<class ELEMENT >
double oomph::TwoLayerSpineMesh< ELEMENT >::H1
protected

Height of the lower layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh().

◆ H2

template<class ELEMENT >
double oomph::TwoLayerSpineMesh< ELEMENT >::H2
protected

Height of the upper layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh().

◆ Interface_lower_boundary_element_pt

template<class ELEMENT >
Vector<FiniteElement*> oomph::TwoLayerSpineMesh< ELEMENT >::Interface_lower_boundary_element_pt
protected

Vector of pointers to the elements adjacent to the interface on the lower layer

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::interface_lower_boundary_element_pt(), and oomph::TwoLayerSpineMesh< ELEMENT >::ninterface_lower().

◆ Interface_upper_boundary_element_pt

template<class ELEMENT >
Vector<FiniteElement*> oomph::TwoLayerSpineMesh< ELEMENT >::Interface_upper_boundary_element_pt
protected

Vector of pointers to the element adjacent to the interface on the upper layer

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::interface_upper_boundary_element_pt(), and oomph::TwoLayerSpineMesh< ELEMENT >::ninterface_upper().

◆ Lower_layer_element_pt

template<class ELEMENT >
Vector<FiniteElement*> oomph::TwoLayerSpineMesh< ELEMENT >::Lower_layer_element_pt
protected

Vector of pointers to element in the upper layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::lower_layer_element_pt(), and oomph::TwoLayerSpineMesh< ELEMENT >::nlower().

◆ Ny1

template<class ELEMENT >
unsigned oomph::TwoLayerSpineMesh< ELEMENT >::Ny1
protected

Number of elements in lower layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh().

◆ Ny2

template<class ELEMENT >
unsigned oomph::TwoLayerSpineMesh< ELEMENT >::Ny2
protected

Number of elements in upper layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::TwoLayerSpineMesh().

◆ Upper_layer_element_pt

template<class ELEMENT >
Vector<FiniteElement*> oomph::TwoLayerSpineMesh< ELEMENT >::Upper_layer_element_pt
protected

Vector of pointers to element in the lower layer.

Referenced by oomph::TwoLayerSpineMesh< ELEMENT >::nupper(), and oomph::TwoLayerSpineMesh< ELEMENT >::upper_layer_element_pt().


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