36 std::vector<std::size_t>& edge_node_distances)
41 auto itr = std::find(vec_node_ids.begin(), vec_node_ids.end(),
42 getNodeIndex(edge, j));
43 if (itr != vec_node_ids.end())
45 edge_node_distances.push_back(
46 std::distance(vec_node_ids.begin(), itr));
69 const std::vector<std::size_t>& edge_node_distances_along_ply,
70 const std::vector<std::size_t>& node_ids_on_poly)
74 if (edge_node_distances_along_ply.front() >
75 edge_node_distances_along_ply.back() ||
77 edge_node_distances_along_ply.back() == node_ids_on_poly.size() - 1))
79 if (
auto const* e =
dynamic_cast<MeshLib::Line const*
>(&edge))
81 std::array nodes = {
const_cast<MeshLib::Node*
>(e->getNode(1)),
87 std::array nodes = {
const_cast<MeshLib::Node*
>(e->getNode(1)),
92 OGS_FATAL(
"Not implemented for element type {:s}",
typeid(edge).name());
114 for (
auto ele_id : ele_ids_near_ply)
118 if (e->getDimension() == 1)
123 if (!e->isBoundaryElement())
128 for (
unsigned i = 0; i < e->getNumberOfEdges(); i++)
133 std::vector<std::size_t> edge_node_distances_along_ply;
134 if (includesAllEdgeNodeIDs(node_ids_on_poly, *edge,
135 edge_node_distances_along_ply))
137 auto* new_edge = modifyEdgeNodeOrdering(
138 *edge, ply, edge_node_distances_along_ply,
140 if (edge != new_edge)
160 std::size_t dist1 = std::distance(
161 node_ids_on_poly.begin(),
162 std::find(node_ids_on_poly.begin(),
163 node_ids_on_poly.end(), getNodeIndex(*e1, 0)));
164 std::size_t dist2 = std::distance(
165 node_ids_on_poly.begin(),
166 std::find(node_ids_on_poly.begin(),
167 node_ids_on_poly.end(), getNodeIndex(*e2, 0)));
168 return (dist1 < dist2);
Definition of the Element class.
Definition of the Line class.
Definition of the Mesh class.
Definition of the Node class.
Definition of the PolyLine class.
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
const std::vector< std::size_t > & getSearchedElementIDs() const
return marked elements
std::size_t searchByNodeIDs(const std::vector< std::size_t > &nodes)
Marks all elements connecting to any of the given nodes.
virtual const Element * getEdge(unsigned i) const =0
Returns the i-th edge of the element.
virtual unsigned getNumberOfBaseNodes() const =0
const Element * getElement(std::size_t idx) const
Get the element with the given index.
TemplateElement< MeshLib::LineRule2 > Line
TemplateElement< MeshLib::LineRule3 > Line3
MeshLib::Element * modifyEdgeNodeOrdering(const MeshLib::Element &edge, const GeoLib::Polyline &ply, const std::vector< std::size_t > &edge_node_distances_along_ply, const std::vector< std::size_t > &node_ids_on_poly)
bool includesAllEdgeNodeIDs(std::vector< std::size_t > const &vec_node_ids, MeshLib::Element const &edge, std::vector< std::size_t > &edge_node_distances)
Definition of the quicksort function.