oomph::SingleLayerCubicSpineMesh< ELEMENT > Class Template Reference

#include <single_layer_cubic_spine_mesh.template.h>

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

Public Member Functions

 SingleLayerCubicSpineMesh (const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &lx, const double &ly, const double &h, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
virtual void spine_node_update (SpineNode *spine_node_pt)
 
- Public Member Functions inherited from oomph::SimpleCubicMesh< ELEMENT >
 SimpleCubicMesh (const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &lx, const double &ly, const double &lz, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
 SimpleCubicMesh (const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const double &zmin, const double &zmax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
const unsignednx () const
 Access function for number of elements in x directions. More...
 
const unsignedny () const
 Access function for number of elements in y directions. More...
 
const unsignednz () const
 Access function for number of elements in y directions. More...
 
- Public Member Functions inherited from oomph::BrickMeshBase
 BrickMeshBase ()
 Constructor (empty) More...
 
 BrickMeshBase (const BrickMeshBase &)=delete
 Broken copy constructor. More...
 
virtual ~BrickMeshBase ()
 Broken assignment operator. 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

virtual void build_single_layer_mesh (TimeStepper *time_stepper_pt)
 
- Protected Member Functions inherited from oomph::SimpleCubicMesh< ELEMENT >
void build_mesh (TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 Generic mesh construction function: contains all the hard work. More...
 
- 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)
 

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 Attributes inherited from oomph::SimpleCubicMesh< ELEMENT >
unsigned Nx
 Number of elements in x direction. More...
 
unsigned Ny
 Number of elements in y direction. More...
 
unsigned Nz
 Number of elements in y direction. 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
 Minimum value of y coordinate. More...
 
double Zmin
 Minimum value of z coordinate. More...
 
double Zmax
 Maximum value of z coordinate. 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
 
- Protected Attributes inherited from oomph::SpineMesh
Vector< Spine * > Spine_pt
 A Spine mesh contains a Vector of pointers to spines. More...
 

Detailed Description

template<class ELEMENT>
class oomph::SingleLayerCubicSpineMesh< ELEMENT >

Spine mesh class derived from standard cubic 3D mesh. The mesh contains a layer of spinified fluid elements (of type ELEMENT; e.g SpineElement<QCrouzeixRaviartElement<3>) for 3D problems, in which the interface's vertical position can vary

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

Constructor & Destructor Documentation

◆ SingleLayerCubicSpineMesh()

template<class ELEMENT >
oomph::SingleLayerCubicSpineMesh< ELEMENT >::SingleLayerCubicSpineMesh ( const unsigned nx,
const unsigned ny,
const unsigned nz,
const double lx,
const double ly,
const double h,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)

Constructor: Pass number of elements in x-direction, number of elements in y-direction, number of elements in z-direction, lengths in x- and y- directions, height of layer, and pointer to timestepper (defaults to Steady timestepper)

Constructor for spine 3D mesh: Pass number of elements in x-direction, number of elements in y-direction, number elements in z-direction, length, width and height of layer, and pointer to timestepper (defaults to Static timestepper).

49  : SimpleCubicMesh<ELEMENT>(nx, ny, nz, lx, ly, h, time_stepper_pt)
50  {
51  // Mesh can only be built with 3D Qelements.
52  MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(3);
53 
54  // Mesh can only be built with spine elements
55  MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(3);
56 
57  // Now build the single layer mesh on top of the existing mesh
58  build_single_layer_mesh(time_stepper_pt);
59  }
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 & nz() const
Access function for number of elements in y directions.
Definition: simple_cubic_mesh.template.h:120
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Definition: single_layer_cubic_spine_mesh.template.cc:66
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33

References oomph::SingleLayerCubicSpineMesh< ELEMENT >::build_single_layer_mesh().

Member Function Documentation

◆ build_single_layer_mesh()

template<class ELEMENT >
void oomph::SingleLayerCubicSpineMesh< 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

68  {
69  // Read out the number of elements in the x-direction
70  unsigned n_x = this->Nx;
71  // Read out the number of elements in the y-direction
72  unsigned n_y = this->Ny;
73  // Read out the number of elements in the z-direction
74  unsigned n_z = this->Nz;
75 
76  // Allocate memory for the spines and fractions along spines
77 
78  // Read out number of linear points in the element
79  unsigned n_p = dynamic_cast<ELEMENT*>(finite_element_pt(0))->nnode_1d();
80 
81  // Allocate store for the spines: (different in the case of periodic meshes
82  // !!)
83  Spine_pt.reserve(((n_p - 1) * n_x + 1) * ((n_p - 1) * n_y + 1));
84 
85  // Now we loop over all the elements and attach the spines
86 
87  // FIRST ELEMENT: Element 0
88  // Loop over the nodes on the base of the element
89  for (unsigned l1 = 0; l1 < n_p; l1++) // y loop over the nodes
90  {
91  for (unsigned l2 = 0; l2 < n_p; l2++) // x loop over the nodes
92  {
93  // Assign the new spine with length h
94  Spine* new_spine_pt = new Spine(1.0);
95  Spine_pt.push_back(new_spine_pt);
96 
97  // Get pointer to node
98  SpineNode* nod_pt = element_node_pt(0, l2 + l1 * n_p);
99  // Set the pointer to the spine
100  nod_pt->spine_pt() = new_spine_pt;
101  // Set the fraction
102  nod_pt->fraction() = 0.0;
103  // Pointer to the mesh that implements the update fct
104  nod_pt->spine_mesh_pt() = this;
105 
106  // Loop vertically along the spine
107  // Loop over the elements
108  for (unsigned long k = 0; k < n_z; k++)
109  {
110  // Loop over the vertical nodes, apart from the first
111  for (unsigned l3 = 1; l3 < n_p; l3++)
112  {
113  // Get pointer to node
114  SpineNode* nod_pt =
115  element_node_pt(k * n_x * n_y, l3 * n_p * n_p + l2 + l1 * n_p);
116  // Set the pointer to the spine
117  nod_pt->spine_pt() = new_spine_pt;
118  // Set the fraction
119  nod_pt->fraction() =
120  (double(k) + double(l3) / double(n_p - 1)) / double(n_z);
121  // Pointer to the mesh that implements the update fct
122  nod_pt->spine_mesh_pt() = this;
123  }
124  }
125  }
126  }
127 
128 
129  // LOOP OVER OTHER ELEMENTS IN THE FIRST ROW
130  //-----------------------------------------
131 
132  // The procedure is the same but we have to identify the
133  // before defined spines for not defining them two times
134 
135  for (unsigned j = 1; j < n_x; j++) // loop over the elements in the first
136  // row
137  {
138  for (unsigned l1 = 0; l1 < n_p; l1++) // y loop over the nodes
139  {
140  // First we copy the last row of nodes into the
141  // first row of the new element (and extend to the third dimension)
142  for (unsigned l2 = 1; l2 < n_p; l2++) // x loop over the nodes
143  {
144  // Node j + i*np
145  // Assign the new spine with unit length
146  Spine* new_spine_pt = new Spine(1.0);
147  Spine_pt.push_back(new_spine_pt);
148 
149  // Get pointer to node
150  SpineNode* nod_pt = element_node_pt(j, l2 + l1 * n_p);
151 
152  // Set the pointer to the spine
153  nod_pt->spine_pt() = new_spine_pt;
154  // Set the fraction
155  nod_pt->fraction() = 0.0;
156  // Pointer to the mesh that implements the update fct
157  nod_pt->spine_mesh_pt() = this;
158 
159  // Loop vertically along the spine
160  // Loop over the elements
161  for (unsigned long k = 0; k < n_z; k++)
162  {
163  // Loop over the vertical nodes, apart from the first
164  for (unsigned l3 = 1; l3 < n_p; l3++)
165  {
166  // Get pointer to node
167  SpineNode* nod_pt = element_node_pt(
168  j + k * n_x * n_y, l3 * n_p * n_p + l2 + l1 * n_p);
169  // Set the pointer to the spine
170  nod_pt->spine_pt() = new_spine_pt;
171  // Set the fraction
172  nod_pt->fraction() =
173  (double(k) + double(l3) / double(n_p - 1)) / double(n_z);
174  // Pointer to the mesh that implements the update fct
175  nod_pt->spine_mesh_pt() = this;
176  }
177  }
178  }
179  }
180  }
181 
182  // REST OF THE ELEMENTS
183  // Now we loop over the rest of the elements.
184  // We will separate the first of each row being al the rest equal
185  for (unsigned long i = 1; i < n_y; i++)
186  {
187  // FIRST ELEMENT OF THE ROW
188 
189  // First line of nodes is copied from the element of the bottom
190  for (unsigned l1 = 1; l1 < n_p; l1++) // y loop over the nodes
191  {
192  for (unsigned l2 = 0; l2 < n_p; l2++) // x loop over the nodes
193  {
194  // Node j + i*np
195  // Assign the new spine with unit length
196  Spine* new_spine_pt = new Spine(1.0);
197  Spine_pt.push_back(new_spine_pt);
198 
199 
200  // Get pointer to node
201  // Element i*n_x; node l2 + l1*n_p
202  SpineNode* nod_pt = element_node_pt(i * n_x, l2 + l1 * n_p);
203  // Set the pointer to the spine
204  nod_pt->spine_pt() = new_spine_pt;
205  // Set the fraction
206  nod_pt->fraction() = 0.0;
207  // Pointer to the mesh that implements the update fct
208  nod_pt->spine_mesh_pt() = this;
209 
210  // Loop vertically along the spine
211  // Loop over the elements
212  for (unsigned long k = 0; k < n_z; k++)
213  {
214  // Loop over the vertical nodes, apart from the first
215  for (unsigned l3 = 1; l3 < n_p; l3++)
216  {
217  // Get pointer to node
218  SpineNode* nod_pt = element_node_pt(
219  i * n_x + k * n_x * n_y, l3 * n_p * n_p + l2 + l1 * n_p);
220  // Set the pointer to the spine
221  nod_pt->spine_pt() = new_spine_pt;
222  // Set the fraction
223  nod_pt->fraction() =
224  (double(k) + double(l3) / double(n_p - 1)) / double(n_z);
225  // Pointer to the mesh that implements the update fct
226  nod_pt->spine_mesh_pt() = this;
227  }
228  }
229  }
230  }
231 
232 
233  // REST OF THE ELEMENTS OF THE ROW
234  for (unsigned j = 1; j < n_x; j++)
235  {
236  // First line of nodes is copied from the element of the bottom
237  for (unsigned l1 = 1; l1 < n_p; l1++) // y loop over the nodes
238  {
239  for (unsigned l2 = 1; l2 < n_p; l2++) // x loop over the nodes
240  {
241  // Node j + i*np
242  // Assign the new spine with unit length
243  Spine* new_spine_pt = new Spine(1.0);
244  Spine_pt.push_back(new_spine_pt);
245 
246 
247  // Get pointer to node
248  // Element j + i*n_x; node l2 + l1*n_p
249  SpineNode* nod_pt = element_node_pt(j + i * n_x, l2 + l1 * n_p);
250  // Set the pointer to the spine
251  nod_pt->spine_pt() = new_spine_pt;
252  // Set the fraction
253  nod_pt->fraction() = 0.0;
254  // Pointer to the mesh that implements the update fct
255  nod_pt->spine_mesh_pt() = this;
256 
257  // Loop vertically along the spine
258  // Loop over the elements
259  for (unsigned long k = 0; k < n_z; k++)
260  {
261  // Loop over the vertical nodes, apart from the first
262  for (unsigned l3 = 1; l3 < n_p; l3++)
263  {
264  // Get pointer to node
265  SpineNode* nod_pt = element_node_pt(
266  j + i * n_x + k * n_x * n_y, l3 * n_p * n_p + l2 + l1 * n_p);
267  // Set the pointer to the spine
268  nod_pt->spine_pt() = new_spine_pt;
269  // Set the fraction
270  nod_pt->fraction() =
271  (double(k) + double(l3) / double(n_p - 1)) / double(n_z);
272  // Pointer to the mesh that implements the update fct
273  nod_pt->spine_mesh_pt() = this;
274  }
275  }
276  }
277  }
278  }
279  }
280  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
unsigned Ny
Number of elements in y direction.
Definition: simple_cubic_mesh.template.h:130
unsigned Nz
Number of elements in y direction.
Definition: simple_cubic_mesh.template.h:133
unsigned Nx
Number of elements in x direction.
Definition: simple_cubic_mesh.template.h:127
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
char char char int int * k
Definition: level2_impl.h:374
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::SpineNode::fraction(), i, j, k, GlobalParameters::Nx, GlobalParameters::Ny, Global_Parameters::Nz, oomph::SpineNode::spine_mesh_pt(), and oomph::SpineNode::spine_pt().

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

◆ spine_node_update()

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

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

Implements oomph::SpineMesh.

Reimplemented in oomph::AnnularSpineMesh< ELEMENT >.

67  {
68  // Get fraction along the spine
69  double W = spine_node_pt->fraction();
70  // Get spine height
71  double H = spine_node_pt->h();
72  // Set the value of z
73  spine_node_pt->x(2) = this->Zmin + W * H;
74  }
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
double Zmin
Minimum value of z coordinate.
Definition: simple_cubic_mesh.template.h:148
@ W
Definition: quadtree.h:63

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


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