OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
StepWidthManager.h
Go to the documentation of this file.
1#pragma once
2
3class ObjectManager;
4
5class Application;
6class Properties;
7
8class BoundingBox;
9class EntityBase;
10
11class TopoDS_Shape;
12class TopoDS_Face;
13
14#include <vector>
15#include <list>
16#include <map>
17#include <set>
18#include <string>
19
20namespace gmsh
21{
22 typedef std::vector<std::pair<int, int> > vectorpair;
23}
24
26{
27public:
30
31 double getMaximumEdgeLength(void) { return maximumEdgeLength; }
32 double getBoundingSphereMeshStep(void) { return boundingSphereMeshStep; }
33 double getBackgroundBaseStep(void) { return backgroundBaseStep; }
34 double getBackgroundDistance(void) { return backgroundDistance; }
35
36 void determineBaseStepWidths(BoundingBox &boundingBox, Properties &properties);
37
38 void buildIndexedFaceToStepSizeVector(EntityBase *entity, const TopoDS_Shape *shape, Properties &properties);
40 void applyVolumeMeshStepWidthToEntity(EntityBase *entity, ObjectManager &objectManager, Properties &properties);
42 void applyUserDefinedRefinmentsToFacesAndPoints(double refinementStep, std::string refinementList);
43
44 void apply2DRefinementsToMesher(double refinementStep, double refinementRadius);
45 void apply3DRefinementsToMesher(bool useDistanceForVolumeMeshRefinement, double refinementStep, double refinementRadius);
46
47 bool hasAnyRefinementPoints(void) { return !refinementPoints.empty(); }
48
49 void addProximityRefinementField(const std::string &expression, std::vector<double> &edgeList, std::vector<double> &faceList);
51
52private:
53 struct meshRefinement {
54 double stepWidth;
55 std::set<int> edgeSet;
56 std::set<int> faceSet;
57 std::set<int> volumeSet;
58 };
59
60 void getLocalMeshPropertiesForEntity(EntityBase *entity, bool &localCurvatureRefinement, int &localNumberOfStepsPerCircle, double &localMinCurvatureRefRadius, double &localMaximumDeviation);
61 double getMaxStepWidthForFace(TopoDS_Face &face, bool localCurvatureRefinement, int localNumberOfStepsPerCircle, double localMinCurvatureRefRadius, double localMaximumDeviation);
62 void applyVolumeMeshStepWidthToObjects(gmsh::vectorpair &shapeTags, double stepWidth);
63 void applyMeshStepWidthToFaces(std::list<int> &refineFaceTagList, double stepWidth);
64 std::string getRefinementFromString(std::string &refinementString);
65 bool getPointFromRefinement(const std::string &refinement, double &x, double &y, double &z);
66 bool getFaceIdFromRefinement(const std::string &refinement, int &faceId);
67 void createRefinement(double stepWidth, std::set<int> &faceSet, std::set<int> &edgeSet, std::set<int> &volumeSet);
68 void convertSet(const std::set<int> &setData, std::vector<double> &listData);
69
70 Application *application;
71
72 double maximumEdgeLength;
73 double boundingSphereMeshStep;
74 double backgroundBaseStep;
75 double backgroundDistance;
76 int backgroundMeshRefinementField;
77
78 std::vector<double> faceStepWidthVector;
79 std::map<int, double> faceTagToStepSizeMap;
80 std::map<std::string, meshRefinement> meshFields;
81 std::list<std::array<double, 3>> refinementPoints;
82 std::vector<double> refinementFields2D;
83
84};
Definition Application.h:25
Definition ObjectManager.h:23
Definition Properties.h:11
Definition StepWidthManager.h:26
void applyVolumeMeshStepWidthToEntity(EntityBase *entity, ObjectManager &objectManager, Properties &properties)
Definition StepWidthManager.cpp:215
void apply2DRefinementsToMesher(double refinementStep, double refinementRadius)
Definition StepWidthManager.cpp:423
StepWidthManager(Application *app)
Definition StepWidthManager.cpp:23
void applyCurvatureMeshStepWidthToEntities(void)
Definition StepWidthManager.cpp:265
void addProximityRefinementField(const std::string &expression, std::vector< double > &edgeList, std::vector< double > &faceList)
Definition StepWidthManager.cpp:560
bool hasAnyRefinementPoints(void)
Definition StepWidthManager.h:47
void applyUserDefinedRefinmentsToFacesAndPoints(double refinementStep, std::string refinementList)
Definition StepWidthManager.cpp:337
void setProximityRefinementFields(void)
Definition StepWidthManager.cpp:573
double getMaximumEdgeLength(void)
Definition StepWidthManager.h:31
void buildTagToAnnotationMap(gmsh::vectorpair &output)
Definition StepWidthManager.cpp:188
void buildIndexedFaceToStepSizeVector(EntityBase *entity, const TopoDS_Shape *shape, Properties &properties)
Definition StepWidthManager.cpp:73
void apply3DRefinementsToMesher(bool useDistanceForVolumeMeshRefinement, double refinementStep, double refinementRadius)
Definition StepWidthManager.cpp:475
~StepWidthManager()
Definition StepWidthManager.h:29
double getBoundingSphereMeshStep(void)
Definition StepWidthManager.h:32
double getBackgroundBaseStep(void)
Definition StepWidthManager.h:33
void determineBaseStepWidths(BoundingBox &boundingBox, Properties &properties)
Definition StepWidthManager.cpp:33
double getBackgroundDistance(void)
Definition StepWidthManager.h:34
The app namespace contains several functions that may be used to start processes.
Definition FaceAnnotationsManager.h:20
std::vector< std::pair< int, int > > vectorpair
Definition FaceAnnotationsManager.h:21