Salome HOME
Fix bos #26435 MG-Tetra_HPC failed with new licence mechanism:
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis.hxx
1 // Copyright (C) 2007-2021  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
20 // ---
21 // File   : GHS3DPRLPlugin_Hypothesis.hxx
22 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
23 // ---
24 //
25 #ifndef _GHS3DPRLPlugin_Hypothesis_HXX_
26 #define _GHS3DPRLPlugin_Hypothesis_HXX_
27
28 #include "GHS3DPRLPlugin_Defs.hxx"
29
30 #include "SMESH_Hypothesis.hxx"
31 #include "Utils_SALOME_Exception.hxx"
32 #include <TCollection_AsciiString.hxx>
33
34 //  Parameters for work of GHS3DPRL
35 //
36
37 class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis
38 {
39 public:
40
41   GHS3DPRLPlugin_Hypothesis(int hypId, SMESH_Gen* gen);
42
43   static const char* GetHypType() { return "MG-Tetra Parallel Parameters"; }
44
45   static std::string DefaultWorkingDirectory();
46
47   /*!
48    * \brief Return a unique file name
49    */
50   static std::string GetFileName(const GHS3DPRLPlugin_Hypothesis* hyp);
51
52   void                  SetMEDName(std::string theVal);
53   std::string           GetMEDName() const { return _MEDName; }
54
55   void                  SetNbPart(int theVal);
56   int                   GetNbPart() const { return _NbPart; }
57
58   void                  SetKeepFiles(bool theVal);
59   bool                  GetKeepFiles() const { return _KeepFiles; }
60
61   void                  SetBackground(bool theVal);
62   bool                  GetBackground() const { return _Background; }
63
64   void                  SetMultithread(bool theVal);
65   bool                  GetMultithread() const { return _Multithread; }
66
67   //ToMergeSubdomains ToTagSubdomains ToOutputInterfaces ToDiscardSubdomains
68   void                  SetGradation(float theVal);
69   float                 GetGradation() const { return _Gradation; }
70
71   void                  SetMinSize(float theVal);
72   float                 GetMinSize() const { return _MinSize; }
73
74   void                  SetMaxSize(float theVal);
75   float                 GetMaxSize() const { return _MaxSize; }
76
77   void                  SetAdvancedOption(const char* theOptAndVals );
78   std::string           GetAdvancedOption() const { return _AdvOptions; }
79
80   // the parameters default values
81
82   static std::string    GetDefaultMEDName();
83   static int            GetDefaultNbPart();
84   static bool           GetDefaultKeepFiles();
85   static bool           GetDefaultBackground();
86   static bool           GetDefaultMultithread();
87   static float          GetDefaultGradation();
88   static float          GetDefaultMinSize();
89   static float          GetDefaultMaxSize();
90
91   // Persistence
92   virtual std::ostream& SaveTo(std::ostream& save);
93   virtual std::istream& LoadFrom(std::istream& load);
94
95   /*!
96    * \brief Does nothing
97    * \param theMesh - the built mesh
98    * \param theShape - the geometry of interest
99    * \retval bool - always false
100    */
101   virtual bool          SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
102   /*!
103    * \brief Initialize my parameter values by default parameters.
104    *  \retval bool - true if parameter values have been successfully defined
105    */
106   virtual bool          SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
107
108 private:
109   int         _countSubMesh;
110   int         _countTotal;
111   int         _nodeRefNumber;
112
113   std::string _MEDName;     // generic path/name of med files
114   int         _NbPart;      // number of partitions
115   bool        _KeepFiles;   // keep intermediates tepal files or not
116   bool        _Background;  // mg-tetra_hpc in background
117   bool        _Multithread; // launch mg-tetra_hpc multithread version, else mpi version
118   float       _Gradation;
119   float       _MinSize;
120   float       _MaxSize;
121   std::string _AdvOptions;
122   };
123
124 #endif