1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
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. +
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. +
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/>. +
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
34 int m_NumberOfIterations
;
36 bool m_UseNormalCorrection
;
37 double m_UnderRelaxation
;
39 int m_ProjectionIterations
;
40 double m_FeatureMagic
;
43 QVector
<QVector
<int> > m_NodeToBc
;
45 bool m_CorrectCurvature
;
48 QSet
<vtkIdType
> m_AllowedCellTypes
;
49 QVector
<bool> m_Fixed
;
51 SurfaceNodeMovementCheck m_Check
;
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
);
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
);
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
; }