Salome HOME
Merge branch 'agy/codeutils' of ssh://git.salome-platform.org/modules/med into agy...
[tools/medcoupling.git] / src / INTERP_KERNEL / BoxSplittingOptions.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay
20
21 #ifndef __BOXSPLITTINGOPTIONS_HXX__
22 #define __BOXSPLITTINGOPTIONS_HXX__
23
24 #include "INTERPKERNELDefines.hxx"
25 #include "NormalizedUnstructuredMesh.hxx"
26
27 #include <string>
28
29 namespace INTERP_KERNEL
30
31   /*!
32    * \class BoxSplittingOptions
33    * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
34    */
35   class INTERPKERNEL_EXPORT BoxSplittingOptions
36   {
37   private:
38     double _efficiency_goal;
39     double _efficiency_threshold;
40     int _min_patch_length;
41     int _max_patch_length;
42     int _max_nb_cells_in_patch;
43   public:
44     BoxSplittingOptions() { init(); }
45     void init();
46     double getEfficiencyGoal() const { return _efficiency_goal; }
47     void setEfficiencyGoal(double efficiency) { _efficiency_goal=efficiency; }
48     double getEfficiencyThreshold() const { return _efficiency_threshold; }
49     void setEfficiencyThreshold(double efficiencyThreshold) { _efficiency_threshold=efficiencyThreshold; }
50     int getMinimumPatchLength() const { return _min_patch_length; }
51     void setMinimumPatchLength(int minPatchLength) { _min_patch_length=minPatchLength; }
52     int getMaximumPatchLength() const { return _max_patch_length; }
53     void setMaximumPatchLength(int maxNbCellPatch) { _max_patch_length=maxNbCellPatch; }
54     int getMaximumNbOfCellsInPatch() const { return _max_nb_cells_in_patch; }
55     void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) { _max_nb_cells_in_patch=maxNbCellsInPatch; }
56     void copyOptions(const BoxSplittingOptions & other) { *this=other; }
57     std::string printOptions() const;
58   private:
59     static const int DFT_MIN_PATCH_LENGTH=1;
60     static const int DFT_MAX_PATCH_LENGTH=2147483647;
61     static const int DFT_MAX_PATCH_MEASURE=2147483647;
62     static const double DFT_EFFICIENCY_GOAL;
63     static const double DFT_EFFICIENCY_THRESHOLD;
64   public:
65     static const char PRECISION_STR[];
66   };
67 }
68
69 #endif