PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
ConformerMeshSegment.hpp
Go to the documentation of this file.
1// _LICENSE_HEADER_
2//
3// Copyright (C) 2019 - 2025.
4// Terms register on the GPL-3.0 license.
5//
6// This file can be redistributed and/or modified under the license terms.
7//
8// See top level LICENSE file for more details.
9//
10// This file can be used citing references in CITATION.cff file.
11
12#ifndef __CONFORMERMESHSEGMENT_H
13#define __CONFORMERMESHSEGMENT_H
14
15#include "Eigen/Eigen"
16#include "GeometryUtilities.hpp"
17#include "IMeshDAO.hpp"
19#include "MeshMatrices.hpp"
20#include "MeshUtilities.hpp"
21#include "UnionMeshSegment.hpp"
22
23namespace Gedim
24{
26{
27 public:
29 {
31 {
32 enum Types
33 {
37 External = 3
38 };
39
40 std::set<unsigned int> Cell2DIds = {};
41 std::set<unsigned int> Edge2DIds = {};
42 std::set<unsigned int> Vertex2DIds = {};
44 };
45
47 {
48 std::vector<double> Points = {};
49 std::set<unsigned int> Cell2DIds = {};
50 std::set<unsigned int> Edge2DIds = {};
51 };
52
53 std::map<double, ConformMeshPoint> Points;
54 std::vector<ConformMeshSegment> Segments;
55 };
56
58 static void ToCurvilinearCoordinates(const ConformMesh &conformMesh, std::vector<double> &curvilinearCoordinates);
59
60 static std::string ToString(const ConformMesh &conformMesh);
61
62 static void CreateConformSegments(ConformMesh &result);
63
64 static void Serialize(std::ostream &os, const ConformMesh &mesh);
65
66 static void Deserialize(std::istream &is, ConformMesh &mesh);
67
68 private:
69 const Gedim::GeometryUtilities &_geometryUtilities;
70
71 ConformMesh::ConformMeshPoint &InsertNewIntersection(const double &curvilinearCoordinate, ConformMesh &result, bool &found) const;
74 const unsigned int &meshIntersectionPosition,
75 ConformMesh &result);
76
77 public:
78 ConformerMeshSegment(const Gedim::GeometryUtilities &geometryUtilities);
80
88 const unsigned int &meshIntersectionPosition,
89 ConformMesh &result);
90
95 void InsertExternalPoint(const Eigen::Vector3d &segmentOrigin,
96 const Eigen::Vector3d &segmentEnd,
98 const double &curvilinearCoordinate,
99 ConformMesh &result);
100
105
110
116 std::vector<double> AddMissingMesh2DCell0Ds(const Eigen::Vector3d &segmentOrigin,
117 const Eigen::Vector3d &segmentTangent,
118 const double &segmentSquaredLength,
119 const Gedim::IMeshDAO &mesh2D,
121};
122} // namespace Gedim
123
124#endif
Definition ConformerMeshSegment.hpp:26
static void ToCurvilinearCoordinates(const ConformMesh &conformMesh, std::vector< double > &curvilinearCoordinates)
convert IntersectionMesh to Curvilinear Coordinates vector
Definition ConformerMeshSegment.cpp:33
static void CreateConformSegments(ConformMesh &result)
Definition ConformerMeshSegment.cpp:153
static void Deserialize(std::istream &is, ConformMesh &mesh)
Definition ConformerMeshSegment.cpp:235
static void Serialize(std::ostream &os, const ConformMesh &mesh)
Definition ConformerMeshSegment.cpp:189
void UpdateWithActiveMesh2D(const Gedim::MeshUtilities::ExtractActiveMeshData &activeMesh2DData, ConformMesh &conformedMesh) const
Update the conformed 1D mesh with active mesh 2D data.
Definition ConformerMeshSegment.cpp:527
std::vector< double > AddMissingMesh2DCell0Ds(const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentTangent, const double &segmentSquaredLength, const Gedim::IMeshDAO &mesh2D, ConformMesh &conformedMesh) const
Add Missing Mesh2D Cell0Ds generated from the intersections with other interfaces.
Definition ConformerMeshSegment.cpp:588
void CreateConformMesh(const Gedim::IntersectorMesh2DSegment::IntersectionMesh &meshIntersection, const Gedim::UnionMeshSegment::UnionMesh &meshUnion, const unsigned int &meshIntersectionPosition, ConformMesh &result)
Create ConformMesh on segment starting from an intersection mesh and the corresponding union mesh.
Definition ConformerMeshSegment.cpp:325
static std::string ToString(const ConformMesh &conformMesh)
Definition ConformerMeshSegment.cpp:44
~ConformerMeshSegment()
Definition ConformerMeshSegment.cpp:28
void InsertExternalPoint(const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Gedim::IMeshDAO &mesh2D, const double &curvilinearCoordinate, ConformMesh &result)
Insert an external point on conform mesh.
Definition ConformerMeshSegment.cpp:334
void UpdateWithUpdatedMesh2D(const Gedim::IMeshDAO &mesh2D, ConformMesh &conformedMesh) const
Update the conformed 1D mesh with updated mesh 2D data.
Definition ConformerMeshSegment.cpp:399
Eigen column vector.
Definition Eigen_Array.hpp:23
The GeometryUtilities class intersects 3D segments.
Definition GeometryUtilities.hpp:37
The IMeshDAO (mesh data access object) class to read and write mesh data.
Definition IMeshDAO.hpp:24
Definition Eigen_Array.cpp:22
@ Inherited
point belong to other intersection mesh
Definition ConformerMeshSegment.hpp:36
@ Unknown
Definition ConformerMeshSegment.hpp:34
@ External
other points not inherith from intersection mesh
Definition ConformerMeshSegment.hpp:37
@ Original
point belong to original intersection mesh
Definition ConformerMeshSegment.hpp:35
std::set< unsigned int > Vertex2DIds
Definition ConformerMeshSegment.hpp:42
Types Type
Definition ConformerMeshSegment.hpp:43
std::set< unsigned int > Edge2DIds
Definition ConformerMeshSegment.hpp:41
std::set< unsigned int > Cell2DIds
Definition ConformerMeshSegment.hpp:40
std::set< unsigned int > Cell2DIds
Definition ConformerMeshSegment.hpp:49
std::set< unsigned int > Edge2DIds
Definition ConformerMeshSegment.hpp:50
std::vector< double > Points
Definition ConformerMeshSegment.hpp:48
Definition ConformerMeshSegment.hpp:29
std::map< double, ConformMeshPoint > Points
Definition ConformerMeshSegment.hpp:53
std::vector< ConformMeshSegment > Segments
Definition ConformerMeshSegment.hpp:54
Definition IntersectorMesh2DSegment.hpp:25
Definition MeshUtilities.hpp:80
Definition UnionMeshSegment.hpp:23