fixed edge display for volume cells
[engrid-github.git] / src / libengrid / laplacesmoother.h
blob89af946d922f93ce7573e0f82ea9e8d40c7a29b8
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 LAPLACESMOOTHER_H
22 #define LAPLACESMOOTHER_H
24 #include "surfaceoperation.h"
25 #include "surfacenodemovementcheck.h"
26 #include "cadinterface.h"
28 class LaplaceSmoother : public SurfaceOperation
31 private:
33 QSet<int> m_BCs;
34 int m_NumberOfIterations;
35 bool m_UseProjection;
36 bool m_UseNormalCorrection;
37 double m_UnderRelaxation;
38 bool m_Success;
39 int m_ProjectionIterations;
40 double m_FeatureMagic;
41 double m_Limit;
43 QVector<QVector<int> > m_NodeToBc;
45 bool m_CorrectCurvature;
46 bool m_NoCheck;
48 QSet<vtkIdType> m_AllowedCellTypes;
49 QVector<bool> m_Fixed;
51 SurfaceNodeMovementCheck m_Check;
54 private: // methods
56 bool setNewPosition(vtkIdType id_node, vec3_t x_new);
57 bool moveNode(vtkIdType id_node, vec3_t &Dx);
58 void featureCorrection(vtkIdType id_node, CadInterface* cad_interface, vec3_t &x_new);
61 public:
63 LaplaceSmoother(); ///< default constructor
64 virtual void operate(); ///< Run operation
65 void setNumberOfIterations(int N) { m_NumberOfIterations = N;} ///< Set number of iterations
66 void setProjectionOn() { m_UseProjection = true; }
67 void setProjectionOff() { m_UseProjection = false; }
68 void setNormalCorrectionOn() { m_UseNormalCorrection = true; }
69 void setNormalCorrectionOff() { m_UseNormalCorrection = false; }
70 bool succeeded() { return m_Success; }
71 void fixNodes(const QVector<bool> &fixnodes);
73 public:
75 void setCorrectCurvature(bool b) { m_CorrectCurvature = b; }
76 bool getCorrectCurvature() { return m_CorrectCurvature; }
77 void setNoCheck(bool b) { m_NoCheck = b; }
78 bool getNoCheck() { return m_NoCheck; }
79 void setProjectionIterations(int n) { m_ProjectionIterations = n; }
83 #endif