oomph::TriangleMeshCurviLine Class Reference

#include <unstructured_two_d_mesh_geometry_base.h>

+ Inheritance diagram for oomph::TriangleMeshCurviLine:

Public Member Functions

 TriangleMeshCurviLine (GeomObject *geom_object_pt, const double &zeta_start, const double &zeta_end, const unsigned &nsegment, const unsigned &boundary_id, const bool &space_vertices_evenly_in_arclength=true, const unsigned &boundary_chunk=0)
 
virtual ~TriangleMeshCurviLine ()
 Empty Destuctor. More...
 
GeomObjectgeom_object_pt ()
 Pointer to GeomObject that represents this part of the boundary. More...
 
double zeta_start ()
 Start coordinate in terms of the GeomObject's intrinsic coordinate. More...
 
double zeta_end ()
 End coordinate in terms of the GeomObject's intrinsic coordinate. More...
 
unsigned nsegment () const
 
unsignednsegment ()
 
unsigned boundary_id () const
 Boundary ID. More...
 
unsigned boundary_chunk () const
 
void output (std::ostream &outfile, const unsigned &n_sample=50)
 Output curvilinear boundary at n_sample (default: 50) points. More...
 
bool space_vertices_evenly_in_arclength () const
 
unsigned nvertex () const
 Number of vertices. More...
 
void initial_vertex_coordinate (Vector< double > &vertex)
 Get first vertex coordinates. More...
 
void final_vertex_coordinate (Vector< double > &vertex)
 Get last vertex coordinates. More...
 
bool are_there_connection_points ()
 Does the vector for storing connections has elements? More...
 
Vector< double > * connection_points_pt ()
 Returns the connection points vector. More...
 
void add_connection_point (const double &z_value, const double &tol=1.0e-12)
 
- Public Member Functions inherited from oomph::TriangleMeshCurveSection
 TriangleMeshCurveSection ()
 Empty constructor. Initialises the curve section as non connected. More...
 
virtual ~TriangleMeshCurveSection ()
 Empty destructor. More...
 
void enable_refinement_tolerance (const double &tolerance=0.08)
 
void set_refinement_tolerance (const double &tolerance)
 
double refinement_tolerance ()
 
void disable_refinement_tolerance ()
 Disable refinement of curve section. More...
 
void enable_unrefinement_tolerance (const double &tolerance=0.04)
 
void set_unrefinement_tolerance (const double &tolerance)
 
double unrefinement_tolerance ()
 
void disable_unrefinement_tolerance ()
 Disable unrefinement of curve sections. More...
 
void set_maximum_length (const double &maximum_length)
 
void disable_use_maximum_length ()
 
double maximum_length ()
 Gets access to the maximum length variable. More...
 
void connect_initial_vertex_to_polyline (TriangleMeshPolyLine *polyline_pt, const unsigned &vertex_number, const double &tolerance_for_connection=1.0e-14)
 
void connect_final_vertex_to_polyline (TriangleMeshPolyLine *polyline_pt, const unsigned &vertex_number, const double &tolerance_for_connection=1.0e-14)
 
void connect_initial_vertex_to_curviline (TriangleMeshCurviLine *curviline_pt, const double &s_value, const double &tolerance_for_connection=1.0e-14)
 
void connect_final_vertex_to_curviline (TriangleMeshCurviLine *curviline_pt, const double &s_value, const double &tolerance_for_connection=1.0e-14)
 
bool is_initial_vertex_connected () const
 Test whether initial vertex is connected or not. More...
 
void set_initial_vertex_connected ()
 Sets the initial vertex as connected. More...
 
void unset_initial_vertex_connected ()
 Sets the initial vertex as non connected. More...
 
void suspend_initial_vertex_connected ()
 
void resume_initial_vertex_connected ()
 
bool is_final_vertex_connected () const
 Test whether final vertex is connected or not. More...
 
void set_final_vertex_connected ()
 Sets the final vertex as connected. More...
 
void unset_final_vertex_connected ()
 Sets the final vertex as non connected. More...
 
void suspend_final_vertex_connected ()
 
void resume_final_vertex_connected ()
 
unsigned initial_vertex_connected_bnd_id () const
 Gets the id to which the initial end is connected. More...
 
unsignedinitial_vertex_connected_bnd_id ()
 Sets the id to which the initial end is connected. More...
 
unsigned initial_vertex_connected_n_vertex () const
 Gets the vertex number to which the initial end is connected. More...
 
unsignedinitial_vertex_connected_n_vertex ()
 Sets the vertex number to which the initial end is connected. More...
 
unsigned initial_vertex_connected_n_chunk () const
 Gets the boundary chunk to which the initial end is connected. More...
 
unsignedinitial_vertex_connected_n_chunk ()
 Sets the boundary chunk to which the initial end is connected. More...
 
unsigned final_vertex_connected_bnd_id () const
 Gets the id to which the final end is connected. More...
 
unsignedfinal_vertex_connected_bnd_id ()
 Sets the id to which the final end is connected. More...
 
unsigned final_vertex_connected_n_vertex () const
 Sets the vertex number to which the final end is connected. More...
 
unsignedfinal_vertex_connected_n_vertex ()
 Gets the vertex number to which the final end is connected. More...
 
unsigned final_vertex_connected_n_chunk () const
 Gets the boundary chunk to which the final end is connected. More...
 
unsignedfinal_vertex_connected_n_chunk ()
 Sets the boundary chunk to which the final end is connected. More...
 
bool is_initial_vertex_connected_to_curviline () const
 Test whether the initial vertex is connected to a curviline. More...
 
void set_initial_vertex_connected_to_curviline ()
 Sets the initial vertex as connected to a curviline. More...
 
void unset_initial_vertex_connected_to_curviline ()
 Sets the initial vertex as non connected to a curviline. More...
 
bool is_final_vertex_connected_to_curviline () const
 Test whether the final vertex is connected to a curviline. More...
 
void set_final_vertex_connected_to_curviline ()
 Sets the final vertex as connected to a curviline. More...
 
void unset_final_vertex_connected_to_curviline ()
 Sets the final vertex as non connected to a curviline. More...
 
double initial_s_connection_value () const
 Gets the s value to which the initial end is connected. More...
 
doubleinitial_s_connection_value ()
 Sets the s value to which the initial end is connected. More...
 
double final_s_connection_value () const
 Gets the s value to which the final end is connected. More...
 
doublefinal_s_connection_value ()
 Sets the s value to which the final end is connected. More...
 
double tolerance_for_s_connection () const
 
doubletolerance_for_s_connection ()
 

Private Attributes

GeomObjectGeom_object_pt
 Pointer to GeomObject that represents this part of the boundary. More...
 
double Zeta_start
 Start coordinate in terms of the GeomObject's intrinsic coordinate. More...
 
double Zeta_end
 End coordinate in terms of the GeomObject's intrinsic coordinate. More...
 
unsigned Nsegment
 
unsigned Boundary_id
 Boundary ID. More...
 
bool Space_vertices_evenly_in_arclength
 
unsigned Boundary_chunk
 
Vector< doubleConnection_points_pt
 

Additional Inherited Members

- Protected Attributes inherited from oomph::TriangleMeshCurveSection
bool Initial_vertex_connected
 
bool Final_vertex_connected
 
bool Initial_vertex_connected_suspended
 
bool Final_vertex_connected_suspended
 
unsigned Initial_vertex_connected_bnd_id
 Stores the id to which the initial end is connected. More...
 
unsigned Initial_vertex_connected_n_vertex
 
unsigned Initial_vertex_connected_n_chunk
 
unsigned Final_vertex_connected_bnd_id
 Stores the id to which the initial end is connected. More...
 
unsigned Final_vertex_connected_n_vertex
 
unsigned Final_vertex_connected_n_chunk
 
bool Initial_vertex_connected_to_curviline
 States if the initial vertex is connected to a curviline. More...
 
bool Final_vertex_connected_to_curviline
 States if the final vertex is connected to a curviline. More...
 
double Initial_s_connection_value
 
double Final_s_connection_value
 
double Tolerance_for_s_connection
 Tolerance used for connecting the ends to a curviline. More...
 

Detailed Description

Class definining a curvilinear triangle mesh boundary in terms of a GeomObject. Curvlinear equivalent of PolyLine.

Constructor & Destructor Documentation

◆ TriangleMeshCurviLine()

oomph::TriangleMeshCurviLine::TriangleMeshCurviLine ( GeomObject geom_object_pt,
const double zeta_start,
const double zeta_end,
const unsigned nsegment,
const unsigned boundary_id,
const bool space_vertices_evenly_in_arclength = true,
const unsigned boundary_chunk = 0 
)
inline

Constructor: Specify GeomObject, the start and end coordinates of the relevant boundary in terms of the GeomObject's intrinsic coordinate, the number of (initially straight-line) segments that this GeomObject is to be split up into, and the boundary ID. The final optional boolean argument specifies if vertices in polygonhal represenation are spaced (approximately) evenly in arclength along the GeomObject [true, default] or in equal increments in zeta. This is the curvlinear equivalent of PolyLine.

688  {
689  }
TriangleMeshCurveSection()
Empty constructor. Initialises the curve section as non connected.
Definition: unstructured_two_d_mesh_geometry_base.h:166
GeomObject * geom_object_pt()
Pointer to GeomObject that represents this part of the boundary.
Definition: unstructured_two_d_mesh_geometry_base.h:696
unsigned Boundary_id
Boundary ID.
Definition: unstructured_two_d_mesh_geometry_base.h:847
bool Space_vertices_evenly_in_arclength
Definition: unstructured_two_d_mesh_geometry_base.h:852
unsigned boundary_chunk() const
Definition: unstructured_two_d_mesh_geometry_base.h:736
double Zeta_end
End coordinate in terms of the GeomObject's intrinsic coordinate.
Definition: unstructured_two_d_mesh_geometry_base.h:840
double zeta_start()
Start coordinate in terms of the GeomObject's intrinsic coordinate.
Definition: unstructured_two_d_mesh_geometry_base.h:702
GeomObject * Geom_object_pt
Pointer to GeomObject that represents this part of the boundary.
Definition: unstructured_two_d_mesh_geometry_base.h:834
unsigned Boundary_chunk
Definition: unstructured_two_d_mesh_geometry_base.h:856
double Zeta_start
Start coordinate in terms of the GeomObject's intrinsic coordinate.
Definition: unstructured_two_d_mesh_geometry_base.h:837
unsigned boundary_id() const
Boundary ID.
Definition: unstructured_two_d_mesh_geometry_base.h:729
double zeta_end()
End coordinate in terms of the GeomObject's intrinsic coordinate.
Definition: unstructured_two_d_mesh_geometry_base.h:708
unsigned Nsegment
Definition: unstructured_two_d_mesh_geometry_base.h:844
bool space_vertices_evenly_in_arclength() const
Definition: unstructured_two_d_mesh_geometry_base.h:759
unsigned nsegment() const
Definition: unstructured_two_d_mesh_geometry_base.h:715

◆ ~TriangleMeshCurviLine()

virtual oomph::TriangleMeshCurviLine::~TriangleMeshCurviLine ( )
inlinevirtual

Empty Destuctor.

693 {}

Member Function Documentation

◆ add_connection_point()

void oomph::TriangleMeshCurviLine::add_connection_point ( const double z_value,
const double tol = 1.0e-12 
)
inline

Add the connection point (z_value) to the connection points that receive the curviline

802  {
803  // If we are trying to connect to the initial or final
804  // point then it is not necessary to add this point
805  // to the list since it will explicitly be created when
806  // transforming the curviline to polyline
807  if (std::fabs(z_value - Zeta_start) < tol ||
808  std::fabs(z_value - Zeta_end) < tol)
809  {
810  return;
811  }
812 
813  // We need to deal with repeated connection points,
814  // if the connection point is already in the list then
815  // we will not add it!!!
816  // Search for repeated elements
817  unsigned n_size = Connection_points_pt.size();
818  for (unsigned i = 0; i < n_size; i++)
819  {
820  if (fabs(z_value - Connection_points_pt[i]) < tol)
821  {
822  return;
823  }
824  }
825 
826  // Only add the connection point if it is not the
827  // initial or final zeta value and it is not already on the
828  // list
829  Connection_points_pt.push_back(z_value);
830  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector< double > Connection_points_pt
Definition: unstructured_two_d_mesh_geometry_base.h:860
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117

References Connection_points_pt, boost::multiprecision::fabs(), i, Zeta_end, and Zeta_start.

Referenced by oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline(), and oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline().

◆ are_there_connection_points()

bool oomph::TriangleMeshCurviLine::are_there_connection_points ( )
inline

Does the vector for storing connections has elements?

788  {
789  return !Connection_points_pt.empty();
790  }

References Connection_points_pt.

◆ boundary_chunk()

unsigned oomph::TriangleMeshCurviLine::boundary_chunk ( ) const
inlinevirtual

Boundary chunk (Used when a boundary is represented by more than one polyline

Implements oomph::TriangleMeshCurveSection.

737  {
738  return Boundary_chunk;
739  }

References Boundary_chunk.

Referenced by oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline(), and oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline().

◆ boundary_id()

unsigned oomph::TriangleMeshCurviLine::boundary_id ( ) const
inlinevirtual

◆ connection_points_pt()

Vector<double>* oomph::TriangleMeshCurviLine::connection_points_pt ( )
inline

Returns the connection points vector.

794  {
795  return &Connection_points_pt;
796  }

References Connection_points_pt.

◆ final_vertex_coordinate()

void oomph::TriangleMeshCurviLine::final_vertex_coordinate ( Vector< double > &  vertex)
inlinevirtual

Get last vertex coordinates.

Implements oomph::TriangleMeshCurveSection.

780  {
781  Vector<double> z(1);
782  z[0] = Zeta_end;
783  Geom_object_pt->position(z, vertex);
784  }
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).

References Geom_object_pt, oomph::GeomObject::position(), and Zeta_end.

◆ geom_object_pt()

GeomObject* oomph::TriangleMeshCurviLine::geom_object_pt ( )
inline

Pointer to GeomObject that represents this part of the boundary.

697  {
698  return Geom_object_pt;
699  }

References Geom_object_pt.

Referenced by oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline(), and oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline().

◆ initial_vertex_coordinate()

void oomph::TriangleMeshCurviLine::initial_vertex_coordinate ( Vector< double > &  vertex)
inlinevirtual

Get first vertex coordinates.

Implements oomph::TriangleMeshCurveSection.

772  {
773  Vector<double> z(1);
774  z[0] = Zeta_start;
775  Geom_object_pt->position(z, vertex);
776  }

References Geom_object_pt, oomph::GeomObject::position(), and Zeta_start.

◆ nsegment() [1/2]

unsigned& oomph::TriangleMeshCurviLine::nsegment ( )
inline

Number of (initially straight-line) segments that this part of the boundary is to be represented by. This version allows the change of the number of segments

724  {
725  return Nsegment;
726  }

References Nsegment.

◆ nsegment() [2/2]

unsigned oomph::TriangleMeshCurviLine::nsegment ( ) const
inlinevirtual

Number of (initially straight-line) segments that this part of the boundary is to be represented by

Implements oomph::TriangleMeshCurveSection.

716  {
717  return Nsegment;
718  }

References Nsegment.

◆ nvertex()

unsigned oomph::TriangleMeshCurviLine::nvertex ( ) const
inlinevirtual

Number of vertices.

Implements oomph::TriangleMeshCurveSection.

766  {
767  return 2;
768  }

◆ output()

void oomph::TriangleMeshCurviLine::output ( std::ostream &  outfile,
const unsigned n_sample = 50 
)
inlinevirtual

Output curvilinear boundary at n_sample (default: 50) points.

Implements oomph::TriangleMeshCurveSection.

743  {
744  outfile << "ZONE T=\"Boundary " << Boundary_id << "\"\n";
745  Vector<double> zeta(1);
746  Vector<double> r(2);
747  for (unsigned i = 0; i < n_sample; i++)
748  {
749  zeta[0] = Zeta_start +
750  (Zeta_end - Zeta_start) * double(i) / double(n_sample - 1);
752  outfile << r[0] << " " << r[1] << std::endl;
753  }
754  }
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
r
Definition: UniformPSDSelfTest.py:20

References Boundary_id, Geom_object_pt, i, oomph::GeomObject::position(), UniformPSDSelfTest::r, Eigen::zeta(), Zeta_end, and Zeta_start.

◆ space_vertices_evenly_in_arclength()

bool oomph::TriangleMeshCurviLine::space_vertices_evenly_in_arclength ( ) const
inline

Boolean to indicate if vertices in polygonal representation of the Curvline are spaced (approximately) evenly in arclength along the GeomObject [true] or in equal increments in zeta [false]

760  {
762  }

References Space_vertices_evenly_in_arclength.

◆ zeta_end()

double oomph::TriangleMeshCurviLine::zeta_end ( )
inline

End coordinate in terms of the GeomObject's intrinsic coordinate.

709  {
710  return Zeta_end;
711  }

References Zeta_end.

Referenced by oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline(), and oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline().

◆ zeta_start()

double oomph::TriangleMeshCurviLine::zeta_start ( )
inline

Start coordinate in terms of the GeomObject's intrinsic coordinate.

703  {
704  return Zeta_start;
705  }

References Zeta_start.

Referenced by oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline(), and oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline().

Member Data Documentation

◆ Boundary_chunk

unsigned oomph::TriangleMeshCurviLine::Boundary_chunk
private

Boundary chunk (Used when a boundary is represented by more than one polyline

Referenced by boundary_chunk().

◆ Boundary_id

unsigned oomph::TriangleMeshCurviLine::Boundary_id
private

Boundary ID.

Referenced by boundary_id(), and output().

◆ Connection_points_pt

Vector<double> oomph::TriangleMeshCurviLine::Connection_points_pt
private

Stores the information for connections received on the curviline. Used when converting to polyline

Referenced by add_connection_point(), are_there_connection_points(), and connection_points_pt().

◆ Geom_object_pt

GeomObject* oomph::TriangleMeshCurviLine::Geom_object_pt
private

Pointer to GeomObject that represents this part of the boundary.

Referenced by final_vertex_coordinate(), geom_object_pt(), initial_vertex_coordinate(), and output().

◆ Nsegment

unsigned oomph::TriangleMeshCurviLine::Nsegment
private

Number of (initially straight-line) segments that this part of the boundary is to be represented by

Referenced by nsegment().

◆ Space_vertices_evenly_in_arclength

bool oomph::TriangleMeshCurviLine::Space_vertices_evenly_in_arclength
private

Boolean to indicate if vertices in polygonal representation of the Curviline are spaced (approximately) evenly in arclength along the GeomObject [true] or in equal increments in zeta [false]

Referenced by space_vertices_evenly_in_arclength().

◆ Zeta_end

double oomph::TriangleMeshCurviLine::Zeta_end
private

End coordinate in terms of the GeomObject's intrinsic coordinate.

Referenced by add_connection_point(), final_vertex_coordinate(), output(), and zeta_end().

◆ Zeta_start

double oomph::TriangleMeshCurviLine::Zeta_start
private

Start coordinate in terms of the GeomObject's intrinsic coordinate.

Referenced by add_connection_point(), initial_vertex_coordinate(), output(), and zeta_start().


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