improved problems with adjacent (to prism layer) boundaries
[engrid-github.git] / src / libengrid / updatedesiredmeshdensity.h
blobb114d81a9a83c51a7035bf8ef40dfe07f4c26549
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
11 // + +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
16 // + +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #ifndef UPDATEDESIREDMESHDENSITY_H
22 #define UPDATEDESIREDMESHDENSITY_H
24 #include "surfaceoperation.h"
26 #include "vertexmeshdensity.h"
27 #include "edgelengthsourcemanager.h"
30 /// Update desired mesh density, i.e. the field used for surface meshing
32 class UpdateDesiredMeshDensity : public SurfaceOperation
35 private: // data types
37 struct point_t {
38 vec3_t x;
39 vec3_t n;
40 double L;
41 QList<int> idx;
42 vtkIdType id_face;
45 private: //attributes
47 QSet<int> m_BCs;
48 double m_GrowthFactor;
49 double m_MaxEdgeLength;
50 double m_MinEdgeLength;
51 double m_NodesPerQuarterCircle;
52 double m_FeatureResolution2D;
53 double m_FeatureResolution3D;
54 double m_FeatureThresholdAngle;
55 QVector<double> m_FeatureSize;
56 QVector<bool> m_Fixed;
57 EdgeLengthSourceManager m_ELSManager;
58 bool m_OnlySurfaceCells;
59 bool m_Relaxation;
61 protected: // methods
63 void computeFeature(const QList<point_t> points, QVector<double> &cl_pre, double res, int restriction_type);
64 void computeFeature2D(QVector<double> &cl_pre);
65 void computeFeature3D(QVector<double> &cl_pre);
66 double computeSearchDistance(vtkIdType id_face);
67 void computeExistingLengths();
70 public: //methods
72 UpdateDesiredMeshDensity();
73 virtual void operate();
75 void readSettings();
76 void setVertexMeshDensityVector(QVector <VertexMeshDensity> const & vmd) { m_VMDvector = vmd; }
77 void setMaxEdgeLength(double l) { m_MaxEdgeLength = l; }
78 void setMinEdgeLength(double l) { m_MinEdgeLength = l; }
79 void setNodesPerQuarterCircle(double N) { m_NodesPerQuarterCircle = N; }
80 void setCellGrowthFactor(double cgf) { m_GrowthFactor = cgf; }
81 void setVolumeCellsOn() { m_OnlySurfaceCells = false; }
82 void setVolumeCellsOff() { m_OnlySurfaceCells = true; }
83 void setFeatureResolution2D(double n) { m_FeatureResolution2D = n; }
84 void setFeatureResolution3D(double n) { m_FeatureResolution3D = n; }
85 void setFeatureThresholdAngle(double a) { m_FeatureThresholdAngle = a; }
86 void setRelaxationOff() { m_Relaxation = false; }
87 void setRelaxationOn() { m_Relaxation = true; }
91 #endif