MeshKernel
|
A class describing an 1d-2d contacts. More...
#include <Contacts.hpp>
Public Member Functions | |
Contacts (Mesh1D &mesh1d, Mesh2D &mesh2d) | |
Constructor taking the 1d and 2d meshes to connect. | |
void | ComputeSingleContacts (const std::vector< bool > &oneDNodeMask, const Polygons &polygons, double projectionFactor) |
Computes 1d-2d contacts, where every single 1d node is connected to one 2d face circumcenter (ggeo_make1D2Dinternalnetlinks_dll). | |
void | ComputeMultipleContacts (const std::vector< bool > &oneDNodeMask) |
Computes 1d-2d contacts, where a single 1d node is connected to multiple 2d face circumcenters (ggeo_make1D2Dembeddedlinks_dll). | |
void | ComputeContactsWithPolygons (const std::vector< bool > &oneDNodeMask, const Polygons &polygons) |
Computes 1d-2d contacts, where a 2d face per polygon is connected to the closest 1d node (ggeo_make1D2Droofgutterpipes_dll). | |
void | ComputeContactsWithPoints (const std::vector< bool > &oneDNodeMask, const std::vector< Point > &points) |
Computes 1d-2d contacts, where 1d nodes are connected to the 2d faces mass centers containing the input point (ggeo_make1D2Dstreetinletpipes_dll). | |
void | ComputeBoundaryContacts (const std::vector< bool > &oneDNodeMask, const Polygons &polygons, double searchRadius) |
Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_make1D2DRiverLinks_dll). | |
std::vector< UInt > const & | Mesh1dIndices () const |
Gets the 1d mesh indices. | |
std::vector< UInt > const & | Mesh2dIndices () const |
Gets the 2d mesh indices. | |
void | SetIndices (const std::vector< meshkernel::UInt > &mesh1dIndices, const std::vector< meshkernel::UInt > &mesh2dIndices) |
Sets the 1d and 2d mesh indices. | |
A class describing an 1d-2d contacts.
The responsibility of the Contacts class is connecting a 1d mesh to a 2d mesh. The class has a reference to the Mesh1D and the Mesh2D instances that will be connected. A contact is defined by the indices of the connected 1d node and 2d face.
Constructor taking the 1d and 2d meshes to connect.
[in] | mesh1d | The mesh1d to connect |
[in] | mesh2d | The mesh2d to connect |
void meshkernel::Contacts::ComputeBoundaryContacts | ( | const std::vector< bool > & | oneDNodeMask, |
const Polygons & | polygons, | ||
double | searchRadius | ||
) |
Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_make1D2DRiverLinks_dll).
The algorithms works as follows:
[in] | oneDNodeMask | The mask to apply to 1d nodes (true = connect node, false = do not generate contacts) |
[in] | polygons | The polygons selecting the area where the 1d-2d contacts will be generated. |
[in] | searchRadius | The radius used for searching neighboring faces, if equal to constants::missing::doubleValue, the search radius will be calculated internally. |
void meshkernel::Contacts::ComputeContactsWithPoints | ( | const std::vector< bool > & | oneDNodeMask, |
const std::vector< Point > & | points | ||
) |
Computes 1d-2d contacts, where 1d nodes are connected to the 2d faces mass centers containing the input point (ggeo_make1D2Dstreetinletpipes_dll).
With this algorithm, each 2d face containing a point is connected to the 1d node closest to point itself. The search of the 2d faces and the closest 1d nodes uses RTrees.
[in] | oneDNodeMask | The mask to apply to 1d nodes (true = connect node, false = do not generate contacts) |
[in] | points | The points selecting the faces to connect |
void meshkernel::Contacts::ComputeContactsWithPolygons | ( | const std::vector< bool > & | oneDNodeMask, |
const Polygons & | polygons | ||
) |
Computes 1d-2d contacts, where a 2d face per polygon is connected to the closest 1d node (ggeo_make1D2Droofgutterpipes_dll).
The algorithms works as follows:
[in] | oneDNodeMask | The mask to apply to 1d nodes (true = connect node, false = do not generate contacts) |
[in] | polygons | The polygons to connect (Polygons class can have multiple polygons) |
void meshkernel::Contacts::ComputeMultipleContacts | ( | const std::vector< bool > & | oneDNodeMask | ) |
Computes 1d-2d contacts, where a single 1d node is connected to multiple 2d face circumcenters (ggeo_make1D2Dembeddedlinks_dll).
Each internal 1d node is connected to multiple 2d faces. This type of contacts should be used when the lengths of the 1d mesh edges are considerably larger than the 2d mesh edges and generating a single contact for each 1d node is not sufficient. In this algorithm, only the internal 1d nodes are connected. The following figure shows a 1d mesh overlapping a 2d mesh. For the node n, the closest 2d faces within a search radius are found and it is determined if those faces cross are crossed by the current 1d edge starting at node n and ending at and n+1. If the answer is positive, a contact is generated between the face and the closest 1d node composing the current 1d edge (i.e. n or n+1). The procedure is repeated for each 1d node.
[in] | oneDNodeMask | The mask to apply to 1d nodes (true = connect node, false = do not generate contacts) |
void meshkernel::Contacts::ComputeSingleContacts | ( | const std::vector< bool > & | oneDNodeMask, |
const Polygons & | polygons, | ||
double | projectionFactor | ||
) |
Computes 1d-2d contacts, where every single 1d node is connected to one 2d face circumcenter (ggeo_make1D2Dinternalnetlinks_dll).
Each non-boundary 1d node is connected to single 2d face. The figure below shows two 2d meshes, a 1d mesh between them, and the 1d-2d contacts (in red). For the 1d nodes not overlapping a 2d mesh, a ray starting from the current node n is computed (dashed blue ray). This ray is normal to the segment connecting the previous (n-1) and next one 1d node (n+1), the connecting segment is shown with a green dashed line. The ray is extended for 5 times the length of the connecting segment. The current 1d node is connected to the first boundary 2d face crossing the ray, first in the left direction and then in the right direction. By doing so a 1d mesh can be connected on the left and right sides of a mesh 2d boundary, for example when the 1d part represents a river and the 2d part the river banks. The 1d nodes overlapping the 2d mesh are directly connected to the face including them.
[in] | oneDNodeMask | The mask to apply to 1d nodes (true = connect node, false = do not generate contacts) |
[in] | polygons | The polygons selecting the area where the 1d-2d contacts will be generated. |
[in] | projectionFactor | The projection factor used for generating contacts when 1d nodes are not inside mesh2d |
|
inline |
Gets the 1d mesh indices.
|
inline |
Gets the 2d mesh indices.
void meshkernel::Contacts::SetIndices | ( | const std::vector< meshkernel::UInt > & | mesh1dIndices, |
const std::vector< meshkernel::UInt > & | mesh2dIndices | ||
) |
Sets the 1d and 2d mesh indices.
[in] | mesh1dIndices | The 1d mesh indices |
[in] | mesh2dIndices | The 2d mesh indices |