OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityMeshCartesianData.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityContainer.h"
5#include "OldTreeIcon.h"
6
7#include <list>
8#include <string>
9#include <vector>
10
11class EntityMeshCartesianFaceList;
12class EntityMeshCartesianNodes;
13class EntityCartesianVector;
14
15class __declspec(dllexport) EntityMeshCartesianData : public EntityContainer
16{
17public:
18 EntityMeshCartesianData(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
19 virtual ~EntityMeshCartesianData();
20
21 virtual bool considerForPropertyFilter(void) override { return true; };
22 virtual bool considerChildrenForPropertyFilter(void) override { return false; };
23
24 virtual bool updateFromProperties(void) override;
25
26 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
27
28 virtual void StoreToDataBase(void) override;
29
30 virtual void addVisualizationNodes(void) override;
31 void addVisualizationItem(bool isHidden);
32
33 virtual std::string getClassName(void) { return "EntityMeshCartesianData"; }
34
35 virtual entityType getEntityType(void) override { return TOPOLOGY; }
36
37 virtual void removeChild(EntityBase *child) override;
38
39 size_t getNumberLinesX(void) { return meshCoords[0].size(); }
40 size_t getNumberLinesY(void) { return meshCoords[1].size(); }
41 size_t getNumberLinesZ(void) { return meshCoords[2].size(); }
42
43 size_t getNumberCells(void) { return getNumberLinesX() * getNumberLinesY() * getNumberLinesZ(); }
44
45 std::vector<double> &getMeshLinesX(void) { return meshCoords[0]; }
46 std::vector<double> &getMeshLinesY(void) { return meshCoords[1]; }
47 std::vector<double> &getMeshLinesZ(void) { return meshCoords[2]; }
48
49 double getSmallestStepWidth(void);
50 double getLargestStepWidth(void);
51 double getStepRatio(void);
52
53 size_t findLowerIndex(int direction, double value);
54 size_t findUpperIndex(int direction, double value);
55
56 EntityMeshCartesianFaceList *getMeshFaces(void);
57 long long getMeshFacesStorageId(void) { return meshFacesStorageId; }
58
59 EntityMeshCartesianNodes *getMeshNodes(void);
60 long long getMeshNodesStorageId(void) { return meshNodesStorageId; }
61
62 void storeMeshFaces(void);
63 void releaseMeshFaces(void);
64
65 void storeMeshNodes(void);
66 void releaseMeshNodes(void);
67
68 void setDsMatrix(EntityCartesianVector *matrix);
69 void setDualDsMatrix(EntityCartesianVector *matrix);
70 void setDaMatrix(EntityCartesianVector *matrix);
71 void setDualDaMatrix(EntityCartesianVector *matrix);
72 void setDepsMatrix(EntityCartesianVector *matrix);
73 void setDmuMatrix(EntityCartesianVector *matrix);
74 void setDsigmaMatrix(EntityCartesianVector *matrix);
75
76 bool applyDsMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
77 bool applyDualDsMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
78 bool applyDaMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
79 bool applyDualDaMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
80 bool applyDepsMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
81 bool applyDmuMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
82 bool applyDsigmaMatrix(std::vector<double> &vector, bool keepMatrixInMemory);
83
84private:
85 virtual int getSchemaVersion(void) { return 1; };
86 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
87 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
88 void EnsureFacesLoaded(void);
89 void EnsureNodesLoaded(void);
90 void EnsureMatrixLoaded(EntityCartesianVector *&matrix, long long storageId, long long storageVersion);
91 long long getStorageId(bsoncxx::document::view &doc_view, const std::string dataName);
92 EntityCartesianVector* getDsMatrix(void);
93 EntityCartesianVector* getDualDsMatrix(void);
94 EntityCartesianVector* getDaMatrix(void);
95 EntityCartesianVector* getDualDaMatrix(void);
96 EntityCartesianVector* getDepsMatrix(void);
97 EntityCartesianVector* getDmuMatrix(void);
98 EntityCartesianVector* getDsigmaMatrix(void);
99 bool prepareMatrixApplication(std::vector<double> &vector, bool keepMatrixInMemory, EntityCartesianVector *matrix, EntityCartesianVector *&loadedMatrix);
100
101 std::vector<double> meshCoords[3];
102
103 EntityMeshCartesianFaceList *meshFaces;
104 long long meshFacesStorageId;
105 long long meshFacesStorageVersion;
106
107 EntityMeshCartesianNodes *meshNodes;
108 long long meshNodesStorageId;
109 long long meshNodesStorageVersion;
110
111 EntityCartesianVector *matrixDs;
112 EntityCartesianVector *matrixDualDs;
113 EntityCartesianVector *matrixDa;
114 EntityCartesianVector *matrixDualDa;
115 EntityCartesianVector *matrixDeps;
116 EntityCartesianVector *matrixDmu;
117 EntityCartesianVector *matrixDsigma;
118
119 long long matrixDsStorageId;
120 long long matrixDsStorageVersion;
121 long long matrixDualDsStorageId;
122 long long matrixDualDsStorageVersion;
123 long long matrixDaStorageId;
124 long long matrixDaStorageVersion;
125 long long matrixDualDaStorageId;
126 long long matrixDualDaStorageVersion;
127 long long matrixDepsStorageId;
128 long long matrixDepsStorageVersion;
129 long long matrixDmuStorageId;
130 long long matrixDmuStorageVersion;
131 long long matrixDsigmaStorageId;
132 long long matrixDsigmaStorageVersion;
133};
134
135
136
bsoncxx::types::value value
Definition DocumentManager.h:16
@ vector
Definition MonitorSettings.h:18
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27