oomph::TriangleMeshCurveSection Class Referenceabstract

#include <unstructured_two_d_mesh_geometry_base.h>

+ Inheritance diagram for oomph::TriangleMeshCurveSection:

Public Member Functions

 TriangleMeshCurveSection ()
 Empty constructor. Initialises the curve section as non connected. More...
 
virtual ~TriangleMeshCurveSection ()
 Empty destructor. More...
 
virtual unsigned nsegment () const =0
 
virtual unsigned boundary_id () const =0
 Boundary id. More...
 
virtual unsigned boundary_chunk () const =0
 
virtual unsigned nvertex () const =0
 Number of vertices. More...
 
virtual void output (std::ostream &outfile, const unsigned &n_sample=50)=0
 Output the curve_section. 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...
 
virtual void initial_vertex_coordinate (Vector< double > &vertex)=0
 Get first vertex coordinates. More...
 
virtual void final_vertex_coordinate (Vector< double > &vertex)=0
 Get last vertex coordinates. 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 ()
 

Protected Attributes

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...
 

Private Attributes

double Refinement_tolerance
 
double Unrefinement_tolerance
 
double Maximum_length
 

Detailed Description

Base class for defining a triangle mesh boundary, this class has the methods that allow to connect the initial and final ends to other triangle mesh boundaries

Constructor & Destructor Documentation

◆ TriangleMeshCurveSection()

oomph::TriangleMeshCurveSection::TriangleMeshCurveSection ( )
inline

Empty constructor. Initialises the curve section as non connected.

167  : Initial_vertex_connected(false),
168  Final_vertex_connected(false),
173  Refinement_tolerance(0.08),
175  Maximum_length(-1.0)
176  {
177  }
bool Final_vertex_connected_suspended
Definition: unstructured_two_d_mesh_geometry_base.h:601
bool Initial_vertex_connected_to_curviline
States if the initial vertex is connected to a curviline.
Definition: unstructured_two_d_mesh_geometry_base.h:626
bool Final_vertex_connected
Definition: unstructured_two_d_mesh_geometry_base.h:591
double Unrefinement_tolerance
Definition: unstructured_two_d_mesh_geometry_base.h:649
bool Final_vertex_connected_to_curviline
States if the final vertex is connected to a curviline.
Definition: unstructured_two_d_mesh_geometry_base.h:629
double Refinement_tolerance
Definition: unstructured_two_d_mesh_geometry_base.h:645
double Maximum_length
Definition: unstructured_two_d_mesh_geometry_base.h:653
bool Initial_vertex_connected
Definition: unstructured_two_d_mesh_geometry_base.h:587
bool Initial_vertex_connected_suspended
Definition: unstructured_two_d_mesh_geometry_base.h:596

◆ ~TriangleMeshCurveSection()

virtual oomph::TriangleMeshCurveSection::~TriangleMeshCurveSection ( )
inlinevirtual

Empty destructor.

180 {}

Member Function Documentation

◆ boundary_chunk()

virtual unsigned oomph::TriangleMeshCurveSection::boundary_chunk ( ) const
pure virtual

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

Implemented in oomph::TriangleMeshPolyLine, and oomph::TriangleMeshCurviLine.

◆ boundary_id()

virtual unsigned oomph::TriangleMeshCurveSection::boundary_id ( ) const
pure virtual

◆ connect_final_vertex_to_curviline()

void oomph::TriangleMeshCurveSection::connect_final_vertex_to_curviline ( TriangleMeshCurviLine curviline_pt,
const double s_value,
const double tolerance_for_connection = 1.0e-14 
)

Connects the final vertex of the curve section to a desired target curviline by specifying the s value (intrinsic value on the geometric object of the curviline) where to connect on the target curviline. There is a checking which verifies that the final vertex and the coordinates on the given s value are close enough by no more than the given tolerance

target curviline by specifying the s value (intrinsic value on the geometric object of the curviline) where to connect on the target curviline. There is a checking which verifies that the final vertex and the coordinates on the given s value are close enough by no more than the given tolerance

1342  {
1343 #ifdef PARANOID
1344  double z_initial = curviline_pt->zeta_start();
1345  double z_final = curviline_pt->zeta_end();
1346  double z_max = std::max(z_initial, z_final);
1347  double z_min = std::min(z_initial, z_final);
1348  if (s_value < z_min || z_max < s_value)
1349  {
1350  std::ostringstream error_stream;
1351  error_stream << "The s value you provided for connection (" << s_value
1352  << ") is out\nof the limits of the specified "
1353  << "TriangleMeshCurviLine.\nThe limits are [" << z_initial
1354  << ", " << z_final << "]" << std::endl
1355  << "Source boundary (" << boundary_id()
1356  << ") wants to connect "
1357  << "to destination boundary (" << curviline_pt->boundary_id()
1358  << ")" << std::endl;
1359  throw OomphLibError(
1360  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1361  }
1362 
1363  // Verify if there is really a match point in the specified
1364  // connection values
1365  Vector<double> v_src(2);
1366  Vector<double> v_dst(2);
1367  Vector<double> z(1);
1368 
1369  this->final_vertex_coordinate(v_src);
1370  z[0] = s_value;
1371  curviline_pt->geom_object_pt()->position(z, v_dst);
1372 
1373  double error = sqrt((v_src[0] - v_dst[0]) * (v_src[0] - v_dst[0]) +
1374  (v_src[1] - v_dst[1]) * (v_src[1] - v_dst[1]));
1375 
1376  if (error >= tolerance_for_connection)
1377  {
1378  std::ostringstream error_stream;
1379  error_stream
1380  << "The associated vertex for the provided connection s value\n"
1381  << "are not close enough. Their respective values are:\n"
1382  << "Source boundary id:(" << this->boundary_id() << ")\n"
1383  << "Source vertex x:(" << v_src[0] << ") y:(" << v_src[1] << ")\n"
1384  << "Destination boundary id:(" << curviline_pt->boundary_id() << ")"
1385  << "\nDestination s value (" << s_value << ")\n"
1386  << "Associated vertex x:(" << v_dst[0] << ") y:(" << v_dst[1] << ")"
1387  << "\nThe corresponding distance is: (" << error << ") but the "
1388  << "allowed\ntolerance is: (" << tolerance_for_connection << ")"
1389  << std::endl;
1390  throw OomphLibError(
1391  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1392  }
1393 
1394 #endif
1395 
1397  Final_vertex_connected = true;
1398  Final_vertex_connected_bnd_id = curviline_pt->boundary_id();
1399  Final_vertex_connected_n_chunk = curviline_pt->boundary_chunk();
1400 
1401  // We are still not able to compute the vertex number but we can
1402  // at least store the corresponding s value.
1403  // The corresponding vertex will be computed when the curviline be
1404  // transformed into a polyline
1405  Final_s_connection_value = s_value;
1406  Tolerance_for_s_connection = tolerance_for_connection;
1407 
1408  curviline_pt->add_connection_point(s_value, tolerance_for_connection);
1409  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
virtual unsigned boundary_id() const =0
Boundary id.
double Final_s_connection_value
Definition: unstructured_two_d_mesh_geometry_base.h:637
unsigned Final_vertex_connected_bnd_id
Stores the id to which the initial end is connected.
Definition: unstructured_two_d_mesh_geometry_base.h:615
double Tolerance_for_s_connection
Tolerance used for connecting the ends to a curviline.
Definition: unstructured_two_d_mesh_geometry_base.h:640
virtual void final_vertex_coordinate(Vector< double > &vertex)=0
Get last vertex coordinates.
unsigned Final_vertex_connected_n_chunk
Definition: unstructured_two_d_mesh_geometry_base.h:623
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
int error
Definition: calibrate.py:297
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::TriangleMeshCurviLine::add_connection_point(), oomph::TriangleMeshCurviLine::boundary_chunk(), oomph::TriangleMeshCurviLine::boundary_id(), boundary_id(), calibrate::error, Final_s_connection_value, Final_vertex_connected, Final_vertex_connected_bnd_id, Final_vertex_connected_n_chunk, Final_vertex_connected_to_curviline, final_vertex_coordinate(), oomph::TriangleMeshCurviLine::geom_object_pt(), max, min, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), sqrt(), Tolerance_for_s_connection, oomph::TriangleMeshCurviLine::zeta_end(), and oomph::TriangleMeshCurviLine::zeta_start().

Referenced by UnstructuredFvKProblem< ELEMENT >::UnstructuredFvKProblem().

◆ connect_final_vertex_to_polyline()

void oomph::TriangleMeshCurveSection::connect_final_vertex_to_polyline ( TriangleMeshPolyLine polyline_pt,
const unsigned vertex_number,
const double tolerance_for_connection = 1.0e-14 
)

Connects the final vertex of the curve section to a desired target polyline by specifying the vertex number. There is a checking which verifies that the final vertex is close enough to the destination vertex on the target polyline by no more than the specified tolerance

target polyline by specifying the vertex number. There is a checking which verifies that the final vertex is close enough to the destination vertex on the target polyline by no more than the specified tolerance

1193  {
1194 #ifdef PARANOID
1195  unsigned n_vertices = polyline_pt->nvertex();
1196 
1197  if (n_vertices <= vertex_number)
1198  {
1199  std::ostringstream error_stream;
1200  error_stream << "The vertex number you provided (" << vertex_number
1201  << ") is greater\n than the number of vertices ("
1202  << n_vertices << "in the specified TriangleMeshPolyLine.\n"
1203  << "Remember that the vertex index starts at 0" << std::endl
1204  << "Source boundary (" << boundary_id()
1205  << ") wants to connect "
1206  << "to destination boundary (" << polyline_pt->boundary_id()
1207  << ")" << std::endl;
1208  throw OomphLibError(
1209  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1210  }
1211 
1212  // Verify if there is really a match point in the specified
1213  // connection values
1214  Vector<double> v_src(2);
1215  Vector<double> v_dst(2);
1216 
1217  this->final_vertex_coordinate(v_src);
1218  v_dst = polyline_pt->vertex_coordinate(vertex_number);
1219 
1220  double error = sqrt((v_src[0] - v_dst[0]) * (v_src[0] - v_dst[0]) +
1221  (v_src[1] - v_dst[1]) * (v_src[1] - v_dst[1]));
1222 
1223  if (error > tolerance_for_connection)
1224  {
1225  std::ostringstream error_stream;
1226  error_stream << "The associated vertices for the connection"
1227  << "\nare not close enough. Their respective values are:\n"
1228  << "Source boundary id:(" << this->boundary_id() << ")\n"
1229  << "Source vertex x:(" << v_src[0] << ") y:(" << v_src[1]
1230  << ")\n"
1231  << "Destination boundary id:(" << polyline_pt->boundary_id()
1232  << ")"
1233  << "\nAssociated vertex x:(" << v_dst[0] << ") y:("
1234  << v_dst[1] << ")"
1235  << "\nThe corresponding distance is: (" << error
1236  << ") but the "
1237  << "allowed\ntolerance is: (" << tolerance_for_connection
1238  << ")" << std::endl;
1239  throw OomphLibError(
1240  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1241  }
1242 
1243 #endif
1244 
1245  Final_vertex_connected = true;
1246  Final_vertex_connected_bnd_id = polyline_pt->boundary_id();
1247  Final_vertex_connected_n_vertex = vertex_number;
1248  Final_vertex_connected_n_chunk = polyline_pt->boundary_chunk();
1249  }
unsigned Final_vertex_connected_n_vertex
Definition: unstructured_two_d_mesh_geometry_base.h:619

References oomph::TriangleMeshPolyLine::boundary_chunk(), oomph::TriangleMeshPolyLine::boundary_id(), boundary_id(), calibrate::error, Final_vertex_connected, Final_vertex_connected_bnd_id, Final_vertex_connected_n_chunk, Final_vertex_connected_n_vertex, final_vertex_coordinate(), oomph::TriangleMeshPolyLine::nvertex(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, sqrt(), and oomph::TriangleMeshPolyLine::vertex_coordinate().

Referenced by MeltContactProblem< ELEMENT >::MeltContactProblem(), SolarRadiationProblem< ELEMENT >::SolarRadiationProblem(), and TwoLayerInterfaceProblem< ELEMENT >::TwoLayerInterfaceProblem().

◆ connect_initial_vertex_to_curviline()

void oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline ( TriangleMeshCurviLine curviline_pt,
const double s_value,
const double tolerance_for_connection = 1.0e-14 
)

Connects the initial vertex of the curve section to a desired target curviline by specifying the s value (intrinsic value on the geometric object of the curviline) where to connect on the target curviline. There is a checking which verifies that the initial vertex and the coordinates on the given s value are close enough by no more than the given tolerance

target curviline by specifying the s value (intrinsic value on the geometric object of the curviline) where to connect on the target curviline. There is a checking which verifies that the initial vertex and the coordinates on the given s value are close enough by no more than the given tolerance

1263  {
1264 #ifdef PARANOID
1265  double z_initial = curviline_pt->zeta_start();
1266  double z_final = curviline_pt->zeta_end();
1267  double z_max = std::max(z_initial, z_final);
1268  double z_min = std::min(z_initial, z_final);
1269  if (s_value < z_min || z_max < s_value)
1270  {
1271  std::ostringstream error_stream;
1272  error_stream << "The s value you provided for connection (" << s_value
1273  << ") is out\nof the limits of the specified "
1274  << "TriangleMeshCurviLine.\nThe limits are [" << z_initial
1275  << ", " << z_final << "]" << std::endl
1276  << "Source boundary (" << boundary_id()
1277  << ") wants to connect "
1278  << "to destination boundary (" << curviline_pt->boundary_id()
1279  << ")" << std::endl;
1280  throw OomphLibError(
1281  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1282  }
1283 
1284  // Verify if there is really a match point in the specified
1285  // connection values
1286  Vector<double> v_src(2);
1287  Vector<double> v_dst(2);
1288  Vector<double> z(1);
1289 
1290  this->initial_vertex_coordinate(v_src);
1291  z[0] = s_value;
1292  curviline_pt->geom_object_pt()->position(z, v_dst);
1293  double error = sqrt((v_src[0] - v_dst[0]) * (v_src[0] - v_dst[0]) +
1294  (v_src[1] - v_dst[1]) * (v_src[1] - v_dst[1]));
1295  if (error >= tolerance_for_connection)
1296  {
1297  std::ostringstream error_stream;
1298  error_stream
1299  << "The associated vertex for the provided connection s value\n"
1300  << "are not close enough. Their respective values are:\n"
1301  << "Source boundary id:(" << this->boundary_id() << ")\n"
1302  << "Source vertex x:(" << v_src[0] << ") y:(" << v_src[1] << ")\n"
1303  << "Destination boundary id:(" << curviline_pt->boundary_id() << ")"
1304  << "\nDestination s value (" << s_value << ")\n"
1305  << "Associated vertex x:(" << v_dst[0] << ") y:(" << v_dst[1] << ")"
1306  << "\nThe corresponding distance is: (" << error << ") but the "
1307  << "allowed\ntolerance is: (" << tolerance_for_connection << ")"
1308  << std::endl;
1309  throw OomphLibError(
1310  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1311  }
1312 
1313 #endif
1314 
1316  Initial_vertex_connected = true;
1317  Initial_vertex_connected_bnd_id = curviline_pt->boundary_id();
1318  Initial_vertex_connected_n_chunk = curviline_pt->boundary_chunk();
1319 
1320  // We are still not able to compute the vertex number but we can
1321  // at least store the corresponding s value
1322  // The corresponding vertex will be computed when the curviline be
1323  // changed into a polyline
1324  Initial_s_connection_value = s_value;
1325  Tolerance_for_s_connection = tolerance_for_connection;
1326 
1327  curviline_pt->add_connection_point(s_value, tolerance_for_connection);
1328  }
virtual void initial_vertex_coordinate(Vector< double > &vertex)=0
Get first vertex coordinates.
double Initial_s_connection_value
Definition: unstructured_two_d_mesh_geometry_base.h:633
unsigned Initial_vertex_connected_n_chunk
Definition: unstructured_two_d_mesh_geometry_base.h:612
unsigned Initial_vertex_connected_bnd_id
Stores the id to which the initial end is connected.
Definition: unstructured_two_d_mesh_geometry_base.h:604

References oomph::TriangleMeshCurviLine::add_connection_point(), oomph::TriangleMeshCurviLine::boundary_chunk(), oomph::TriangleMeshCurviLine::boundary_id(), boundary_id(), calibrate::error, oomph::TriangleMeshCurviLine::geom_object_pt(), Initial_s_connection_value, Initial_vertex_connected, Initial_vertex_connected_bnd_id, Initial_vertex_connected_n_chunk, Initial_vertex_connected_to_curviline, initial_vertex_coordinate(), max, min, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::GeomObject::position(), sqrt(), Tolerance_for_s_connection, oomph::TriangleMeshCurviLine::zeta_end(), and oomph::TriangleMeshCurviLine::zeta_start().

Referenced by AxiPoroProblem< ELEMENT, TIMESTEPPER >::AxiPoroProblem(), and UnstructuredFvKProblem< ELEMENT >::UnstructuredFvKProblem().

◆ connect_initial_vertex_to_polyline()

void oomph::TriangleMeshCurveSection::connect_initial_vertex_to_polyline ( TriangleMeshPolyLine polyline_pt,
const unsigned vertex_number,
const double tolerance_for_connection = 1.0e-14 
)

Connects the initial vertex of the curve section to a desired target polyline by specifying the vertex number. There is a checking which verifies that the initial vertex is close enough to the destination vertex on the target polyline by no more than the specified tolerance

///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// target polyline by specifying the vertex number. There is a checking which verifies that the initial vertex is close enough to the destination vertex on the target polyline by no more than the specified tolerance

1124  {
1125 #ifdef PARANOID
1126  unsigned n_vertices = polyline_pt->nvertex();
1127 
1128  if (n_vertices <= vertex_number)
1129  {
1130  std::ostringstream error_stream;
1131  error_stream << "The vertex number you provided (" << vertex_number
1132  << ") is greater\n than the number of vertices ("
1133  << n_vertices << "in the specified TriangleMeshPolyLine.\n"
1134  << "Remember that the vertex index starts at 0" << std::endl
1135  << "Source boundary (" << boundary_id()
1136  << ") wants to connect "
1137  << "to destination boundary (" << polyline_pt->boundary_id()
1138  << ")" << std::endl;
1139  throw OomphLibError(
1140  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1141  }
1142 
1143  // Verify if there is really a match point in the specified
1144  // connection values
1145  Vector<double> v_src(2);
1146  Vector<double> v_dst(2);
1147 
1148  this->initial_vertex_coordinate(v_src);
1149  v_dst = polyline_pt->vertex_coordinate(vertex_number);
1150 
1151  double error = sqrt((v_src[0] - v_dst[0]) * (v_src[0] - v_dst[0]) +
1152  (v_src[1] - v_dst[1]) * (v_src[1] - v_dst[1]));
1153 
1154  if (error > tolerance_for_connection)
1155  {
1156  std::ostringstream error_stream;
1157  error_stream << "The associated vertices for the connection"
1158  << "\nare not close enough. Their respective values are:\n"
1159  << "Source boundary id:(" << this->boundary_id() << ")\n"
1160  << "Source vertex x:(" << v_src[0] << ") y:(" << v_src[1]
1161  << ")\n"
1162  << "Destination boundary id:(" << polyline_pt->boundary_id()
1163  << ")"
1164  << "\nAssociated vertex x:(" << v_dst[0] << ") y:("
1165  << v_dst[1] << ")"
1166  << "\nThe corresponding distance is: (" << error
1167  << ") but the "
1168  << "allowed\ntolerance is: (" << tolerance_for_connection
1169  << ")" << std::endl;
1170  throw OomphLibError(
1171  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1172  }
1173 
1174 #endif
1175 
1176  Initial_vertex_connected = true;
1177  Initial_vertex_connected_bnd_id = polyline_pt->boundary_id();
1178  Initial_vertex_connected_n_vertex = vertex_number;
1179  Initial_vertex_connected_n_chunk = polyline_pt->boundary_chunk();
1180  }
unsigned Initial_vertex_connected_n_vertex
Definition: unstructured_two_d_mesh_geometry_base.h:608

References oomph::TriangleMeshPolyLine::boundary_chunk(), oomph::TriangleMeshPolyLine::boundary_id(), boundary_id(), calibrate::error, Initial_vertex_connected, Initial_vertex_connected_bnd_id, Initial_vertex_connected_n_chunk, Initial_vertex_connected_n_vertex, initial_vertex_coordinate(), oomph::TriangleMeshPolyLine::nvertex(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, sqrt(), and oomph::TriangleMeshPolyLine::vertex_coordinate().

Referenced by MeltContactProblem< ELEMENT >::MeltContactProblem(), SolarRadiationProblem< ELEMENT >::SolarRadiationProblem(), TwoLayerInterfaceProblem< ELEMENT >::TwoLayerInterfaceProblem(), and UnstructuredFvKProblem< ELEMENT >::UnstructuredFvKProblem().

◆ disable_refinement_tolerance()

void oomph::TriangleMeshCurveSection::disable_refinement_tolerance ( )
inline

Disable refinement of curve section.

236  {
237  Refinement_tolerance = -1.0;
238  }

References Refinement_tolerance.

◆ disable_unrefinement_tolerance()

void oomph::TriangleMeshCurveSection::disable_unrefinement_tolerance ( )
inline

Disable unrefinement of curve sections.

277  {
278  Unrefinement_tolerance = -1.0;
279  }

References Unrefinement_tolerance.

◆ disable_use_maximum_length()

void oomph::TriangleMeshCurveSection::disable_use_maximum_length ( )
inline

Disables the use of the maximum length criteria on the unrefinement or refinement steps

292  {
293  Maximum_length = -1.0;
294  }

References Maximum_length.

◆ enable_refinement_tolerance()

void oomph::TriangleMeshCurveSection::enable_refinement_tolerance ( const double tolerance = 0.08)
inline

Enable refinement of curve section to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the refinement tolerance. It defaults to 0.08 and the smaller the number the finer the surface representation.

209  {
210  Refinement_tolerance = tolerance;
211  }

References Refinement_tolerance.

◆ enable_unrefinement_tolerance()

void oomph::TriangleMeshCurveSection::enable_unrefinement_tolerance ( const double tolerance = 0.04)
inline

Enable unrefinement of curve sections to avoid unnecessarily large numbers of elements on of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the unrefinement tolerance. It defaults to 0.04 and the larger the number the more agressive we are when removing unnecessary vertices on gently curved polylines.

247  {
248  Unrefinement_tolerance = tolerance;
249  }

References Unrefinement_tolerance.

◆ final_s_connection_value() [1/2]

double& oomph::TriangleMeshCurveSection::final_s_connection_value ( )
inline

Sets the s value to which the final end is connected.

566  {
568  }

References Final_s_connection_value.

◆ final_s_connection_value() [2/2]

double oomph::TriangleMeshCurveSection::final_s_connection_value ( ) const
inline

Gets the s value to which the final end is connected.

560  {
562  }

References Final_s_connection_value.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ final_vertex_connected_bnd_id() [1/2]

unsigned& oomph::TriangleMeshCurveSection::final_vertex_connected_bnd_id ( )
inline

Sets the id to which the final end is connected.

482  {
484  }

References Final_vertex_connected_bnd_id.

◆ final_vertex_connected_bnd_id() [2/2]

unsigned oomph::TriangleMeshCurveSection::final_vertex_connected_bnd_id ( ) const
inline

Gets the id to which the final end is connected.

476  {
478  }

References Final_vertex_connected_bnd_id.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ final_vertex_connected_n_chunk() [1/2]

unsigned& oomph::TriangleMeshCurveSection::final_vertex_connected_n_chunk ( )
inline

Sets the boundary chunk to which the final end is connected.

506  {
508  }

References Final_vertex_connected_n_chunk.

◆ final_vertex_connected_n_chunk() [2/2]

unsigned oomph::TriangleMeshCurveSection::final_vertex_connected_n_chunk ( ) const
inline

Gets the boundary chunk to which the final end is connected.

500  {
502  }

References Final_vertex_connected_n_chunk.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ final_vertex_connected_n_vertex() [1/2]

unsigned& oomph::TriangleMeshCurveSection::final_vertex_connected_n_vertex ( )
inline

Gets the vertex number to which the final end is connected.

494  {
496  }

References Final_vertex_connected_n_vertex.

◆ final_vertex_connected_n_vertex() [2/2]

unsigned oomph::TriangleMeshCurveSection::final_vertex_connected_n_vertex ( ) const
inline

Sets the vertex number to which the final end is connected.

488  {
490  }

References Final_vertex_connected_n_vertex.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ final_vertex_coordinate()

virtual void oomph::TriangleMeshCurveSection::final_vertex_coordinate ( Vector< double > &  vertex)
pure virtual

◆ initial_s_connection_value() [1/2]

double& oomph::TriangleMeshCurveSection::initial_s_connection_value ( )
inline

Sets the s value to which the initial end is connected.

554  {
556  }

References Initial_s_connection_value.

◆ initial_s_connection_value() [2/2]

double oomph::TriangleMeshCurveSection::initial_s_connection_value ( ) const
inline

Gets the s value to which the initial end is connected.

548  {
550  }

References Initial_s_connection_value.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ initial_vertex_connected_bnd_id() [1/2]

unsigned& oomph::TriangleMeshCurveSection::initial_vertex_connected_bnd_id ( )
inline

Sets the id to which the initial end is connected.

446  {
448  }

References Initial_vertex_connected_bnd_id.

◆ initial_vertex_connected_bnd_id() [2/2]

unsigned oomph::TriangleMeshCurveSection::initial_vertex_connected_bnd_id ( ) const
inline

Gets the id to which the initial end is connected.

440  {
442  }

References Initial_vertex_connected_bnd_id.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ initial_vertex_connected_n_chunk() [1/2]

unsigned& oomph::TriangleMeshCurveSection::initial_vertex_connected_n_chunk ( )
inline

Sets the boundary chunk to which the initial end is connected.

470  {
472  }

References Initial_vertex_connected_n_chunk.

◆ initial_vertex_connected_n_chunk() [2/2]

unsigned oomph::TriangleMeshCurveSection::initial_vertex_connected_n_chunk ( ) const
inline

Gets the boundary chunk to which the initial end is connected.

464  {
466  }

References Initial_vertex_connected_n_chunk.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ initial_vertex_connected_n_vertex() [1/2]

unsigned& oomph::TriangleMeshCurveSection::initial_vertex_connected_n_vertex ( )
inline

Sets the vertex number to which the initial end is connected.

458  {
460  }

References Initial_vertex_connected_n_vertex.

◆ initial_vertex_connected_n_vertex() [2/2]

unsigned oomph::TriangleMeshCurveSection::initial_vertex_connected_n_vertex ( ) const
inline

Gets the vertex number to which the initial end is connected.

452  {
454  }

References Initial_vertex_connected_n_vertex.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ initial_vertex_coordinate()

virtual void oomph::TriangleMeshCurveSection::initial_vertex_coordinate ( Vector< double > &  vertex)
pure virtual

◆ is_final_vertex_connected()

bool oomph::TriangleMeshCurveSection::is_final_vertex_connected ( ) const
inline

Test whether final vertex is connected or not.

396  {
397  return Final_vertex_connected;
398  }

References Final_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ is_final_vertex_connected_to_curviline()

bool oomph::TriangleMeshCurveSection::is_final_vertex_connected_to_curviline ( ) const
inline

Test whether the final vertex is connected to a curviline.

530  {
532  }

References Final_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ is_initial_vertex_connected()

bool oomph::TriangleMeshCurveSection::is_initial_vertex_connected ( ) const
inline

Test whether initial vertex is connected or not.

352  {
354  }

References Initial_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ is_initial_vertex_connected_to_curviline()

bool oomph::TriangleMeshCurveSection::is_initial_vertex_connected_to_curviline ( ) const
inline

Test whether the initial vertex is connected to a curviline.

512  {
514  }

References Initial_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ maximum_length()

double oomph::TriangleMeshCurveSection::maximum_length ( )
inline

Gets access to the maximum length variable.

298  {
299  return Maximum_length;
300  }

References Maximum_length.

Referenced by set_maximum_length().

◆ nsegment()

virtual unsigned oomph::TriangleMeshCurveSection::nsegment ( ) const
pure virtual

Number of segments that this part of the boundary is to be represented by. This corresponds to the number of straight-line segments in triangle representation.

Implemented in oomph::TriangleMeshPolyLine, and oomph::TriangleMeshCurviLine.

◆ nvertex()

virtual unsigned oomph::TriangleMeshCurveSection::nvertex ( ) const
pure virtual

Number of vertices.

Implemented in oomph::TriangleMeshPolyLine, and oomph::TriangleMeshCurviLine.

◆ output()

virtual void oomph::TriangleMeshCurveSection::output ( std::ostream &  outfile,
const unsigned n_sample = 50 
)
pure virtual

Output the curve_section.

Implemented in oomph::TriangleMeshPolyLine, and oomph::TriangleMeshCurviLine.

◆ refinement_tolerance()

double oomph::TriangleMeshCurveSection::refinement_tolerance ( )
inline

Get tolerance for refinement of curve sections to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation. If it's negative refinement is disabled.

230  {
231  return Refinement_tolerance;
232  }

References Refinement_tolerance.

◆ resume_final_vertex_connected()

void oomph::TriangleMeshCurveSection::resume_final_vertex_connected ( )
inline

Resumes the final vertex connection, it may be that after load balancing the boundary to which the connection was suspended be part of the domain

430  {
432  {
433  Final_vertex_connected = true;
435  }
436  }

References Final_vertex_connected, and Final_vertex_connected_suspended.

◆ resume_initial_vertex_connected()

void oomph::TriangleMeshCurveSection::resume_initial_vertex_connected ( )
inline

Resumes the initial vertex connection, it may be that after load balancing the boundary to which the connection was suspended be part of the domain

386  {
388  {
391  }
392  }

References Initial_vertex_connected, and Initial_vertex_connected_suspended.

◆ set_final_vertex_connected()

void oomph::TriangleMeshCurveSection::set_final_vertex_connected ( )
inline

Sets the final vertex as connected.

402  {
403  Final_vertex_connected = true;
404  }

References Final_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ set_final_vertex_connected_to_curviline()

void oomph::TriangleMeshCurveSection::set_final_vertex_connected_to_curviline ( )
inline

Sets the final vertex as connected to a curviline.

536  {
538  }

References Final_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ set_initial_vertex_connected()

void oomph::TriangleMeshCurveSection::set_initial_vertex_connected ( )
inline

Sets the initial vertex as connected.

358  {
360  }

References Initial_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ set_initial_vertex_connected_to_curviline()

void oomph::TriangleMeshCurveSection::set_initial_vertex_connected_to_curviline ( )
inline

Sets the initial vertex as connected to a curviline.

518  {
520  }

References Initial_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ set_maximum_length()

void oomph::TriangleMeshCurveSection::set_maximum_length ( const double maximum_length)
inline

Allows to specify the maximum distance between two vertices that define the associated polyline of the curve section, it only takes effect on the unrefinement and refinement steps

285  {
287  }
double maximum_length()
Gets access to the maximum length variable.
Definition: unstructured_two_d_mesh_geometry_base.h:297

References maximum_length(), and Maximum_length.

Referenced by ContactProblem< ELEMENT >::actions_before_adapt(), and MeltContactProblem< ELEMENT >::MeltContactProblem().

◆ set_refinement_tolerance()

void oomph::TriangleMeshCurveSection::set_refinement_tolerance ( const double tolerance)
inline

Set tolerance for refinement of curve sections to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the refinement tolerance. (The smaller the number the finer the surface representation). If set to a negative value, we're switching off refinement – equivalent to calling disable_polyline_refinement()

221  {
222  Refinement_tolerance = tolerance;
223  }

References Refinement_tolerance.

◆ set_unrefinement_tolerance()

void oomph::TriangleMeshCurveSection::set_unrefinement_tolerance ( const double tolerance)
inline

Set tolerance for unrefinement of curve sections to avoid unnecessarily large numbers of elements on of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation of the optional argument which specifies the unrefinement tolerance. It defaults to 0.04 and the larger the number the more agressive we are when removing unnecessary vertices on gently curved polylines. If set to a negative value, we're switching off unrefinement – equivalent to calling disable_curve_section_unrefinement()

262  {
263  Unrefinement_tolerance = tolerance;
264  }

References Unrefinement_tolerance.

◆ suspend_final_vertex_connected()

void oomph::TriangleMeshCurveSection::suspend_final_vertex_connected ( )
inline

Set the final vertex connection as suspended, it will be resumed when the method to resume the connections is called This method is only used in a distributed context, when the boundary to connect is no longer part of the domain in the processor

418  {
420  {
421  Final_vertex_connected = false;
423  }
424  }

References Final_vertex_connected, and Final_vertex_connected_suspended.

◆ suspend_initial_vertex_connected()

void oomph::TriangleMeshCurveSection::suspend_initial_vertex_connected ( )
inline

Set the initial vertex connection as suspended, it will be resumed when the method to resume the connections is called This method is only used in a distributed context, when the boundary to connect is no longer part of the domain in the processor

374  {
376  {
377  Initial_vertex_connected = false;
379  }
380  }

References Initial_vertex_connected, and Initial_vertex_connected_suspended.

◆ tolerance_for_s_connection() [1/2]

double& oomph::TriangleMeshCurveSection::tolerance_for_s_connection ( )
inline

Sets the tolerance value for connections among curvilines

580  {
582  }

References Tolerance_for_s_connection.

◆ tolerance_for_s_connection() [2/2]

double oomph::TriangleMeshCurveSection::tolerance_for_s_connection ( ) const
inline

Gets the tolerance value for connections among curvilines

573  {
575  }

References Tolerance_for_s_connection.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ unrefinement_tolerance()

double oomph::TriangleMeshCurveSection::unrefinement_tolerance ( )
inline

Get tolerance for unrefinement of curve section to create a better representation of curvilinear boundaries (e.g. in free-surface problems). See tutorial for interpretation. If it's negative unrefinement is disabled.

271  {
272  return Unrefinement_tolerance;
273  }

References Unrefinement_tolerance.

◆ unset_final_vertex_connected()

void oomph::TriangleMeshCurveSection::unset_final_vertex_connected ( )
inline

Sets the final vertex as non connected.

408  {
409  Final_vertex_connected = false;
410  }

References Final_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ unset_final_vertex_connected_to_curviline()

void oomph::TriangleMeshCurveSection::unset_final_vertex_connected_to_curviline ( )
inline

Sets the final vertex as non connected to a curviline.

542  {
544  }

References Final_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ unset_initial_vertex_connected()

void oomph::TriangleMeshCurveSection::unset_initial_vertex_connected ( )
inline

Sets the initial vertex as non connected.

364  {
365  Initial_vertex_connected = false;
366  }

References Initial_vertex_connected.

Referenced by oomph::TriangleMeshPolyLine::reverse().

◆ unset_initial_vertex_connected_to_curviline()

void oomph::TriangleMeshCurveSection::unset_initial_vertex_connected_to_curviline ( )
inline

Sets the initial vertex as non connected to a curviline.

524  {
526  }

References Initial_vertex_connected_to_curviline.

Referenced by oomph::TriangleMeshPolyLine::reverse().

Member Data Documentation

◆ Final_s_connection_value

double oomph::TriangleMeshCurveSection::Final_s_connection_value
protected

Stores the s value used for connecting the final end with a curviline

Referenced by connect_final_vertex_to_curviline(), and final_s_connection_value().

◆ Final_vertex_connected

bool oomph::TriangleMeshCurveSection::Final_vertex_connected
protected

◆ Final_vertex_connected_bnd_id

unsigned oomph::TriangleMeshCurveSection::Final_vertex_connected_bnd_id
protected

Stores the id to which the initial end is connected.

Referenced by connect_final_vertex_to_curviline(), connect_final_vertex_to_polyline(), and final_vertex_connected_bnd_id().

◆ Final_vertex_connected_n_chunk

unsigned oomph::TriangleMeshCurveSection::Final_vertex_connected_n_chunk
protected

Stores the chunk number of the boundary to which is connected th initial end

Referenced by connect_final_vertex_to_curviline(), connect_final_vertex_to_polyline(), and final_vertex_connected_n_chunk().

◆ Final_vertex_connected_n_vertex

unsigned oomph::TriangleMeshCurveSection::Final_vertex_connected_n_vertex
protected

Stores the vertex number used for connection with the final end

Referenced by connect_final_vertex_to_polyline(), and final_vertex_connected_n_vertex().

◆ Final_vertex_connected_suspended

bool oomph::TriangleMeshCurveSection::Final_vertex_connected_suspended
protected

Indicates if the connection is suspended because the boundary to connect is no longer part of the domain (only used in a distributed context)

Referenced by resume_final_vertex_connected(), and suspend_final_vertex_connected().

◆ Final_vertex_connected_to_curviline

bool oomph::TriangleMeshCurveSection::Final_vertex_connected_to_curviline
protected

◆ Initial_s_connection_value

double oomph::TriangleMeshCurveSection::Initial_s_connection_value
protected

Stores the s value used for connecting the initial end with a curviline

Referenced by connect_initial_vertex_to_curviline(), and initial_s_connection_value().

◆ Initial_vertex_connected

bool oomph::TriangleMeshCurveSection::Initial_vertex_connected
protected

◆ Initial_vertex_connected_bnd_id

unsigned oomph::TriangleMeshCurveSection::Initial_vertex_connected_bnd_id
protected

Stores the id to which the initial end is connected.

Referenced by connect_initial_vertex_to_curviline(), connect_initial_vertex_to_polyline(), and initial_vertex_connected_bnd_id().

◆ Initial_vertex_connected_n_chunk

unsigned oomph::TriangleMeshCurveSection::Initial_vertex_connected_n_chunk
protected

Stores the chunk number of the boundary to which is connected th initial end

Referenced by connect_initial_vertex_to_curviline(), connect_initial_vertex_to_polyline(), and initial_vertex_connected_n_chunk().

◆ Initial_vertex_connected_n_vertex

unsigned oomph::TriangleMeshCurveSection::Initial_vertex_connected_n_vertex
protected

Stores the vertex number used for connection with the initial end

Referenced by connect_initial_vertex_to_polyline(), and initial_vertex_connected_n_vertex().

◆ Initial_vertex_connected_suspended

bool oomph::TriangleMeshCurveSection::Initial_vertex_connected_suspended
protected

Indicates if the connection is suspended because the boundary to connect is no longer part of the domain (only used in a distributed context)

Referenced by resume_initial_vertex_connected(), and suspend_initial_vertex_connected().

◆ Initial_vertex_connected_to_curviline

bool oomph::TriangleMeshCurveSection::Initial_vertex_connected_to_curviline
protected

◆ Maximum_length

double oomph::TriangleMeshCurveSection::Maximum_length
private

Maximum allowed distance between two vertices on the polyline representation of the curve section

Referenced by disable_use_maximum_length(), maximum_length(), and set_maximum_length().

◆ Refinement_tolerance

double oomph::TriangleMeshCurveSection::Refinement_tolerance
private

Tolerance for refinement of curve sections (neg if refinement is disabled)

Referenced by disable_refinement_tolerance(), enable_refinement_tolerance(), refinement_tolerance(), and set_refinement_tolerance().

◆ Tolerance_for_s_connection

double oomph::TriangleMeshCurveSection::Tolerance_for_s_connection
protected

Tolerance used for connecting the ends to a curviline.

Referenced by connect_final_vertex_to_curviline(), connect_initial_vertex_to_curviline(), and tolerance_for_s_connection().

◆ Unrefinement_tolerance

double oomph::TriangleMeshCurveSection::Unrefinement_tolerance
private

Tolerance for unrefinement of curve sections (neg if refinement is disabled)

Referenced by disable_unrefinement_tolerance(), enable_unrefinement_tolerance(), set_unrefinement_tolerance(), and unrefinement_tolerance().


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