Version: 9.16.0
SMESH_Homard.hxx
Go to the documentation of this file.
1// HOMARD HOMARD : implementation of HOMARD idl descriptions
2//
3// Copyright (C) 2011-2026 CEA, EDF
4//
5// This library is free software; you can redistribute it and/or
6// modify it under the terms of the GNU Lesser General Public
7// License as published by the Free Software Foundation; either
8// version 2.1 of the License, or (at your option) any later version.
9//
10// This library is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13// Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public
16// License along with this library; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18//
19// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20//
21// File : HOMARD.hxx
22// Author : Gerald NICOLAS, EDF
23// Module : HOMARD
24
25#ifndef _SMESH_HOMARD_ADAPT_HXX_
26#define _SMESH_HOMARD_ADAPT_HXX_
27
28#include "SMESH_SMESH.hxx"
29
30#include <vector>
31#include <string>
32#include <list>
33
34#include <iostream>
35#include <fstream>
36
37#if defined WIN32
38#pragma warning ( disable: 4251 )
39#endif
40
41namespace SMESHHOMARDImpl
42{
43
45{
46public:
49
50 // Generalites
51 void SetName( const char* Name );
52 std::string GetName() const;
53
54 std::string GetDumpPython() const;
55
56 // Caracteristiques
57 void SetType( int Type );
58 int GetType() const;
59
60 void SetMeshName( const char* MeshName );
61 std::string GetMeshName() const;
62
63 void SetDataFile( const char* DataFile );
64 std::string GetDataFile() const;
65
66 void SetCylinder( double X0, double X1, double X2, double X3,
67 double X4, double X5, double X6 );
68 void SetSphere( double X0, double X1, double X2, double X3 );
69 void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
70 double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2);
71 void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle,
72 double Xcentre, double Ycentre, double ZCentre);
73 void SetTorus( double X0, double X1, double X2, double X3,
74 double X4, double X5, double X6, double X7 );
75
76 std::vector<double> GetCoords() const;
77
78 void SetLimit( double X0, double X1, double X2 );
79 std::vector<double> GetLimit() const;
80
81 void AddGroup( const char* LeGroupe);
82 void SetGroups(const std::list<std::string>& ListGroup );
83 const std::list<std::string>& GetGroups() const;
84
85private:
86 std::string _Name;
87 std::string _DataFile;
88 std::string _MeshName;
89 int _Type;
90 double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax;
91 double _Xaxe, _Yaxe, _Zaxe;
92 double _Xcentre, _Ycentre, _Zcentre, _rayon;
93 double _Xincr, _Yincr, _Zincr;
94 double _Xcentre1, _Ycentre1, _Zcentre1, _Rayon1;
95 double _Xcentre2, _Ycentre2, _Zcentre2, _Rayon2;
96 double _Angle;
97
98 std::list<std::string> _ListGroupSelected;
99};
100
102{
103public:
104 HOMARD_Cas();
105 ~HOMARD_Cas();
106
107 // Generalites
108 std::string GetDumpPython() const;
109
110 // Caracteristiques
111 int SetDirName( const char* NomDir );
112 std::string GetDirName() const;
113
114 void SetBoundingBox( const std::vector<double>& extremas );
115 const std::vector<double>& GetBoundingBox() const;
116
117 void AddGroup( const char* Group);
118 void SetGroups( const std::list<std::string>& ListGroup );
119 const std::list<std::string>& GetGroups() const;
120 void SupprGroups();
121
122 void AddBoundary( const char* Boundary );
123 void AddBoundaryGroup( const char* Boundary, const char* Group );
124 const std::list<std::string>& GetBoundaryGroup() const;
125 void SupprBoundaryGroup();
126
127 void AddIteration( const char* NomIteration );
128
129private:
130 std::string _NomDir;
131 int _Etat;
132
133 std::vector<double> _Boite; // cf HomardQTCommun pour structure du vecteur
134 std::list<std::string> _ListGroup;
135 std::list<std::string> _ListBoundaryGroup;
136
137 typedef std::string IterName;
138 typedef std::list<IterName> IterNames;
140};
141
143{
144public:
145 HomardDriver(const std::string siter, const std::string siterp1);
147 //
148 void TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue );
149 void TexteInfo( int TypeBila, int NumeIter );
150 void TexteMajCoords( int NumeIter );
151 void CreeFichierDonn();
152 void TexteAdap();
153 void CreeFichier();
154 void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres );
155 void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres );
156 void TexteConfRaffDera( int ConfType );
157
158 void TexteBoundaryOption( int BoundaryOption );
159 void TexteBoundaryCAOGr( const std::string GroupName );
160 void TexteBoundaryDi( const std::string MeshName, const std::string MeshFile );
161 void TexteBoundaryDiGr( const std::string GroupName );
162 void TexteBoundaryAn( const std::string NameBoundary, int NumeBoundary, int BoundaryType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7 );
163 void TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName );
164
165 void TexteAdvanced( int NivMax, double DiamMin, int AdapInit, int LevelOutput );
166 void TexteInfoCompute( int MessInfo );
167 //
168 int ExecuteHomard();
169
170public:
172 std::string _HOMARD_Exec;
173 std::string _NomDir;
175 std::string _NomFichierConf;
176 std::string _NomFichierDonn;
177 std::string _siter;
178 std::string _siterp1;
179 std::string _Texte;
180 bool _bLu;
181};
182
183class HOMARD_Iteration;
184
186{
187public :
188 HOMARD_Gen();
189 ~HOMARD_Gen();
190};
191
193{
194public:
197
198 // Generalites
199 void SetName( const char* Name );
200 std::string GetName() const;
201
202 // Caracteristiques
203 void SetDirNameLoc( const char* NomDir );
204 std::string GetDirNameLoc() const;
205
206 void SetNumber( int NumIter );
207 int GetNumber() const;
208
209 void SetState( int etat );
210 int GetState() const;
211
212 void SetMeshName( const char* NomMesh );
213 std::string GetMeshName() const;
214
215 void SetMeshFile( const char* MeshFile );
216 std::string GetMeshFile() const;
217
218 void SetLogFile( const char* LogFile );
219 std::string GetLogFile() const;
220
221 void SetFileInfo( const char* FileInfo );
222 std::string GetFileInfo() const;
223
224 // Divers
225 void SetInfoCompute( int MessInfo );
226 int GetInfoCompute() const;
227
228private:
229 std::string _Name;
230 int _Etat;
232 std::string _NomMesh;
233 std::string _MeshFile;
234 std::string _LogFile;
235 std::string _NomDir;
236 std::string _FileInfo;
238};
239
240} // namespace SMESHHOMARDImpl
241
242#endif
#define SMESH_EXPORT
Definition: SMESH_SMESH.hxx:37
Definition: SMESH_Homard.hxx:45
std::string _MeshName
Definition: SMESH_Homard.hxx:88
int _Type
Definition: SMESH_Homard.hxx:89
double _Rayon2
Definition: SMESH_Homard.hxx:95
double _Angle
Definition: SMESH_Homard.hxx:96
double _Xaxe
Definition: SMESH_Homard.hxx:91
std::string _Name
Definition: SMESH_Homard.hxx:86
double _Xmax
Definition: SMESH_Homard.hxx:90
std::list< std::string > _ListGroupSelected
Definition: SMESH_Homard.hxx:98
std::string _DataFile
Definition: SMESH_Homard.hxx:87
double _Xincr
Definition: SMESH_Homard.hxx:93
double _Rayon1
Definition: SMESH_Homard.hxx:94
double _rayon
Definition: SMESH_Homard.hxx:92
Definition: SMESH_Homard.hxx:102
int _Etat
Definition: SMESH_Homard.hxx:131
std::string IterName
Definition: SMESH_Homard.hxx:137
std::list< std::string > _ListGroup
Definition: SMESH_Homard.hxx:134
std::list< std::string > _ListBoundaryGroup
Definition: SMESH_Homard.hxx:135
std::list< IterName > IterNames
Definition: SMESH_Homard.hxx:138
std::string _NomDir
Definition: SMESH_Homard.hxx:130
std::vector< double > _Boite
Definition: SMESH_Homard.hxx:133
IterNames _ListIter
Definition: SMESH_Homard.hxx:139
Definition: SMESH_Homard.hxx:186
Definition: SMESH_Homard.hxx:193
std::string _NomDir
Definition: SMESH_Homard.hxx:235
int _Etat
Definition: SMESH_Homard.hxx:230
std::string _Name
Definition: SMESH_Homard.hxx:229
std::string _LogFile
Definition: SMESH_Homard.hxx:234
std::string _FileInfo
Definition: SMESH_Homard.hxx:236
std::string _MeshFile
Definition: SMESH_Homard.hxx:233
std::string _NomMesh
Definition: SMESH_Homard.hxx:232
int _NumIter
Definition: SMESH_Homard.hxx:231
int _MessInfo
Definition: SMESH_Homard.hxx:237
Definition: SMESH_Homard.hxx:143
std::string _Texte
Definition: SMESH_Homard.hxx:179
bool _bLu
Definition: SMESH_Homard.hxx:180
std::string _NomFichierConf
Definition: SMESH_Homard.hxx:175
std::string _siter
Definition: SMESH_Homard.hxx:177
std::string _NomFichierDonn
Definition: SMESH_Homard.hxx:176
std::string _NomFichierConfBase
Definition: SMESH_Homard.hxx:174
std::string _siterp1
Definition: SMESH_Homard.hxx:178
std::string _NomDir
Definition: SMESH_Homard.hxx:173
int _modeHOMARD
Definition: SMESH_Homard.hxx:171
std::string _HOMARD_Exec
Definition: SMESH_Homard.hxx:172
Definition: SMESH_Homard.cxx:48
QString GetName(const Handle(SALOME_InteractiveObject)&theIO)
Definition: SMESHGUI_Utils.cxx:252
SMESH::SMESH_Group_var AddGroup(SMESH::SMESH_Mesh_ptr theMesh, SMESH::ElementType theType, const QString &theGroupName)
Definition: SMESHGUI_GroupUtils.cxx:38
void SetName(_PTR(SObject) theSObject, const QString &theName)
Definition: SMESHGUI_Utils.cxx:134