oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT > Class Template Reference

AlgebraicMesh version of RefineableQuarterTubeMesh. More...

#include <quarter_tube_mesh.template.h>

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

Public Member Functions

 AlgebraicRefineableQuarterTubeMesh (GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, const double centre_box_size=1.0, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
unsigned self_test ()
 Run self-test for algebraic mesh – return 0/1 for OK/failure. More...
 
QuarterTubeDomain::AxialSpacingFctPtaxial_spacing_fct_pt ()
 
void node_update (const bool &update_all_solid_nodes=false)
 
void algebraic_node_update (const unsigned &t, AlgebraicNode *&node_pt)
 
void update_node_update (AlgebraicNode *&node_pt)
 
- Public Member Functions inherited from oomph::AlgebraicMesh
 AlgebraicMesh ()
 
 AlgebraicMesh (const AlgebraicMesh &)=delete
 Broken copy constructor. More...
 
 ~AlgebraicMesh ()
 Broken assignment operator. More...
 
AlgebraicNodenode_pt (const unsigned long &n)
 Return a pointer to the n-th global AlgebraicNode. More...
 
unsigned self_test ()
 Self test: check consistentency of multiple node updates. More...
 
void add_geom_object_list_pt (GeomObject *geom_object_pt)
 
unsigned ngeom_object_list_pt ()
 Return number of geometric objects associated with AlgebraicMesh. More...
 
GeomObjectgeom_object_list_pt (const unsigned &i)
 Access function to the ith GeomObject. More...
 
- Public Member Functions inherited from oomph::Mesh
 Mesh ()
 Default constructor. More...
 
 Mesh (const Vector< Mesh * > &sub_mesh_pt)
 
void merge_meshes (const Vector< Mesh * > &sub_mesh_pt)
 
virtual void 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...
 
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...
 
- Public Member Functions inherited from oomph::RefineableQuarterTubeMesh< ELEMENT >
 RefineableQuarterTubeMesh (GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
virtual ~RefineableQuarterTubeMesh ()
 Destructor: empty. More...
 
- Public Member Functions inherited from oomph::QuarterTubeMesh< ELEMENT >
 QuarterTubeMesh (GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
 
virtual ~QuarterTubeMesh ()
 Destructor: empty. More...
 
GeomObject *& wall_pt ()
 Access function to GeomObject representing wall. More...
 
QuarterTubeDomaindomain_pt ()
 Access function to domain. More...
 
QuarterTubeDomain::BLSquashFctPtbl_squash_fct_pt ()
 
QuarterTubeDomaindomain_pt () const
 Access function to underlying domain. 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::RefineableBrickMesh< ELEMENT >
 RefineableBrickMesh ()
 Constructor: Setup static octree data. More...
 
 RefineableBrickMesh (const RefineableBrickMesh &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableBrickMesh &)=delete
 Broken assignment operator. More...
 
virtual ~RefineableBrickMesh ()
 Destructor: More...
 
virtual void setup_tree_forest ()
 
void setup_octree_forest ()
 Do what it says... More...
 
- Public Member Functions inherited from oomph::TreeBasedRefineableMesh< ELEMENT >
 TreeBasedRefineableMesh ()
 Constructor, call the constructor of the base class. More...
 
 TreeBasedRefineableMesh (const TreeBasedRefineableMesh &dummy)=delete
 Broken copy constructor. More...
 
virtual ~TreeBasedRefineableMesh ()
 Empty virtual destructor. More...
 
- Public Member Functions inherited from oomph::TreeBasedRefineableMeshBase
 TreeBasedRefineableMeshBase ()
 Constructor. More...
 
 TreeBasedRefineableMeshBase (const TreeBasedRefineableMeshBase &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const TreeBasedRefineableMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~TreeBasedRefineableMeshBase ()
 Empty Destructor: More...
 
void adapt (const Vector< double > &elemental_error)
 
void p_adapt (const Vector< double > &elemental_error)
 
void refine_uniformly (DocInfo &doc_info)
 Refine mesh uniformly and doc process. More...
 
void refine_uniformly ()
 Refine mesh uniformly. More...
 
void p_refine_uniformly (DocInfo &doc_info)
 p-refine mesh uniformly and doc process More...
 
void p_refine_uniformly ()
 p-refine mesh uniformly More...
 
unsigned unrefine_uniformly ()
 
void p_unrefine_uniformly (DocInfo &doc_info)
 p-unrefine mesh uniformly More...
 
TreeForestforest_pt ()
 Return pointer to the Forest represenation of the mesh. More...
 
void doc_adaptivity_targets (std::ostream &outfile)
 Doc the targets for mesh adaptation. More...
 
unsignedmax_refinement_level ()
 Access fct for max. permissible refinement level (relative to base mesh) More...
 
unsignedmin_refinement_level ()
 Access fct for min. permissible refinement level (relative to base mesh) More...
 
unsignedmax_p_refinement_level ()
 
unsignedmin_p_refinement_level ()
 
virtual void adapt_mesh (DocInfo &doc_info)
 
virtual void adapt_mesh ()
 
void p_adapt_mesh (DocInfo &doc_info)
 
void p_adapt_mesh ()
 
virtual void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
virtual void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 p-refine mesh by refining the elements identified by their numbers. More...
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 p-refine mesh by refining the elements identified by their pointers. More...
 
virtual void refine_base_mesh_as_in_reference_mesh (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 Refine to same degree as the reference mesh. More...
 
virtual bool refine_base_mesh_as_in_reference_mesh_minus_one (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 
virtual void refine_as_in_reference_mesh (TreeBasedRefineableMeshBase *const &ref_mesh_pt)
 
virtual void get_refinement_levels (unsigned &min_refinement_level, unsigned &max_refinement_level)
 Get max/min refinement levels in mesh. More...
 
virtual void get_elements_at_refinement_level (unsigned &refinement_level, Vector< RefineableElement * > &level_elements)
 
virtual void get_refinement_pattern (Vector< Vector< unsigned >> &to_be_refined)
 
void refine_base_mesh (Vector< Vector< unsigned >> &to_be_refined)
 Refine base mesh according to specified refinement pattern. More...
 
virtual void refine (std::ifstream &restart_file)
 Refine mesh according to refinement pattern in restart file. More...
 
virtual void dump_refinement (std::ostream &outfile)
 Dump refinement pattern to allow for rebuild. More...
 
virtual void read_refinement (std::ifstream &restart_file, Vector< Vector< unsigned >> &to_be_refined)
 Read refinement pattern to allow for rebuild. More...
 
unsigned uniform_refinement_level_when_pruned () const
 
unsigneduniform_refinement_level_when_pruned ()
 Level to which the mesh was uniformly refined when it was pruned. More...
 
- Public Member Functions inherited from oomph::RefineableMeshBase
bool adapt_flag ()
 
 RefineableMeshBase ()
 
 RefineableMeshBase (const RefineableMeshBase &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableMeshBase &)=delete
 Broken assignment operator. More...
 
virtual ~RefineableMeshBase ()
 Empty Destructor: More...
 
unsigned nrefined ()
 Access fct for number of elements that were refined. More...
 
unsigned nunrefined ()
 Access fct for number of elements that were unrefined. More...
 
unsignednrefinement_overruled ()
 
unsignedmax_keep_unrefined ()
 
ErrorEstimator *& spatial_error_estimator_pt ()
 Access to spatial error estimator. More...
 
ErrorEstimatorspatial_error_estimator_pt () const
 Access to spatial error estimator (const version. More...
 
doublemin_permitted_error ()
 
doublemax_permitted_error ()
 
doublemin_error ()
 
doublemax_error ()
 
DocInfo *& doc_info_pt ()
 Access fct for pointer to DocInfo. More...
 
void enable_adaptation ()
 Enable adaptation. More...
 
void disable_adaptation ()
 Disable adaptation. More...
 
void enable_p_adaptation ()
 Enable adaptation. More...
 
void disable_p_adaptation ()
 Disable adaptation. More...
 
void enable_additional_synchronisation_of_hanging_nodes ()
 Enable additional synchronisation of hanging nodes. More...
 
void disable_additional_synchronisation_of_hanging_nodes ()
 Disable additional synchronisation of hanging nodes. More...
 
bool is_adaptation_enabled () const
 Return whether the mesh is to be adapted. More...
 
bool is_p_adaptation_enabled () const
 Return whether the mesh is to be adapted. More...
 
bool is_additional_synchronisation_of_hanging_nodes_disabled () const
 Return whether additional synchronisation is enabled. More...
 
DocInfo doc_info ()
 Access fct for DocInfo. More...
 
void p_unrefine_uniformly (DocInfo &doc_info)
 p-unrefine mesh uniformly More...
 

Private Types

enum  { Central_region , Lower_right_region , Upper_left_region }
 Remesh function ids. More...
 

Private Member Functions

void node_update_central_region (const unsigned &t, AlgebraicNode *&node_pt)
 
void node_update_lower_right_region (const unsigned &t, AlgebraicNode *&node_pt)
 
void node_update_upper_left_region (const unsigned &t, AlgebraicNode *&node_pt)
 
void setup_algebraic_node_update ()
 Setup algebraic update operation for all nodes. More...
 
void update_node_update_in_region (AlgebraicNode *&node_pt, int &region_id)
 

Private Attributes

double Centre_box_size
 Size of centre box. More...
 
double Lambda_x
 Fractional width of central region. More...
 
double Lambda_y
 Fractional height of central region. 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...
 
- 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 Member Functions inherited from oomph::TreeBasedRefineableMeshBase
void complete_hanging_nodes (const int &ncont_interpolated_values)
 Complete the hanging node scheme recursively. More...
 
void complete_hanging_nodes_recursively (Node *&nod_pt, Vector< Node * > &master_nodes, Vector< double > &hang_weights, const int &ival)
 Auxiliary routine for recursive hanging node completion. 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::QuarterTubeMesh< ELEMENT >
QuarterTubeDomainDomain_pt
 Pointer to domain. More...
 
GeomObjectWall_pt
 Pointer to the geometric object that represents the curved wall. More...
 
Vector< doubleXi_lo
 Lower limits for the coordinates along the wall. More...
 
double Fract_mid
 Fraction along wall where outer ring is to be divided. More...
 
Vector< doubleXi_hi
 Upper limits for the coordinates along the wall. More...
 
- Protected Attributes inherited from oomph::TreeBasedRefineableMeshBase
unsigned Uniform_refinement_level_when_pruned
 Level to which the mesh was uniformly refined when it was pruned. More...
 
unsigned Max_refinement_level
 Max. permissible refinement level (relative to base mesh) More...
 
unsigned Min_refinement_level
 Min. permissible refinement level (relative to base mesh) More...
 
unsigned Max_p_refinement_level
 Max. permissible p-refinement level (relative to base mesh) More...
 
unsigned Min_p_refinement_level
 Min. permissible p-refinement level (relative to base mesh) More...
 
TreeForestForest_pt
 Forest representation of the mesh. More...
 
- Protected Attributes inherited from oomph::RefineableMeshBase
ErrorEstimatorSpatial_error_estimator_pt
 Pointer to spatial error estimator. More...
 
double Max_permitted_error
 Max. error (i.e. split elements if their error is larger) More...
 
double Min_permitted_error
 Min. error (i.e. (try to) merge elements if their error is smaller) More...
 
double Min_error
 Min.actual error. More...
 
double Max_error
 Max. actual error. More...
 
unsigned Nrefined
 Stats: Number of elements that were refined. More...
 
unsigned Nunrefined
 Stats: Number of elements that were unrefined. More...
 
bool Adapt_flag
 Flag that requests adaptation. More...
 
bool P_adapt_flag
 Flag that requests p-adaptation. More...
 
bool Additional_synchronisation_of_hanging_nodes_not_required
 Flag that disables additional synchronisation of hanging nodes. More...
 
DocInfoDoc_info_pt
 Pointer to DocInfo. More...
 
unsigned Max_keep_unrefined
 
unsigned Nrefinement_overruled
 

Detailed Description

template<class ELEMENT>
class oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >

AlgebraicMesh version of RefineableQuarterTubeMesh.

Algebraic 3D quarter tube mesh class.

The mesh boundaries are numbered as follows:

  • Boundary 0: "Inflow" cross section; located along the line parametrised by \( \xi_0 = \xi_0^{lo} \) on the geometric object that specifies the wall.
  • Boundary 1: Plane x=0
  • Boundary 2: Plane y=0
  • Boundary 3: The curved wall - specified by the GeomObject passed to the mesh constructor.
  • Boundary 4: "Outflow" cross section; located along the line parametrised by \( \xi_0 = \xi_0^{hi} \) on the geometric object that specifies the wall. Algebraic version of RefineableQuarterTubeMesh

Cross section through mesh looking along tube.........

                 ---___
                |      ---____
                |              -   BOUNDARY 3
                |                /
                |  [Region 2]   /  |
                |              /     |
                | N           /        |
                | |_ E       /          |
  BOUNDARY 1    |------------            |
                |            |            |
                | [Region 0] | [Region 1] |  ^
                |            |            | / \  direction of
                | N          |    N       |  |   2nd Lagrangian
                | |_ E       |    |_ E    |  |   coordinate
                |____________|____________|  |   along wall GeomObject

                      BOUNDARY 2

The Domain is built of slices each consisting of three MacroElements as sketched. The local coordinates are such that the (E)astern direction coincides with the positive s_0 direction, while the (N)orther direction coincides with the positive s_1 direction. The positive s_2 direction points down the tube.

Elements need to be derived from AlgebraicElementBase. In addition to the refinement procedures available for the RefineableQuarterTubeMesh which forms the basis for this mesh, three algebraic node update functions are implemented for the nodes in the three regions defined by the Domain MacroElements. Note: it is assumed the cross section down the tube is uniform when setup_algebraic_node_update() is called.

Member Enumeration Documentation

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private

Remesh function ids.

Enumerator
Central_region 
Lower_right_region 
Upper_left_region 
615  {
619  };
@ Lower_right_region
Definition: quarter_tube_mesh.template.h:617
@ Upper_left_region
Definition: quarter_tube_mesh.template.h:618
@ Central_region
Definition: quarter_tube_mesh.template.h:616

Constructor & Destructor Documentation

◆ AlgebraicRefineableQuarterTubeMesh()

template<class ELEMENT >
oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::AlgebraicRefineableQuarterTubeMesh ( GeomObject wall_pt,
const Vector< double > &  xi_lo,
const double fract_mid,
const Vector< double > &  xi_hi,
const unsigned nlayer,
const double  centre_box_size = 1.0,
TimeStepper time_stepper_pt = &Mesh::Default_TimeStepper 
)
inline

Constructor: Pass pointer to geometric object, start and end coordinates of the geometric object and the fraction along the 2nd Lagrangian coordinate at which the dividing line between region 1 and region 2 is to be placed, and timestepper (defaults to (Steady) default timestepper defined in Mesh). Sets up the refineable mesh (by calling the constructor for the underlying RefineableQuarterTubeMesh).

456  : QuarterTubeMesh<ELEMENT>(
457  wall_pt, xi_lo, fract_mid, xi_hi, nlayer, time_stepper_pt),
458  RefineableQuarterTubeMesh<ELEMENT>(
459  wall_pt, xi_lo, fract_mid, xi_hi, nlayer, time_stepper_pt),
460  Centre_box_size(centre_box_size)
461  {
462 #ifdef PARANOID
463  ELEMENT* el_pt = new ELEMENT;
464  if (dynamic_cast<AlgebraicElementBase*>(el_pt) == 0)
465  {
466  std::ostringstream error_message;
467 
468  error_message << "Base class for ELEMENT in "
469  << "AlgebraicRefineableQuarterTubeMesh needs"
470  << "to be of type AlgebraicElement!\n";
471  error_message << "Whereas it is: typeid(el_pt).name()"
472  << typeid(el_pt).name() << std::endl;
473 
474  std::string function_name = " AlgebraicRefineableQuarterTubeMesh::\n";
475  function_name += "AlgebraicRefineableQuarterTubeMesh()";
476 
477  throw OomphLibError(error_message.str(),
480  }
481  delete el_pt;
482 #endif
483 
484  // Add the geometric object to the list associated with this AlgebraicMesh
486 
487  // Setup algebraic node update operations
489 
490  // Ensure nodes are in their default position
491  node_update();
492  }
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Definition: algebraic_elements.h:823
void setup_algebraic_node_update()
Setup algebraic update operation for all nodes.
Definition: quarter_tube_mesh.template.cc:660
double Centre_box_size
Size of centre box.
Definition: quarter_tube_mesh.template.h:611
void node_update(const bool &update_all_solid_nodes=false)
Definition: quarter_tube_mesh.template.h:525
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
Definition: quarter_tube_mesh.template.h:86
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
string name
Definition: plotDoE.py:33
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::AlgebraicMesh::add_geom_object_list_pt(), plotDoE::name, oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::setup_algebraic_node_update(), oomph::Global_string_for_annotation::string(), and oomph::QuarterTubeMesh< ELEMENT >::wall_pt().

Member Function Documentation

◆ algebraic_node_update()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::algebraic_node_update ( const unsigned t,
AlgebraicNode *&  node_pt 
)
inlinevirtual

Implement the algebraic node update function for a node at time level t (t=0: present; t>0: previous): Update with the node's first (default) update function.

Implements oomph::AlgebraicMesh.

552  {
553  // Update with the update function for the node's first (default)
554  // node update fct
555  unsigned id = node_pt->node_update_fct_id();
556 
557  switch (id)
558  {
559  case Central_region:
560 
561  // Central region
563  break;
564 
565  case Lower_right_region:
566 
567  // Lower right region
569  break;
570 
571  case Upper_left_region:
572 
573  // Upper left region
575  break;
576 
577  default:
578 
579  std::ostringstream error_message;
580  error_message << "The node update fct id is " << id
581  << ", but it should only be one of " << Central_region
582  << ", " << Lower_right_region << " or "
583  << Upper_left_region << std::endl;
584  std::string function_name = " AlgebraicRefineableQuarterTubeMesh::";
585  function_name += "algebraic_node_update()";
586 
587  throw OomphLibError(error_message.str(),
590  }
591  }
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
Definition: algebraic_elements.h:620
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
Definition: algebraic_elements.h:146
void node_update_central_region(const unsigned &t, AlgebraicNode *&node_pt)
Definition: quarter_tube_mesh.template.cc:961
void node_update_lower_right_region(const unsigned &t, AlgebraicNode *&node_pt)
Definition: quarter_tube_mesh.template.cc:1051
void node_update_upper_left_region(const unsigned &t, AlgebraicNode *&node_pt)
Definition: quarter_tube_mesh.template.cc:1168
t
Definition: plotPSD.py:36

References oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Central_region, oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Lower_right_region, oomph::AlgebraicMesh::node_pt(), oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_central_region(), oomph::AlgebraicNode::node_update_fct_id(), oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_lower_right_region(), oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_upper_left_region(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Global_string_for_annotation::string(), plotPSD::t, and oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Upper_left_region.

◆ axial_spacing_fct_pt()

template<class ELEMENT >
QuarterTubeDomain::AxialSpacingFctPt& oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::axial_spacing_fct_pt ( )
inlinevirtual

Broken version of the QuarterTubeDomain function Function is broken because axial spacing isn't implemented yet for the Algebraic version of the RefineableQuarterTubeMesh. Note: this function must be used BEFORE algebraic_node_update(...) is called.

Reimplemented from oomph::QuarterTubeMesh< ELEMENT >.

506  {
507  std::ostringstream error_message;
508  error_message << "AxialSpacingFctPt has not been implemented "
509  << "for the AlgebraicRefineableQuarterTubeMesh\n";
510 
511  std::string function_name =
512  " AlgebraicRefineableQuarterTubeMesh::AxialSpacingFctPt()";
513 
514  throw OomphLibError(
515  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
516 
517  return this->Domain_pt->axial_spacing_fct_pt();
518  }
AxialSpacingFctPt & axial_spacing_fct_pt()
Definition: quarter_tube_domain.h:116
QuarterTubeDomain * Domain_pt
Pointer to domain.
Definition: quarter_tube_mesh.template.h:121

References oomph::QuarterTubeDomain::axial_spacing_fct_pt(), oomph::QuarterTubeMesh< ELEMENT >::Domain_pt, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().

◆ node_update()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update ( const bool update_all_solid_nodes = false)
inlinevirtual

Resolve mesh update: Update current nodal positions via algebraic node update. [Doesn't make sense to use this mesh with SolidElements anyway, so we buffer the case if update_all_solid_nodes is set to true.]

Reimplemented from oomph::AlgebraicMesh.

526  {
527 #ifdef PARANOID
528  if (update_all_solid_nodes)
529  {
530  std::string error_message =
531  "Doesn't make sense to use an AlgebraicMesh with\n";
532  error_message +=
533  "SolidElements so specifying update_all_solid_nodes=true\n";
534  error_message += "doesn't make sense either\n";
535 
536  std::string function_name = " AlgebraicRefineableQuarterTubeMesh::";
537  function_name += "node_update()";
538 
539  throw OomphLibError(
541  }
542 #endif
543 
545  }
void node_update(const bool &update_all_solid_nodes=false)
Definition: algebraic_elements.h:653

References oomph::AlgebraicMesh::node_update(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().

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

◆ node_update_central_region()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_central_region ( const unsigned t,
AlgebraicNode *&  node_pt 
)
private

Algebraic update function for a node that is located in the central region

Algebraic update function: Update in central region according to wall shape at time level t (t=0: present; t>0: previous)

963  {
964 #ifdef PARANOID
965  // We're updating the nodal positions (!) at time level t
966  // and determine them by evaluating the wall GeomObject's
967  // position at that time level. I believe this only makes sense
968  // if the t-th history value in the positional timestepper
969  // actually represents previous values (rather than some
970  // generalised quantity). Hence if this function is called with
971  // t>nprev_values(), we issue a warning and terminate the execution.
972  // It *might* be possible that the code still works correctly
973  // even if this condition is violated (e.g. if the GeomObject's
974  // position() function returns the appropriate "generalised"
975  // position value that is required by the timestepping scheme but it's
976  // probably worth flagging this up and forcing the user to manually switch
977  // off this warning if he/she is 100% sure that this is kosher.
979  {
980  std::string error_message =
981  "Trying to update the nodal position at a time level\n";
982  error_message += "beyond the number of previous values in the nodes'\n";
983  error_message += "position timestepper. This seems highly suspect!\n";
984  error_message += "If you're sure the code behaves correctly\n";
985  error_message += "in your application, remove this warning \n";
986  error_message += "or recompile with PARNOID switched off.\n";
987 
988  std::string function_name = "AlgebraicRefineableQuarterTubeMesh::";
989  function_name += "node_update_central_region()",
990  throw OomphLibError(
992  }
993 #endif
994 
995  // Extract references for update in central region by copy construction
996  Vector<double> ref_value(node_pt->vector_ref_value(Central_region));
997 
998  // Extract geometric objects for update in central region by copy
999  // construction
1000  Vector<GeomObject*> geom_object_pt(
1002 
1003  // First reference value: fractional x-position of node inside region
1004  double rho_x = ref_value[0];
1005 
1006  // Second reference value: fractional y-position of node inside region
1007  double rho_y = ref_value[1];
1008 
1009  // Wall position in bottom right corner:
1010 
1011  // Pointer to GeomObject
1012  GeomObject* obj_br_pt = geom_object_pt[0];
1013 
1014  // Local coordinate at bottom-right reference point:
1015  Vector<double> s_br(2);
1016  s_br[0] = ref_value[3];
1017  s_br[1] = ref_value[4];
1018 
1019  // Get wall position
1020  unsigned n_dim = obj_br_pt->ndim();
1021  Vector<double> r_br(n_dim);
1022  obj_br_pt->position(t, s_br, r_br);
1023 
1024  // Wall position in top left corner:
1025 
1026  // Pointer to GeomObject
1027  GeomObject* obj_tl_pt = geom_object_pt[1];
1028 
1029  // Local coordinate:
1030  Vector<double> s_tl(2);
1031  s_tl[0] = ref_value[5];
1032  s_tl[1] = ref_value[6];
1033 
1034  // Get wall position
1035  Vector<double> r_tl(n_dim);
1036  obj_tl_pt->position(t, s_tl, r_tl);
1037 
1038  // Assign new nodal coordinate
1039  node_pt->x(t, 0) = r_br[0] * Lambda_x * rho_x;
1040  node_pt->x(t, 1) = r_tl[1] * Lambda_y * rho_y;
1041  node_pt->x(t, 2) = (r_br[2] + r_tl[2]) * 0.5;
1042  }
Vector< GeomObject * > & vector_geom_object_pt(const int &id)
Definition: algebraic_elements.h:200
Vector< double > & vector_ref_value()
Definition: algebraic_elements.h:251
double Lambda_x
Fractional width of central region.
Definition: quarter_tube_mesh.template.h:622
double Lambda_y
Fractional height of central region.
Definition: quarter_tube_mesh.template.h:625
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...

References oomph::GeomObject::ndim(), oomph::TimeStepper::nprev_values(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), oomph::Node::position_time_stepper_pt(), oomph::Global_string_for_annotation::string(), plotPSD::t, oomph::AlgebraicNode::vector_geom_object_pt(), oomph::AlgebraicNode::vector_ref_value(), and oomph::Node::x().

Referenced by oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::algebraic_node_update().

◆ node_update_lower_right_region()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_lower_right_region ( const unsigned t,
AlgebraicNode *&  node_pt 
)
private

Algebraic update function for a node that is located in the lower-right region

Algebraic update function: Update in lower-right region according to wall shape at time level t (t=0: present; t>0: previous)

1053  {
1054 #ifdef PARANOID
1055  // We're updating the nodal positions (!) at time level t
1056  // and determine them by evaluating the wall GeomObject's
1057  // position at that gime level. I believe this only makes sense
1058  // if the t-th history value in the positional timestepper
1059  // actually represents previous values (rather than some
1060  // generalised quantity). Hence if this function is called with
1061  // t>nprev_values(), we issue a warning and terminate the execution.
1062  // It *might* be possible that the code still works correctly
1063  // even if this condition is violated (e.g. if the GeomObject's
1064  // position() function returns the appropriate "generalised"
1065  // position value that is required by the timestepping scheme but it's
1066  // probably worth flagging this up and forcing the user to manually switch
1067  // off this warning if he/she is 100% sure that this is kosher.
1069  {
1070  std::string error_message =
1071  "Trying to update the nodal position at a time level";
1072  error_message += "beyond the number of previous values in the nodes'";
1073  error_message += "position timestepper. This seems highly suspect!";
1074  error_message += "If you're sure the code behaves correctly";
1075  error_message += "in your application, remove this warning ";
1076  error_message += "or recompile with PARNOID switched off.";
1077 
1078  std::string function_name = "AlgebraicRefineableQuarterTubeSectorMesh::";
1079  function_name += "node_update_lower_right_region()",
1080  throw OomphLibError(
1082  }
1083 #endif
1084 
1085  // Extract references for update in lower-right region by copy construction
1086  Vector<double> ref_value(node_pt->vector_ref_value(Lower_right_region));
1087 
1088  // Extract geometric objects for update in lower-right region
1089  // by copy construction
1090  Vector<GeomObject*> geom_object_pt(
1092 
1093  // First reference value: fractional s0-position of node inside region
1094  double rho_0 = ref_value[0];
1095 
1096  // Use s_squashed to modify fractional s0 position
1097  rho_0 = this->Domain_pt->s_squashed(rho_0);
1098 
1099  // Second reference value: fractional s1-position of node inside region
1100  double rho_1 = ref_value[1];
1101 
1102  // Wall position in bottom right corner:
1103 
1104  // Pointer to GeomObject
1105  GeomObject* obj_br_pt = geom_object_pt[0];
1106 
1107  // Local coordinate
1108  Vector<double> s_br(2);
1109  s_br[0] = ref_value[3];
1110  s_br[1] = ref_value[4];
1111 
1112  // Eulerian dimension
1113  unsigned n_dim = obj_br_pt->ndim();
1114 
1115  // Get wall position
1116  Vector<double> r_br(n_dim);
1117  obj_br_pt->position(t, s_br, r_br);
1118 
1119  // Wall position in top left corner:
1120 
1121  // Pointer to GeomObject
1122  GeomObject* obj_tl_pt = geom_object_pt[1];
1123 
1124  // Local coordinate
1125  Vector<double> s_tl(2);
1126  s_tl[0] = ref_value[5];
1127  s_tl[1] = ref_value[6];
1128 
1129  Vector<double> r_tl(n_dim);
1130  obj_tl_pt->position(t, s_tl, r_tl);
1131 
1132  // Wall position at reference point:
1133 
1134  // Pointer to GeomObject
1135  GeomObject* obj_wall_pt = geom_object_pt[2];
1136 
1137  // Local coordinate
1138  Vector<double> s_wall(2);
1139  s_wall[0] = ref_value[7];
1140  s_wall[1] = ref_value[8];
1141 
1142  Vector<double> r_wall(n_dim);
1143  obj_wall_pt->position(t, s_wall, r_wall);
1144 
1145  // Position Vector to corner of the central region
1146  Vector<double> r_corner(n_dim);
1147  r_corner[0] = Lambda_x * r_br[0];
1148  r_corner[1] = Lambda_y * r_tl[1];
1149  r_corner[2] = (r_br[2] + r_tl[2]) * 0.5;
1150 
1151  // Position Vector to left edge of region
1152  Vector<double> r_left(n_dim);
1153  r_left[0] = r_corner[0];
1154  r_left[1] = rho_1 * r_corner[1];
1155  r_left[2] = r_corner[2];
1156 
1157  // Assign new nodal coordinate
1158  node_pt->x(t, 0) = r_left[0] + rho_0 * (r_wall[0] - r_left[0]);
1159  node_pt->x(t, 1) = r_left[1] + rho_0 * (r_wall[1] - r_left[1]);
1160  node_pt->x(t, 2) = r_left[2] + rho_0 * (r_wall[2] - r_left[2]);
1161  }
double s_squashed(const double &s)
Definition: quarter_tube_domain.h:103

References oomph::GeomObject::ndim(), oomph::TimeStepper::nprev_values(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), oomph::Node::position_time_stepper_pt(), oomph::Global_string_for_annotation::string(), plotPSD::t, oomph::AlgebraicNode::vector_geom_object_pt(), oomph::AlgebraicNode::vector_ref_value(), and oomph::Node::x().

Referenced by oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::algebraic_node_update().

◆ node_update_upper_left_region()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::node_update_upper_left_region ( const unsigned t,
AlgebraicNode *&  node_pt 
)
private

Algebraic update function for a node that is located in the upper-left region

Algebraic update function: Update in upper left region according to wall shape at time level t (t=0: present; t>0: previous)

1170  {
1171 #ifdef PARANOID
1172  // We're updating the nodal positions (!) at time level t
1173  // and determine them by evaluating the wall GeomObject's
1174  // position at that gime level. I believe this only makes sense
1175  // if the t-th history value in the positional timestepper
1176  // actually represents previous values (rather than some
1177  // generalised quantity). Hence if this function is called with
1178  // t>nprev_values(), we issue a warning and terminate the execution.
1179  // It *might* be possible that the code still works correctly
1180  // even if this condition is violated (e.g. if the GeomObject's
1181  // position() function returns the appropriate "generalised"
1182  // position value that is required by the timestepping scheme but it's
1183  // probably worth flagging this up and forcing the user to manually switch
1184  // off this warning if he/she is 100% sure that this is kosher.
1186  {
1187  std::string error_message =
1188  "Trying to update the nodal position at a time level";
1189  error_message += "beyond the number of previous values in the nodes'";
1190  error_message += "position timestepper. This seems highly suspect!";
1191  error_message += "If you're sure the code behaves correctly";
1192  error_message += "in your application, remove this warning ";
1193  error_message += "or recompile with PARNOID switched off.";
1194 
1195  std::string function_name = "AlgebraicRefineableQuarterTubeMesh::";
1196  function_name += "node_update_upper_left_region()";
1197 
1198  throw OomphLibError(
1200  }
1201 #endif
1202 
1203  // Extract references for update in upper-left region by copy construction
1204  Vector<double> ref_value(node_pt->vector_ref_value(Upper_left_region));
1205 
1206  // Extract geometric objects for update in upper-left region
1207  // by copy construction
1208  Vector<GeomObject*> geom_object_pt(
1210 
1211  // First reference value: fractional s0-position of node inside region
1212  double rho_0 = ref_value[0];
1213 
1214  // Second reference value: fractional s1-position of node inside region
1215  double rho_1 = ref_value[1];
1216 
1217  // Use s_squashed to modify fractional s1 position
1218  rho_1 = this->Domain_pt->s_squashed(rho_1);
1219 
1220  // Wall position in bottom right corner:
1221 
1222  // Pointer to GeomObject
1223  GeomObject* obj_br_pt = geom_object_pt[0];
1224 
1225  // Eulerian dimension
1226  unsigned n_dim = obj_br_pt->ndim();
1227 
1228  // Local coordinate
1229  Vector<double> s_br(2);
1230  s_br[0] = ref_value[3];
1231  s_br[1] = ref_value[4];
1232 
1233  // Get wall position
1234  Vector<double> r_br(n_dim);
1235  obj_br_pt->position(t, s_br, r_br);
1236 
1237  // Wall position in top left corner:
1238 
1239  // Pointer to GeomObject
1240  GeomObject* obj_tl_pt = node_pt->geom_object_pt(1);
1241 
1242  // Local coordinate
1243  Vector<double> s_tl(2);
1244  s_tl[0] = ref_value[5];
1245  s_tl[1] = ref_value[6];
1246 
1247  Vector<double> r_tl(n_dim);
1248  obj_tl_pt->position(t, s_tl, r_tl);
1249 
1250  // Wall position at reference point:
1251 
1252  // Pointer to GeomObject
1253  GeomObject* obj_wall_pt = node_pt->geom_object_pt(2);
1254 
1255  // Local coordinate
1256  Vector<double> s_wall(2);
1257  s_wall[0] = ref_value[7];
1258  s_wall[1] = ref_value[8];
1259 
1260  Vector<double> r_wall(n_dim);
1261  obj_wall_pt->position(t, s_wall, r_wall);
1262 
1263  // Position vector to corner of the central region
1264  Vector<double> r_corner(n_dim);
1265  r_corner[0] = Lambda_x * r_br[0];
1266  r_corner[1] = Lambda_y * r_tl[1];
1267  r_corner[2] = (r_br[2] + r_tl[2]) * 0.5;
1268 
1269  // Position Vector to top face of central region
1270  Vector<double> r_top(n_dim);
1271  r_top[0] = rho_0 * r_corner[0];
1272  r_top[1] = r_corner[1];
1273  r_top[2] = r_corner[2];
1274 
1275  // Assign new nodal coordinate
1276  node_pt->x(t, 0) = r_top[0] + rho_1 * (r_wall[0] - r_top[0]);
1277  node_pt->x(t, 1) = r_top[1] + rho_1 * (r_wall[1] - r_top[1]);
1278  node_pt->x(t, 2) = r_top[2] + rho_1 * (r_wall[2] - r_top[2]);
1279  }
GeomObject * geom_object_pt(const unsigned &i)
Definition: algebraic_elements.h:229

References oomph::AlgebraicNode::geom_object_pt(), oomph::GeomObject::ndim(), oomph::TimeStepper::nprev_values(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), oomph::Node::position_time_stepper_pt(), oomph::Global_string_for_annotation::string(), plotPSD::t, oomph::AlgebraicNode::vector_geom_object_pt(), oomph::AlgebraicNode::vector_ref_value(), and oomph::Node::x().

Referenced by oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::algebraic_node_update().

◆ self_test()

template<class ELEMENT >
unsigned oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::self_test ( )
inline

Run self-test for algebraic mesh – return 0/1 for OK/failure.

496  {
497  return AlgebraicMesh::self_test();
498  }
unsigned self_test()
Self test: check consistentency of multiple node updates.
Definition: algebraic_elements.h:786

References oomph::AlgebraicMesh::self_test().

◆ setup_algebraic_node_update()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::setup_algebraic_node_update
private

Setup algebraic update operation for all nodes.

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Setup algebraic node update data, based on 3 regions, each undergoing a different node update strategy. These regions are defined by the three MacroElements in each of the nlayer slices of the QuarterTubeDomain used to build the mesh. The Mesh is suspended from the ‘wall’ GeomObject pointed to by wall_pt. The lower right edge of the mesh is located at the wall's coordinate xi[1]==xi_lo[1], the upper left edge at xi[1]=xi_hi[1], i.e. a view looking down the tube length. The dividing line between the two outer regions is located at the fraction fract_mid between these two coordinates. Node updating strategy:

  • the starting cross sectional shape along the tube length is assumed to be uniform
  • the cross sectional shape of the central region remains rectangular; the position of its top right corner is located at a fixed fraction of the starting width and height of the domain measured at xi[1]==xi_lo[1] and xi[1]==xi_hi[1] respectively. Nodes in this region are located at fixed horizontal and vertical fractions of the region.
  • Nodes in the two outer regions (bottom right and top left) are located on straight lines running from the edges of the central region to the outer wall.
661  {
662 #ifdef PARANOID
664  AlgebraicElementBase* algebraic_element_pt =
665  dynamic_cast<AlgebraicElementBase*>(Mesh::element_pt(0));
666 
667  if (algebraic_element_pt == 0)
668  {
669  std::ostringstream error_message;
670  error_message
671  << "Element in AlgebraicRefineableQuarterTubeMesh must be\n ";
672  error_message << "derived from AlgebraicElementBase\n";
673  error_message << "but it is of type: "
674  << typeid(Mesh::element_pt(0)).name() << std::endl;
675  std::string function_name = "AlgebraicRefineableQuarterTubeMesh::";
676  function_name += "setup_algebraic_node_update()";
677  throw OomphLibError(
678  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
679  }
680 #endif
681 
682  // Find number of nodes in an element from the zeroth element
683  unsigned nnodes_3d = Mesh::finite_element_pt(0)->nnode();
684 
685  // also find number of nodes in 1d line and 2d slice
686  unsigned nnodes_1d = Mesh::finite_element_pt(0)->nnode_1d();
687  unsigned nnodes_2d = nnodes_1d * nnodes_1d;
688 
689  // find node number of a top-left and a bottom-right node in an element
690  // (orientation: looking down tube)
691  unsigned tl_node = nnodes_2d - nnodes_1d;
692  unsigned br_node = nnodes_1d - 1;
693 
694  // find x & y distances to top-right node in element 0 - this is the same
695  // node as the top-left node of element 1
696  double x_c_element = Mesh::finite_element_pt(1)->node_pt(tl_node)->x(0);
697  double y_c_element = Mesh::finite_element_pt(1)->node_pt(tl_node)->x(1);
698 
699  // Get x-distance to bottom-right edge of wall, i.e. coord of node
700  // at bottom-right of bottom-right of element 1
701  double x_wall = Mesh::finite_element_pt(1)->node_pt(br_node)->x(0);
702 
703  // Get y-distance to top-left edge of wall, i.e. coord of node
704  // at top-left of element 2
705  double y_wall = Mesh::finite_element_pt(2)->node_pt(tl_node)->x(1);
706 
707  // Establish fractional widths in central region
708  Lambda_x = Centre_box_size * x_c_element / x_wall;
709  Lambda_y = Centre_box_size * y_c_element / y_wall;
710 
711  // how many elements are there?
712  unsigned nelements = Mesh::nelement();
713 
714  // loop through the elements
715  for (unsigned e = 0; e < nelements; e++)
716  {
717  // get pointer to element
718  FiniteElement* el_pt = Mesh::finite_element_pt(e);
719 
720  // set region id
721  unsigned region_id = e % 3;
722 
723  // find the first node for which to set up node update info - must
724  // bypass the first nnodes_2d nodes after the first 3 elements
725  unsigned nstart = nnodes_2d;
726  if (e < 3)
727  {
728  nstart = 0;
729  }
730 
731  // loop through the nodes,
732  for (unsigned n = nstart; n < nnodes_3d; n++)
733  {
734  // find z coordinate of node
735  // NOTE: to implement axial spacing replace z by z_spaced where
736  // z_spaced=axial_spacing_fct(z) when finding the GeomObjects
737  // and local coords below
738  // BUT store z as the third reference value since this is the value
739  // required by update_node_update()
740  double z = el_pt->node_pt(n)->x(2);
741 
742  // Find wall GeomObject and the GeomObject local coordinates
743  // at bottom-right edge of wall
744  Vector<double> xi(2);
745  xi[0] = z;
747  GeomObject* obj_br_pt;
748  Vector<double> s_br(2);
749  this->Wall_pt->locate_zeta(xi, obj_br_pt, s_br);
750 
751  // Find wall GeomObject/local coordinate
752  // at top-left edge of wall
754  GeomObject* obj_tl_pt;
755  Vector<double> s_tl(2);
756  this->Wall_pt->locate_zeta(xi, obj_tl_pt, s_tl);
757 
758  // Element 0: central region
759  //--------------------------
760  if (region_id == 0)
761  {
762  // Nodal coordinates in x and y direction
763  double x = el_pt->node_pt(n)->x(0);
764  double y = el_pt->node_pt(n)->x(1);
765 
766  // The update function requires two geometric objects
767  Vector<GeomObject*> geom_object_pt(2);
768 
769  // Wall GeomObject at bottom right end of wall mesh:
770  geom_object_pt[0] = obj_br_pt;
771 
772  // Wall GeomObject at top left end of wall mesh:
773  geom_object_pt[1] = obj_tl_pt;
774 
775  // The update function requires seven parameters:
776  Vector<double> ref_value(7);
777 
778  // First reference value: fractional x-position inside region
779  ref_value[0] = x / x_c_element;
780 
781  // Second cfractional y-position inside region
782  ref_value[1] = y / y_c_element;
783 
784  // Third reference value: initial z coordinate of node
785  ref_value[2] = z;
786 
787  // Fourth and fifth reference values:
788  // local coordinate in GeomObject at bottom-right of wall.
789  // Note: must recompute this reference for new nodes
790  // since values interpolated from parent nodes will
791  // be wrong (this is true for all local coordinates
792  // within GeomObjects)
793  ref_value[3] = s_br[0];
794  ref_value[4] = s_br[1];
795 
796  // Sixth and seventh reference values:
797  // local coordinate in GeomObject at top-left of wall.
798  ref_value[5] = s_tl[0];
799  ref_value[6] = s_tl[1];
800 
801  // Setup algebraic update for node: Pass update information
802  static_cast<AlgebraicNode*>(el_pt->node_pt(n))
803  ->add_node_update_info(Central_region, // enumerated ID
804  this, // mesh
805  geom_object_pt, // vector of geom objects
806  ref_value); // vector of ref. values
807  }
808 
809  // Element 1: Bottom right region
810  //-------------------------------
811  else if (region_id == 1)
812  {
813  // Fractional distance between nodes
814  double fract = 1.0 / double(nnodes_1d - 1);
815 
816  // Fraction in the s_0-direction
817  double rho_0 = fract * double(n % nnodes_1d);
818 
819  // Fraction in the s_1-direction
820  double rho_1 = fract * double((n / nnodes_1d) % nnodes_1d);
821 
822  // Find coord of reference point on wall
827 
828  // Identify wall GeomObject and local coordinate of
829  // reference point in GeomObject
830  GeomObject* obj_wall_pt;
831  Vector<double> s_wall(2);
832  this->Wall_pt->locate_zeta(xi, obj_wall_pt, s_wall);
833 
834  // The update function requires three geometric objects
835  Vector<GeomObject*> geom_object_pt(3);
836 
837  // Wall element at bottom-right end of wall mesh:
838  geom_object_pt[0] = obj_br_pt;
839 
840  // Wall element at top left end of wall mesh:
841  geom_object_pt[1] = obj_tl_pt;
842 
843  // Wall element at that contians reference point:
844  geom_object_pt[2] = obj_wall_pt;
845 
846  // The update function requires nine parameters:
847  Vector<double> ref_value(9);
848 
849  // First reference value: fractional s0-position inside region
850  ref_value[0] = rho_0;
851 
852  // Second reference value: fractional s1-position inside region
853  ref_value[1] = rho_1;
854 
855  // Thrid reference value: initial z coord of node
856  ref_value[2] = z;
857 
858  // Fourth and fifth reference values:
859  // local coordinates at bottom-right of wall.
860  ref_value[3] = s_br[0];
861  ref_value[4] = s_br[1];
862 
863  // Sixth and seventh reference values:
864  // local coordinates at top-left of wall.
865  ref_value[5] = s_tl[0];
866  ref_value[6] = s_tl[1];
867 
868  // Eighth and ninth reference values:
869  // local coordinate of reference point.
870  ref_value[7] = s_wall[0];
871  ref_value[8] = s_wall[1];
872 
873  // Setup algebraic update for node: Pass update information
874  static_cast<AlgebraicNode*>(el_pt->node_pt(n))
875  ->add_node_update_info(Lower_right_region, // enumerated ID
876  this, // mesh
877  geom_object_pt, // vector of geom objects
878  ref_value); // vector of ref. vals
879  }
880 
881  // Element 2: Top left region
882  //---------------------------
883  else if (region_id == 2)
884  {
885  // Fractional distance between nodes
886  double fract = 1.0 / double(nnodes_1d - 1);
887 
888  // Fraction in the s_0-direction
889  double rho_0 = fract * double(n % nnodes_1d);
890 
891  // Fraction in the s_1-direction
892  double rho_1 = fract * double((n / nnodes_1d) % nnodes_1d);
893 
894  // Find coord of reference point on wall
896  rho_0 * (1.0 - QuarterTubeMesh<ELEMENT>::Fract_mid) *
899 
900  // Identify GeomObject and local coordinate at
901  // reference point on wall
902  GeomObject* obj_wall_pt;
903  Vector<double> s_wall(2);
904  this->Wall_pt->locate_zeta(xi, obj_wall_pt, s_wall);
905 
906  // The update function requires three geometric objects
907  Vector<GeomObject*> geom_object_pt(3);
908 
909  // Wall element at bottom-right of wall mesh:
910  geom_object_pt[0] = obj_br_pt;
911 
912  // Wall element at top-left of wall mesh:
913  geom_object_pt[1] = obj_tl_pt;
914 
915  // Wall element contianing reference point:
916  geom_object_pt[2] = obj_wall_pt;
917 
918  // The update function requires nine parameters:
919  Vector<double> ref_value(9);
920 
921  // First reference value: fractional s0-position inside region
922  ref_value[0] = rho_0;
923 
924  // Second reference value: fractional s1-position inside region
925  ref_value[1] = rho_1;
926 
927  // Third reference value: initial z coord
928  ref_value[2] = z;
929 
930  // Fourth and fifth reference values:
931  // local coordinates in bottom-right GeomObject
932  ref_value[3] = s_br[0];
933  ref_value[4] = s_br[1];
934 
935  // Sixth and seventh reference values:
936  // local coordinates in top-left GeomObject
937  ref_value[5] = s_tl[0];
938  ref_value[6] = s_tl[1];
939 
940  // Eighth and ninth reference values:
941  // local coordinates at reference point
942  ref_value[7] = s_wall[0];
943  ref_value[8] = s_wall[1];
944 
945  // Setup algebraic update for node: Pass update information
946  static_cast<AlgebraicNode*>(el_pt->node_pt(n))
947  ->add_node_update_info(Upper_left_region, // Enumerated ID
948  this, // mesh
949  geom_object_pt, // vector of geom objects
950  ref_value); // vector of ref. vals
951  }
952  }
953  }
954  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual unsigned nnode_1d() const
Definition: elements.h:2218
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: geom_objects.h:381
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition: mesh.h:460
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Vector< double > Xi_lo
Lower limits for the coordinates along the wall.
Definition: quarter_tube_mesh.template.h:127
GeomObject * Wall_pt
Pointer to the geometric object that represents the curved wall.
Definition: quarter_tube_mesh.template.h:124
Vector< double > Xi_hi
Upper limits for the coordinates along the wall.
Definition: quarter_tube_mesh.template.h:133
double Fract_mid
Fraction along wall where outer ring is to be divided.
Definition: quarter_tube_mesh.template.h:130
Scalar * y
Definition: level1_cplx_impl.h:128
list x
Definition: plotDoE.py:28

References e(), oomph::Mesh::element_pt(), oomph::Mesh::finite_element_pt(), n, plotDoE::name, oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nnode_1d(), oomph::FiniteElement::node_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Global_string_for_annotation::string(), plotDoE::x, oomph::Node::x(), and y.

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

◆ update_node_update()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::update_node_update ( AlgebraicNode *&  node_pt)
inlinevirtual

Update the node update info for specified algebraic node following any spatial mesh adaptation.

Implements oomph::AlgebraicMesh.

596  {
597  // Get all node update fct for this node (resizes internally)
598  Vector<int> id;
600 
601  // Loop over all update fcts
602  unsigned n_update = id.size();
603  for (unsigned i = 0; i < n_update; i++)
604  {
606  }
607  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void update_node_update_in_region(AlgebraicNode *&node_pt, int &region_id)
Definition: quarter_tube_mesh.template.cc:1288

References i, oomph::AlgebraicMesh::node_pt(), oomph::AlgebraicNode::node_update_fct_id(), and oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::update_node_update_in_region().

◆ update_node_update_in_region()

template<class ELEMENT >
void oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::update_node_update_in_region ( AlgebraicNode *&  node_pt,
int region_id 
)
private

Update algebraic node update function for nodes in the region defined by region_id

Update algebraic update function for nodes in region defined by region_id.

1290  {
1291  // Extract references by copy construction
1292  Vector<double> ref_value(node_pt->vector_ref_value(region_id));
1293 
1294  // Extract geometric objects for update by copy construction
1295  Vector<GeomObject*> geom_object_pt(
1296  node_pt->vector_geom_object_pt(region_id));
1297 
1298  // Now remove the update info to allow overwriting below
1299  node_pt->kill_node_update_info(region_id);
1300 
1301  // Fixed reference value: Start coordinate on wall
1302  double xi_lo = QuarterTubeMesh<ELEMENT>::Xi_lo[1];
1303 
1304  // Fixed reference value: Fractional position of dividing line
1305  double fract_mid = QuarterTubeMesh<ELEMENT>::Fract_mid;
1306 
1307  // Fixed reference value: End coordinate on wall
1308  double xi_hi = QuarterTubeMesh<ELEMENT>::Xi_hi[1];
1309 
1310  // get initial z-coordinate of node
1311  // NOTE: use modified z found using axial_spacing_fct()
1312  // to implement axial spacing
1313  double z = ref_value[2];
1314 
1315  // Update reference to wall point in bottom right corner
1316  //------------------------------------------------------
1317 
1318  // Wall position in bottom right corner:
1319  Vector<double> xi(2);
1320  xi[0] = z;
1321  xi[1] = xi_lo;
1322 
1323  // Find corresponding wall element/local coordinate
1324  GeomObject* obj_br_pt;
1325  Vector<double> s_br(2);
1326  this->Wall_pt->locate_zeta(xi, obj_br_pt, s_br);
1327 
1328  // Wall element at bottom right end of wall mesh:
1329  geom_object_pt[0] = obj_br_pt;
1330 
1331  // Local coordinate in this wall element.
1332  ref_value[3] = s_br[0];
1333  ref_value[4] = s_br[1];
1334 
1335 
1336  // Update reference to wall point in upper left corner
1337  //----------------------------------------------------
1338 
1339  // Wall position in top left corner
1340  xi[1] = xi_hi;
1341 
1342  // Find corresponding wall element/local coordinate
1343  GeomObject* obj_tl_pt;
1344  Vector<double> s_tl(2);
1345  this->Wall_pt->locate_zeta(xi, obj_tl_pt, s_tl);
1346 
1347  // Wall element at top left end of wall mesh:
1348  geom_object_pt[1] = obj_tl_pt;
1349 
1350  // Local coordinate in this wall element.
1351  ref_value[5] = s_tl[0];
1352  ref_value[6] = s_tl[1];
1353 
1354  if (region_id != Central_region)
1355  {
1356  // Update reference to reference point on wall
1357  //--------------------------------------------
1358 
1359  // Reference point on wall
1360  if (region_id == Lower_right_region)
1361  {
1362  // Second reference value: fractional s1-position of node inside region
1363  double rho_1 = ref_value[1];
1364 
1365  // position of reference point
1366  xi[1] = xi_lo + rho_1 * fract_mid * (xi_hi - xi_lo);
1367  }
1368  else // case of Upper_left region
1369  {
1370  // First reference value: fractional s0-position of node inside region
1371  double rho_0 = ref_value[0];
1372 
1373  // position of reference point
1374  xi[1] = xi_hi - rho_0 * (1.0 - fract_mid) * (xi_hi - xi_lo);
1375  }
1376 
1377  // Identify wall element number and local coordinate of
1378  // reference point on wall
1379  GeomObject* obj_wall_pt;
1380  Vector<double> s_wall(2);
1381  this->Wall_pt->locate_zeta(xi, obj_wall_pt, s_wall);
1382 
1383  // Wall element at that contians reference point:
1384  geom_object_pt[2] = obj_wall_pt;
1385 
1386  // Local coordinate in this wall element.
1387  ref_value[7] = s_wall[0];
1388  ref_value[8] = s_wall[1];
1389  }
1390 
1391  // Setup algebraic update for node: Pass update information
1392  node_pt->add_node_update_info(region_id, // Enumerated ID
1393  this, // mesh
1394  geom_object_pt, // vector of geom objects
1395  ref_value); // vector of ref. vals
1396  }
void kill_node_update_info(const int &id=0)
Definition: algebraic_elements.h:365
void add_node_update_info(const int &id, AlgebraicMesh *mesh_pt, const Vector< GeomObject * > &geom_object_pt, const Vector< double > &ref_value, const bool &called_from_constructor=false)
Definition: algebraic_elements.h:280

References oomph::AlgebraicNode::add_node_update_info(), oomph::AlgebraicNode::kill_node_update_info(), oomph::AlgebraicNode::vector_geom_object_pt(), and oomph::AlgebraicNode::vector_ref_value().

Referenced by oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::update_node_update().

Member Data Documentation

◆ Centre_box_size

template<class ELEMENT >
double oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Centre_box_size
private

Size of centre box.

◆ Lambda_x

template<class ELEMENT >
double oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Lambda_x
private

Fractional width of central region.

◆ Lambda_y

template<class ELEMENT >
double oomph::AlgebraicRefineableQuarterTubeMesh< ELEMENT >::Lambda_y
private

Fractional height of central region.


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