Salome HOME
Implement bos #26453: [EDF] (2021) SMESH: uniform refinement
[modules/smesh.git] / src / SMESH / SMESH_Homard.cxx
1 //  HOMARD HOMARD : implementation of HOMARD idl descriptions
2 //
3 // Copyright (C) 2011-2021  CEA/DEN, EDF R&D
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_Boundary.cxx
22 //  Author : Gerald NICOLAS, EDF
23 //  Module : HOMARD
24 //
25 // Remarques :
26 // L'ordre de description des fonctions est le meme dans tous les fichiers
27 // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
28 // 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
29 // 2. Les caracteristiques
30 // 3. Le lien avec les autres structures
31 //
32 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
33
34 #include "SMESH_Homard.hxx"
35
36 #include <Utils_SALOME_Exception.hxx>
37 #include <utilities.h>
38
39 #include <iostream>
40 #include <sstream>
41 #include <cstdlib>
42 #include <sys/stat.h>
43
44 #ifndef WIN32
45 #include <unistd.h>
46 #else
47 #include <direct.h>
48 #endif
49
50 namespace SMESHHOMARDImpl
51 {
52
53   std::string SEPARATOR = "|" ;
54
55   /*!
56     \brief Read next chunk of data from the string
57     \internal
58
59     The function tries to read next chunk of the data from the input string \a str.
60     The parameter \a start specifies the start position of next chunk. If the operation
61     read the chunk successfully, after its completion this parameter will refer to the
62     start position of the next chunk. The function returns resulting chunk as a string.
63     The status of the operation is returned via \a ok parameter.
64
65     \param str source data stream string
66     \param start start position to get next chunk
67     \param ok in this variable the status of the chunk reading operation is returned
68     \return next chunk read from the string
69   */
70   static std::string getNextChunk( const std::string& str, std::string::size_type& start, bool& ok )
71   {
72     std::string chunk = "";
73     ok = false;
74     if ( start <= str.size() ) {
75       std::string::size_type end = str.find( separator(), start );
76       chunk = str.substr( start, end == std::string::npos ? std::string::npos : end-start );
77       start = end == std::string::npos ? str.size()+1 : end + separator().size();
78       ok = true;
79     }
80     return chunk;
81   }
82
83   /*!
84     \brief Get persistence signature
85     \param type persistence entity type
86     \return persistence signature
87   */
88   std::string GetSignature( SignatureType type )
89   {
90     std::string signature = "";
91     switch ( type ) {
92     case Case:       signature = "CASE"; break;
93     case Zone:       signature = "ZONE"; break;
94     case Hypothesis: signature = "HYPO"; break;
95     case Iteration:  signature = "ITER"; break;
96     case Boundary:   signature = "BOUNDARY"; break;
97     default: break;
98     }
99     signature += separator();
100     return signature;
101   }
102
103   /*!
104     \brief Get data separator
105     \return string that is used to separate data entities in the stream
106   */
107   std::string separator()
108   {
109     return SEPARATOR ;
110   }
111
112 // =======================
113 // 1.1. Case
114 // =======================
115   /*!
116     \brief Dump case to the string
117     \param cas case being dumped
118     \return string representation of the case
119   */
120   std::string Dump( const HOMARD_Cas& cas )
121   {
122     std::stringstream os;
123     std::string saux ;
124     // ...
125     MESSAGE( ". Sauvegarde du cas "<<cas.GetName());
126     os << cas.GetName();
127     os << separator() << cas.GetDirName();
128     os << separator() << cas.GetConfType();
129     os << separator() << cas.GetExtType();
130
131     std::vector<double> coor = cas.GetBoundingBox();
132     os << separator() << coor.size();
133     for ( int i = 0; i < coor.size(); i++ )
134           os << separator() << coor[i];
135
136     std::list<std::string> ListString = cas.GetIterations();
137     os << separator() << ListString.size();
138     std::list<std::string>::const_iterator it;
139     for ( it = ListString.begin(); it != ListString.end(); ++it )
140           os << separator() << *it;
141
142     ListString = cas.GetGroups();
143     os << separator() << ListString.size();
144     for ( it = ListString.begin(); it != ListString.end(); ++it )
145          os << separator() << *it;
146     ListString = cas.GetBoundaryGroup();
147     os << separator() << ListString.size();
148     for ( it = ListString.begin(); it != ListString.end(); ++it )
149          os << separator() << *it;
150
151     os << separator() << cas.GetPyram();
152
153     saux = os.str();
154 //     MESSAGE( ". Fin avec "<<saux);
155     return saux ;
156   }
157 //
158 // ==============
159 // 1.2. Iteration
160 // ==============
161 //
162   /*!
163     \brief Dump iteration to the string
164     \param iteration iteration being dumped
165     \return string representation of the iteration
166   */
167   std::string Dump( const HOMARD_Iteration& iteration )
168   {
169     std::stringstream os;
170     std::string saux ;
171     // ...
172     MESSAGE( ". Sauvegarde de l'iteration "<<iteration.GetName());
173     os << iteration.GetName();
174     os << separator() << iteration.GetState();
175     os << separator() << iteration.GetNumber();
176     os << separator() << iteration.GetMeshFile();
177     os << separator() << iteration.GetLogFile();
178     os << separator() << iteration.GetMeshName();
179     os << separator() << iteration.GetFieldFile();
180     os << separator() << iteration.GetTimeStep();
181     os << separator() << iteration.GetRank();
182     os << separator() << iteration.GetIterParentName();
183     //
184     std::list<std::string> ListString = iteration.GetIterations();
185     os << separator() << ListString.size();
186     std::list<std::string>::const_iterator it;
187     for ( it = ListString.begin(); it != ListString.end(); ++it )
188       os << separator() << *it;
189
190     os << separator() << iteration.GetHypoName();
191     os << separator() << iteration.GetCaseName();
192     os << separator() << iteration.GetDirNameLoc();
193
194     saux = os.str();
195 //     MESSAGE( ". Fin avec "<<saux);
196     return saux ;
197   }
198 //
199 // ==============
200 // 1.3. hypothese
201 // ==============
202   /*!
203     \brief Dump hypothesis to the string
204     \param hypothesis hypothesis being dumped
205     \return string representation of the hypothesis
206   */
207   std::string Dump( const HOMARD_Hypothesis& hypothesis )
208   {
209     std::stringstream os;
210     std::string saux ;
211     // ...
212     MESSAGE( ". Sauvegarde de l'hypothese "<<hypothesis.GetName());
213     os << hypothesis.GetName();
214     os << separator() << hypothesis.GetCaseCreation();
215     os << separator() << hypothesis.GetAdapType();
216     os << separator() << hypothesis.GetRefinType();
217     os << separator() << hypothesis.GetUnRefType();
218     os << separator() << hypothesis.GetFieldName();
219     os << separator() << hypothesis.GetRefinThrType();
220     os << separator() << hypothesis.GetThreshR();
221     os << separator() << hypothesis.GetUnRefThrType();
222     os << separator() << hypothesis.GetThreshC();
223     os << separator() << hypothesis.GetUseField();
224     os << separator() << hypothesis.GetUseComp();
225     os << separator() << hypothesis.GetTypeFieldInterp();
226
227     std::list<std::string> ListString = hypothesis.GetIterations();
228     std::list<std::string>::const_iterator it;
229     os << separator() << ListString.size();
230     for ( it = ListString.begin(); it != ListString.end(); ++it )
231          os << separator() << *it;
232
233     ListString = hypothesis.GetZones();
234     os << separator() << ListString.size();
235     for ( it = ListString.begin(); it != ListString.end(); ++it )
236           os << separator() << *it;
237
238     ListString = hypothesis.GetComps();
239     os << separator() << ListString.size();
240     for ( it = ListString.begin(); it != ListString.end(); ++it )
241          os << separator() << *it;
242
243     ListString = hypothesis.GetGroups();
244     os << separator() << ListString.size();
245     for ( it = ListString.begin(); it != ListString.end(); ++it )
246           os << separator() << *it;
247
248     ListString = hypothesis.GetFieldInterps();
249     os << separator() << ListString.size();
250     for ( it = ListString.begin(); it != ListString.end(); ++it )
251           os << separator() << *it;
252
253     os << separator() << hypothesis.GetNivMax();
254     os << separator() << hypothesis.GetDiamMin();
255     os << separator() << hypothesis.GetAdapInit();
256     os << separator() << hypothesis.GetExtraOutput();
257
258     saux = os.str();
259 //     MESSAGE( ". Fin avec "<<saux);
260     return saux ;
261   }
262 //
263 // ==============================
264 // 1.5. Archivage d'une frontiere
265 // ==============================
266
267   /*!
268     \brief Dump boundary to the string
269     \param boundary boundary being dumped
270     \return string representation of the boundary
271   */
272   std::string Dump( const HOMARD_Boundary& boundary )
273   {
274     std::stringstream os;
275     std::string saux ;
276     MESSAGE( ". Sauvegarde de la frontiere "<<boundary.GetName());
277
278     int BoundaryType = boundary.GetType() ;
279
280     os << boundary.GetName() ;
281     os << separator() << BoundaryType ;
282     os << separator() << boundary.GetCaseCreation() ;
283
284     if ( BoundaryType == -1 )
285     {
286       os << separator() << boundary.GetDataFile();
287     }
288     else if ( BoundaryType == 0 )
289     {
290       os << separator() << boundary.GetMeshName();
291       os << separator() << boundary.GetDataFile();
292     }
293     else {
294       std::vector<double> coor = boundary.GetCoords() ;
295       for ( int i = 0; i < coor.size(); i++ )
296             os << separator() << coor[i];
297       std::vector<double> limit = boundary.GetLimit();
298       for ( int i = 0; i < limit.size(); i++ )
299             os << separator() << limit[i];
300     }
301
302     std::list<std::string> ListString = boundary.GetGroups();
303     std::list<std::string>::const_iterator it;
304     os << separator() << ListString.size();
305     for ( it = ListString.begin(); it != ListString.end(); ++it )
306           os << separator() << *it;
307
308     saux = os.str();
309 //     MESSAGE( ". Fin avec "<<saux);
310     return saux ;
311   }
312
313 //
314 // 2. Restauration des objets
315 // ==========================
316 // 2.1. Case
317 // ==========================
318 //
319   /*!
320     \brief Restore case from the string
321     \param cas case being restored
322     \param stream string representation of the case
323     \return \c true if case is correctly restored or \c false otherwise
324   */
325   bool Restore( HOMARD_Cas& cas, const std::string& stream )
326   {
327     MESSAGE( ". Restoration du cas ");
328     std::string::size_type start = 0;
329     std::string chunk, chunkNext;
330     bool ok;
331     // ...
332     chunk = getNextChunk( stream, start, ok );
333     if ( !ok ) return false;
334     cas.SetName( chunk.c_str() );
335
336     chunk = getNextChunk( stream, start, ok );
337     if ( !ok ) return false;
338     cas.SetDirName( chunk.c_str() );
339
340     chunk = getNextChunk( stream, start, ok );
341     if ( !ok ) return false;
342     cas.SetConfType( atoi( chunk.c_str() ) );
343
344     chunk = getNextChunk( stream, start, ok );
345     if ( !ok ) return false;
346     cas.SetExtType( atoi( chunk.c_str() ) );
347
348     chunk = getNextChunk( stream, start, ok );
349     if ( !ok ) return false;
350
351     int size = atoi( chunk.c_str() );
352     std::vector<double> boite;
353     boite.resize( size );
354     for ( int i = 0; i < size; i++ ) {
355       chunk = getNextChunk( stream, start, ok );
356       if ( !ok ) return false;
357       boite[i] = strtod( chunk.c_str(), 0 );
358     }
359     cas.SetBoundingBox( boite );
360
361     chunk = getNextChunk( stream, start, ok );
362     if ( !ok ) return false;
363
364     size = atoi( chunk.c_str() );
365     for ( int i = 0; i < size; i++ ) {
366       chunk = getNextChunk( stream, start, ok );
367       if ( !ok ) return false;
368       cas.AddIteration( chunk.c_str() );
369     }
370
371     chunk = getNextChunk( stream, start, ok );
372     if ( !ok ) return false;
373     size = atoi( chunk.c_str() );
374     for ( int i = 0; i < size; i++ )
375     {
376       chunk = getNextChunk( stream, start, ok );
377       if ( !ok ) return false;
378       cas.AddGroup( chunk.c_str() );
379     }
380
381     chunk = getNextChunk( stream, start, ok );
382     if ( !ok ) return false;
383     size = atoi( chunk.c_str() );
384     for ( int i = 0; i < size; i++ ) {
385       chunk = getNextChunk( stream, start, ok );
386       if ( !ok ) return false;
387       i++;
388       chunkNext = getNextChunk( stream, start, ok );
389       if ( !ok ) return false;
390       cas.AddBoundaryGroup( chunk.c_str(), chunkNext.c_str() );
391     }
392
393     chunk = getNextChunk( stream, start, ok );
394     if ( !ok ) return false;
395     cas.SetPyram( atoi( chunk.c_str() ) );
396
397     return true;
398   }
399 //
400 // ==============
401 // 2.2. Iteration
402 // ==============
403   /*!
404     \brief Restore iteration from the string
405     \param iteration iteration being restored
406     \param stream string representation of the iteration
407     \return \c true if iteration is correctly restored or \c false otherwise
408   */
409   bool Restore( HOMARD_Iteration& iteration, const std::string& stream )
410   {
411     std::string::size_type start = 0;
412     std::string chunk;
413     bool ok;
414     chunk = getNextChunk( stream, start, ok );
415     if ( !ok ) return false;
416
417     iteration.SetName( chunk.c_str() );
418     chunk = getNextChunk( stream, start, ok );
419     if ( !ok ) return false;
420     iteration.SetState( atoi( chunk.c_str() ) );
421     chunk = getNextChunk( stream, start, ok );
422     if ( !ok ) return false;
423     iteration.SetNumber( atoi( chunk.c_str() ) );
424     chunk = getNextChunk( stream, start, ok );
425     if ( !ok ) return false;
426     iteration.SetMeshFile( chunk.c_str() );
427     chunk = getNextChunk( stream, start, ok );
428     if ( !ok ) return false;
429     iteration.SetLogFile( chunk.c_str() );
430     chunk = getNextChunk( stream, start, ok );
431     if ( !ok ) return false;
432     iteration.SetMeshName( chunk.c_str() );
433     chunk = getNextChunk( stream, start, ok );
434     if ( !ok ) return false;
435     iteration.SetFieldFile( chunk.c_str() );
436     // .
437     int timestep, rank;
438     chunk = getNextChunk( stream, start, ok );
439     if ( !ok ) return false;
440     timestep = atoi( chunk.c_str() );
441     chunk = getNextChunk( stream, start, ok );
442     if ( !ok ) return false;
443     rank = atoi( chunk.c_str() );
444     iteration.SetTimeStepRank( timestep, rank );
445     chunk = getNextChunk( stream, start, ok );
446     if ( !ok ) return false;
447     iteration.SetIterParentName( chunk.c_str() );
448     //
449     chunk = getNextChunk( stream, start, ok );
450     if ( !ok ) return false;
451     int size = atoi( chunk.c_str() );
452     for ( int i = 0; i < size; i++ ) {
453       chunk = getNextChunk( stream, start, ok );
454       if ( !ok ) return false;
455       iteration.LinkNextIteration( chunk.c_str() );
456     }
457     //
458     chunk = getNextChunk( stream, start, ok );
459     if ( !ok ) return false;
460     iteration.SetHypoName( chunk.c_str() );
461     chunk = getNextChunk( stream, start, ok );
462     if ( !ok ) return false;
463     iteration.SetCaseName( chunk.c_str() );
464     chunk = getNextChunk( stream, start, ok );
465     if ( !ok ) return false;
466     iteration.SetDirNameLoc( chunk.c_str() );
467     return true;
468   }
469
470 //
471 // ==============
472 // 2.3. hypothese
473 // ==============
474   /*!
475     \brief Restore hypothesis from the string
476     \param hypothesis hypothesis being restored
477     \param stream string representation of the hypothesis
478     \return \c true if hypothesis is correctly restored or \c false otherwise
479   */
480   bool Restore( HOMARD_Hypothesis& hypothesis, const std::string& stream )
481   {
482     std::string::size_type start = 0;
483     std::string chunk, chunkNext;
484     bool ok;
485
486     chunk = getNextChunk( stream, start, ok );
487     if ( !ok ) return false;
488     hypothesis.SetName( chunk.c_str() );
489
490     chunk = getNextChunk( stream, start, ok );
491     if ( !ok ) return false;
492     hypothesis.SetCaseCreation( chunk.c_str() );
493
494     chunk = getNextChunk( stream, start, ok );
495     if ( !ok ) return false;
496     hypothesis.SetAdapType( atoi( chunk.c_str() ) );
497
498     chunk = getNextChunk( stream, start, ok );
499     if ( !ok ) return false;
500     int typeraff = atoi( chunk.c_str() );
501     chunk = getNextChunk( stream, start, ok );
502     if ( !ok ) return false;
503     int typedera = atoi( chunk.c_str() );
504     hypothesis.SetRefinTypeDera( typeraff, typedera );
505
506     chunk = getNextChunk( stream, start, ok );
507     if ( !ok ) return false;
508     hypothesis.SetField( chunk.c_str() );
509
510     chunk = getNextChunk( stream, start, ok );
511     if ( !ok ) return false;
512     int typethr = atoi( chunk.c_str() );
513     chunk = getNextChunk( stream, start, ok );
514     if ( !ok ) return false;
515     double threshr = strtod( chunk.c_str(), 0 );
516     hypothesis.SetRefinThr( typethr, threshr );
517
518     chunk = getNextChunk( stream, start, ok );
519     if ( !ok ) return false;
520     int typethc = atoi( chunk.c_str() );
521     chunk = getNextChunk( stream, start, ok );
522     if ( !ok ) return false;
523     double threshc = strtod( chunk.c_str(), 0 );
524     hypothesis.SetUnRefThr( typethc, threshc );
525
526     chunk = getNextChunk( stream, start, ok );
527     if ( !ok ) return false;
528     hypothesis.SetUseField(atoi(chunk.c_str()));
529
530     chunk = getNextChunk( stream, start, ok );
531     if ( !ok ) return false;
532     hypothesis.SetUseComp(atoi(chunk.c_str()));
533
534     chunk = getNextChunk( stream, start, ok );
535     if ( !ok ) return false;
536     hypothesis.SetTypeFieldInterp(atoi(chunk.c_str()));
537
538     chunk = getNextChunk( stream, start, ok );
539     if ( !ok ) return false;
540     int size = atoi( chunk.c_str() );
541     for ( int i = 0; i < size; i++ ) {
542       chunk = getNextChunk( stream, start, ok );
543       if ( !ok ) return false;
544       hypothesis.LinkIteration( chunk.c_str() );
545     }
546
547     chunk = getNextChunk( stream, start, ok );
548     if ( !ok ) return false;
549     size = atoi( chunk.c_str() );
550     for ( int i = 0; i < size; i++ ) {
551       chunk = getNextChunk( stream, start, ok );
552       if ( !ok ) return false;
553       i++;
554       chunkNext = getNextChunk( stream, start, ok );
555       int typeuse = atoi( chunkNext.c_str() );
556       if ( !ok ) return false;
557       hypothesis.AddZone( chunk.c_str(), typeuse );
558     }
559
560     chunk = getNextChunk( stream, start, ok );
561     if ( !ok ) return false;
562     size = atoi( chunk.c_str() );
563     for ( int i = 0; i < size; i++ ) {
564       chunk = getNextChunk( stream, start, ok );
565       if ( !ok ) return false;
566       hypothesis.AddComp( chunk.c_str() );
567     }
568
569     chunk = getNextChunk( stream, start, ok );
570     if ( !ok ) return false;
571     size = atoi( chunk.c_str() );
572     for ( int i = 0; i < size; i++ ) {
573       chunk = getNextChunk( stream, start, ok );
574       if ( !ok ) return false;
575       hypothesis.AddGroup( chunk.c_str() );
576     }
577
578     chunk = getNextChunk( stream, start, ok );
579     if ( !ok ) return false;
580     size = atoi( chunk.c_str() );
581     for ( int i = 0; i < size; i++ ) {
582       chunk = getNextChunk( stream, start, ok );
583       if ( !ok ) return false;
584       i++;
585       chunkNext = getNextChunk( stream, start, ok );
586       int TypeInterp = atoi( chunkNext.c_str() );
587       if ( !ok ) return false;
588       hypothesis.AddFieldInterpType( chunk.c_str(), TypeInterp );
589     }
590
591     chunk = getNextChunk( stream, start, ok );
592     if ( !ok ) return false;
593     hypothesis.SetNivMax( atoi( chunk.c_str() ) );
594
595     chunk = getNextChunk( stream, start, ok );
596     if ( !ok ) return false;
597     hypothesis.SetDiamMin( strtod( chunk.c_str(), 0 ) );
598
599     chunk = getNextChunk( stream, start, ok );
600     if ( !ok ) return false;
601     hypothesis.SetAdapInit( strtod( chunk.c_str(), 0 ) );
602
603     chunk = getNextChunk( stream, start, ok );
604     if ( !ok ) return false;
605     hypothesis.SetExtraOutput( strtod( chunk.c_str(), 0 ) );
606
607     return true;
608   }
609
610 //
611 // =================================
612 // 2.5. Restauration d'une frontiere
613 // =================================
614
615   /*!
616     \brief Restore boundary from the string
617     \param boundary boundary being restored
618     \param stream string representation of the boundary
619     \return \c true if the boundary is correctly restored or \c false otherwise
620   */
621   bool Restore( HOMARD_Boundary& boundary, const std::string& stream )
622   {
623     std::string::size_type start = 0;
624     std::string chunk;
625     bool ok;
626
627     chunk = getNextChunk( stream, start, ok );
628     if ( !ok ) return false;
629     boundary.SetName( chunk.c_str() );
630
631     chunk = getNextChunk( stream, start, ok );
632     if ( !ok ) return false;
633     int BoundaryType = atoi( chunk.c_str() ) ;
634     boundary.SetType( BoundaryType );
635
636     chunk = getNextChunk( stream, start, ok );
637     if ( !ok ) return false;
638     boundary.SetCaseCreation( chunk.c_str() );
639
640     // Si analytique, les coordonnees des frontieres : le nombre depend du type
641     // Si discret, le maillage
642     // Si CAO, la géométrie
643     int lgcoords ;
644     if ( BoundaryType == -1 ) { lgcoords = -1 ; }
645     else if ( BoundaryType == 1 ) { lgcoords = 7 ; }
646     else if ( BoundaryType == 2 ) { lgcoords = 4 ; }
647     else { lgcoords = 0 ; }
648 //
649     if ( lgcoords == -1 )
650     {
651       chunk = getNextChunk( stream, start, ok );
652       if ( !ok ) return false;
653       boundary.SetDataFile( chunk.c_str() );
654     }
655     else if ( lgcoords == 0 )
656     {
657       chunk = getNextChunk( stream, start, ok );
658       if ( !ok ) return false;
659       boundary.SetMeshName( chunk.c_str() );
660
661       chunk = getNextChunk( stream, start, ok );
662       if ( !ok ) return false;
663       boundary.SetDataFile( chunk.c_str() );
664     }
665     else
666     { std::vector<double> coords;
667       coords.resize( lgcoords );
668       for ( int i = 0; i < lgcoords; i++ ) {
669         chunk = getNextChunk( stream, start, ok );
670         if ( !ok ) return false;
671         coords[i] = strtod( chunk.c_str(), 0 );
672       }
673       if ( BoundaryType == 1 )
674       { boundary.SetCylinder(coords[0],coords[1],coords[2],coords[3],coords[4],coords[5],coords[6]); }
675       else if ( BoundaryType == 2 )
676       { boundary.SetSphere( coords[0], coords[1], coords[2], coords[3]); }
677       else if ( BoundaryType == 3 )
678       { boundary.SetConeA( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6]); }
679       else if ( BoundaryType == 4 )
680       { boundary.SetConeR( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7]); }
681       // Remarque : la taille de coords est suffisante pour les limites
682       for ( int i = 0; i < 3; i++ ) {
683         chunk = getNextChunk( stream, start, ok );
684         if ( !ok ) return false;
685         coords[i] = strtod( chunk.c_str(), 0 );
686       }
687       boundary.SetLimit( coords[0], coords[1], coords[2]);
688     }
689     // Les groupes
690     chunk = getNextChunk( stream, start, ok );
691     if ( !ok ) return false;
692     int size = atoi( chunk.c_str() );
693     for ( int i = 0; i < size; i++ ) {
694       chunk = getNextChunk( stream, start, ok );
695       if ( !ok ) return false;
696       boundary.AddGroup( chunk.c_str() );
697     }
698
699     return true;
700   }
701
702 //=============================================================================
703 /*!
704  *  default constructor:
705  */
706 //=============================================================================
707 HOMARD_Boundary::HOMARD_Boundary():
708   _Name( "" ),_Type( 1 ),
709   _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ),
710   _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ),
711   _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _rayon( 0 ),
712   _Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 )
713 {
714   MESSAGE("HOMARD_Boundary");
715 }
716
717 //=============================================================================
718 HOMARD_Boundary::~HOMARD_Boundary()
719 {
720   MESSAGE("~HOMARD_Boundary");
721 }
722 //=============================================================================
723 //=============================================================================
724 // Generalites
725 //=============================================================================
726 //=============================================================================
727 void HOMARD_Boundary::SetName( const char* Name )
728 {
729   _Name = std::string( Name );
730 }
731 //=============================================================================
732 std::string HOMARD_Boundary::GetName() const
733 {
734   return _Name;
735 }
736 //=============================================================================
737 std::string HOMARD_Boundary::GetDumpPython() const
738 {
739   std::ostringstream aScript;
740   aScript << "\n# Creation of the ";
741 //
742   switch (_Type)
743   {
744     case -1:
745     {
746       aScript << "CAO boundary " << _Name << "\n";
747       aScript << "\t" << _Name << " = homard.CreateBoundaryCAO(\"" << _Name << "\", ";
748       aScript << "\"" << _DataFile << "\")\n";
749       break ;
750     }
751     case 0:
752     {
753       aScript << "discrete boundary " << _Name << "\n";
754       aScript << "\t" << _Name << " = homard.CreateBoundaryDi(\"" << _Name << "\", ";
755       aScript << "\"" << _MeshName << "\", ";
756       aScript << "\"" << _DataFile << "\")\n";
757       break ;
758     }
759     case 1:
760     {
761       aScript << "cylinder " << _Name << "\n";
762       aScript << "\t" << _Name << " = homard.CreateBoundaryCylinder(\"" << _Name << "\", ";
763       aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _rayon << ")\n";
764       break ;
765     }
766     case 2:
767     {
768       aScript << "sphere " << _Name << "\n";
769       aScript << "\t" << _Name << " = homard.CreateBoundarySphere(\"" << _Name << "\", ";
770       aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _rayon << ")\n";
771       break ;
772     }
773     case 3:
774     {
775       aScript << "cone " << _Name << "\n";
776       aScript << "\t" << _Name << " = homard.CreateBoundaryConeA(\"" << _Name << "\", ";
777       aScript << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Angle << ", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ")\n";
778       break ;
779     }
780     case 4:
781     {
782       aScript << "cone " << _Name << "\n";
783       aScript << "\t" << _Name << " = homard.CreateBoundaryConeR(\"" << _Name << "\", ";
784       aScript << _Xcentre1 << ", " << _Ycentre1 << ", " << _Zcentre1 << ", " << _Rayon1 << ", " << _Xcentre2 << ", " << _Ycentre2 << ", " << _Zcentre2 << ", " << _Rayon2 << ")\n";
785       break ;
786     }
787     case 5:
788     {
789       aScript << "tore " << _Name << "\n";
790       aScript << "\t" << _Name << " = homard.CreateBoundaryTorus(\"" << _Name << "\", ";
791       aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon1 << ", " << _Rayon2 << ")\n";
792       break ;
793     }
794   }
795
796   return aScript.str();
797 }
798 //=============================================================================
799 //=============================================================================
800 // Caracteristiques
801 //=============================================================================
802 //=============================================================================
803 void HOMARD_Boundary::SetType( int Type )
804 {
805   _Type = Type;
806 }
807 //=============================================================================
808 int HOMARD_Boundary::GetType() const
809 {
810   return _Type;
811 }
812 //=============================================================================
813 void HOMARD_Boundary::SetMeshName( const char* MeshName )
814 {
815   _MeshName = std::string( MeshName );
816 }
817 //=============================================================================
818 std::string HOMARD_Boundary::GetMeshName() const
819 {
820   return _MeshName;
821 }
822 //=============================================================================
823 void HOMARD_Boundary::SetDataFile( const char* DataFile )
824 {
825   _DataFile = std::string( DataFile );
826 }
827 //=============================================================================
828 std::string HOMARD_Boundary::GetDataFile() const
829 {
830   return _DataFile;
831 }
832 //=======================================================================================
833 void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2,
834                                    double X3, double X4, double X5, double X6 )
835 {
836   _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
837   _Xaxe = X3; _Yaxe = X4; _Zaxe = X5;
838   _rayon = X6;
839 }
840 //======================================================================
841 void HOMARD_Boundary::SetSphere( double X0, double X1, double X2, double X3 )
842 {
843   _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
844   _rayon = X3;
845 }
846 //======================================================================
847 void HOMARD_Boundary::SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
848                                 double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2)
849 {
850   _Xcentre1 = Xcentre1; _Ycentre1 = Ycentre1; _Zcentre1 = Zcentre1;
851   _Rayon1 = Rayon1;
852   _Xcentre2 = Xcentre2; _Ycentre2 = Ycentre2; _Zcentre2 = Zcentre2;
853   _Rayon2 = Rayon2;
854 }
855 //======================================================================
856 void HOMARD_Boundary::SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle,
857                                 double Xcentre, double Ycentre, double Zcentre)
858 {
859   _Xaxe = Xaxe; _Yaxe = Yaxe; _Zaxe = Zaxe;
860   _Angle = Angle;
861   _Xcentre = Xcentre; _Ycentre = Ycentre; _Zcentre = Zcentre;
862 }
863 //=======================================================================================
864 void HOMARD_Boundary::SetTorus( double X0, double X1, double X2,
865                                 double X3, double X4, double X5, double X6, double X7 )
866 {
867   _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
868   _Xaxe = X3; _Yaxe = X4; _Zaxe = X5;
869   _Rayon1 = X6;
870   _Rayon2 = X7;
871 }
872 //=======================================================================================
873 std::vector<double> HOMARD_Boundary::GetCoords() const
874 {
875   std::vector<double> mesCoor;
876 //
877   switch (_Type)
878   {
879 //  Cylindre
880     case 1:
881     {
882       mesCoor.push_back( _Xcentre );
883       mesCoor.push_back( _Ycentre );
884       mesCoor.push_back( _Zcentre );
885       mesCoor.push_back( _Xaxe );
886       mesCoor.push_back( _Yaxe );
887       mesCoor.push_back( _Zaxe );
888       mesCoor.push_back( _rayon );
889       break ;
890     }
891 //  Sphere
892     case 2:
893     {
894       mesCoor.push_back( _Xcentre );
895       mesCoor.push_back( _Ycentre );
896       mesCoor.push_back( _Zcentre );
897       mesCoor.push_back( _rayon );
898       break ;
899     }
900 //  Cone defini par un axe et un angle
901     case 3:
902     {
903       mesCoor.push_back( _Xaxe );
904       mesCoor.push_back( _Yaxe );
905       mesCoor.push_back( _Zaxe );
906       mesCoor.push_back( _Angle );
907       mesCoor.push_back( _Xcentre );
908       mesCoor.push_back( _Ycentre );
909       mesCoor.push_back( _Zcentre );
910       break ;
911     }
912 //  Cone defini par les 2 rayons
913     case 4:
914     {
915       mesCoor.push_back( _Xcentre1 );
916       mesCoor.push_back( _Ycentre1 );
917       mesCoor.push_back( _Zcentre1 );
918       mesCoor.push_back( _Rayon1 );
919       mesCoor.push_back( _Xcentre2 );
920       mesCoor.push_back( _Ycentre2 );
921       mesCoor.push_back( _Zcentre2 );
922       mesCoor.push_back( _Rayon2 );
923       break ;
924     }
925 //  Tore
926     case 5:
927     {
928       mesCoor.push_back( _Xcentre );
929       mesCoor.push_back( _Ycentre );
930       mesCoor.push_back( _Zcentre );
931       mesCoor.push_back( _Xaxe );
932       mesCoor.push_back( _Yaxe );
933       mesCoor.push_back( _Zaxe );
934       mesCoor.push_back( _Rayon1 );
935       mesCoor.push_back( _Rayon2 );
936       break ;
937     }
938     VERIFICATION( (_Type>=1) && (_Type<=5) ) ;
939   }
940   return mesCoor;
941 }
942 //======================================================================
943 void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 )
944 {
945   _Xincr = X0; _Yincr = X1; _Zincr = X2;
946 }
947 //=======================================================================================
948 std::vector<double> HOMARD_Boundary::GetLimit() const
949 {
950   std::vector<double> mesLimit;
951   mesLimit.push_back( _Xincr );
952   mesLimit.push_back( _Yincr );
953   mesLimit.push_back( _Zincr );
954   return mesLimit;
955 }
956 //=============================================================================
957 void HOMARD_Boundary::AddGroup( const char* Group)
958 {
959   _ListGroupSelected.push_back(Group);
960 }
961 //=============================================================================
962 void HOMARD_Boundary::SetGroups( const std::list<std::string>& ListGroup )
963 {
964   _ListGroupSelected.clear();
965   std::list<std::string>::const_iterator it = ListGroup.begin();
966   while(it != ListGroup.end())
967     _ListGroupSelected.push_back((*it++));
968 }
969 //=============================================================================
970 const std::list<std::string>& HOMARD_Boundary::GetGroups() const
971 {
972   return _ListGroupSelected;
973 }
974 //=============================================================================
975 //=============================================================================
976 // Liens avec les autres structures
977 //=============================================================================
978 //=============================================================================
979 void HOMARD_Boundary::SetCaseCreation( const char* NomCasCreation )
980 {
981   _NomCasCreation = std::string( NomCasCreation );
982 }
983 //=============================================================================
984 std::string HOMARD_Boundary::GetCaseCreation() const
985 {
986   return _NomCasCreation;
987 }
988 //=============================================================================
989
990 //=============================================================================
991 /*!
992  *  default constructor:
993  *  Par defaut, l'adaptation est conforme, sans suivi de frontiere
994  */
995 //=============================================================================
996 HOMARD_Cas::HOMARD_Cas():
997   _Name(""), _NomDir("/tmp"), _ConfType(0), _ExtType(0)
998 {
999   MESSAGE("HOMARD_Cas");
1000 }
1001 //=============================================================================
1002 HOMARD_Cas::~HOMARD_Cas()
1003 //=============================================================================
1004 {
1005   MESSAGE("~HOMARD_Cas");
1006 }
1007 //=============================================================================
1008 //=============================================================================
1009 // Generalites
1010 //=============================================================================
1011 //=============================================================================
1012 void HOMARD_Cas::SetName( const char* Name )
1013 {
1014   _Name = std::string( Name );
1015 }
1016 //=============================================================================
1017 std::string HOMARD_Cas::GetName() const
1018 {
1019   return _Name;
1020 }
1021 //=============================================================================
1022 std::string HOMARD_Cas::GetDumpPython() const
1023 {
1024   std::ostringstream aScript;
1025   aScript << "\t" <<_Name << ".SetDirName(\"";
1026   aScript << _NomDir << "\")\n";
1027   aScript << "\t" <<_Name << ".SetConfType(";
1028   aScript << _ConfType << ")\n";
1029   aScript << "\t" <<_Name << ".SetExtType(";
1030   aScript << _ExtType << ")\n";
1031 // Suivi de frontieres
1032   std::list<std::string>::const_iterator it = _ListBoundaryGroup.begin();
1033   while(it != _ListBoundaryGroup.end())
1034   {
1035     aScript << "\t" <<_Name << ".AddBoundaryGroup(\"";
1036     aScript << *it << "\", \"";
1037     it++;
1038     aScript << *it << "\")\n";
1039     it++;
1040   }
1041   if ( _Pyram > 0 )
1042   {
1043     aScript << "\t" <<_Name << ".SetPyram(";
1044     aScript << _Pyram << ")\n";
1045   }
1046
1047   return aScript.str();
1048 }
1049 //=============================================================================
1050 //=============================================================================
1051 // Caracteristiques
1052 //=============================================================================
1053 //=============================================================================
1054 int HOMARD_Cas::SetDirName( const char* NomDir )
1055 {
1056 //   MESSAGE("SetDirName,  NomDir : "<<NomDir);
1057 //   MESSAGE("SetDirName, _NomDir : "<<_NomDir);
1058   int erreur = 0 ;
1059   // On vérifie qu'aucun calcul n'a eu lieu pour ce cas
1060 //   MESSAGE("SetDirName, _ListIter.size() : "<<_ListIter.size());
1061   if ( _ListIter.size() > 1 ) { erreur = 1 ; }
1062   // Creation
1063   if ( CHDIR(NomDir) == 0 )
1064   { _NomDir = std::string( NomDir ); }
1065   else
1066   {
1067
1068 #ifndef WIN32
1069     if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 )
1070 #else
1071     if ( _mkdir(NomDir) == 0 )
1072 #endif
1073     {
1074       if ( CHDIR(NomDir) == 0 ) { _NomDir = std::string( NomDir ); }
1075       else                      { erreur = 2 ; }
1076     }
1077     else { erreur = 2 ; }
1078   };
1079   return erreur ;
1080 }
1081 //=============================================================================
1082 std::string HOMARD_Cas::GetDirName() const
1083 {
1084   return _NomDir;
1085 }
1086 //=============================================================================
1087 int HOMARD_Cas::GetNumberofIter()
1088 {
1089   return _ListIter.size();
1090 }
1091 //
1092 // Le type de conformite ou non conformite
1093 //
1094 //=============================================================================
1095 void HOMARD_Cas::SetConfType( int Conftype )
1096 {
1097 //   VERIFICATION( (Conftype>=-2) && (Conftype<=3) );
1098   _ConfType = Conftype;
1099 }
1100 //=============================================================================
1101 const int HOMARD_Cas::GetConfType() const
1102 {
1103   return _ConfType;
1104 }
1105 //
1106 // Le type exterieur
1107 //
1108 //=============================================================================
1109 void HOMARD_Cas::SetExtType( int ExtType )
1110 {
1111 //   VERIFICATION( (ExtType>=0) && (ExtType<=2) );
1112   _ExtType = ExtType;
1113 }
1114 //=============================================================================
1115 const int HOMARD_Cas::GetExtType() const
1116 {
1117   return _ExtType;
1118 }
1119 //
1120 // La boite englobante
1121 //
1122 //=============================================================================
1123 void HOMARD_Cas::SetBoundingBox( const std::vector<double>& extremas )
1124 {
1125   _Boite.clear();
1126   _Boite.resize( extremas.size() );
1127   for ( int i = 0; i < extremas.size(); i++ )
1128     _Boite[i] = extremas[i];
1129 }
1130 //=============================================================================
1131 const std::vector<double>& HOMARD_Cas::GetBoundingBox() const
1132 {
1133   return _Boite;
1134 }
1135 //
1136 // Les groupes
1137 //
1138 //=============================================================================
1139 void HOMARD_Cas::AddGroup( const char* Group )
1140 {
1141   _ListGroup.push_back(Group);
1142 }
1143 //=============================================================================
1144 void HOMARD_Cas::SetGroups( const std::list<std::string>& ListGroup )
1145 {
1146   _ListGroup.clear();
1147   std::list<std::string>::const_iterator it = ListGroup.begin();
1148   while(it != ListGroup.end())
1149   {
1150     _ListGroup.push_back((*it++));
1151   }
1152 }
1153 //=============================================================================
1154 const std::list<std::string>& HOMARD_Cas::GetGroups() const
1155 {
1156   return _ListGroup;
1157 }
1158 //=============================================================================
1159 void HOMARD_Cas::SupprGroups()
1160 {
1161   _ListGroup.clear();
1162 }
1163 //
1164 // Les frontieres
1165 //
1166 //=============================================================================
1167 void HOMARD_Cas::AddBoundary( const char* Boundary )
1168 {
1169 //   MESSAGE ( ". HOMARD_Cas::AddBoundary : Boundary = " << Boundary );
1170   const char* Group = "";
1171   AddBoundaryGroup( Boundary, Group );
1172 }
1173 //=============================================================================
1174 void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group )
1175 {
1176 //   MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Boundary = " << Boundary );
1177 //   MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Group = " << Group );
1178   _ListBoundaryGroup.push_back( Boundary );
1179   _ListBoundaryGroup.push_back( Group    );
1180 }
1181 //=============================================================================
1182 const std::list<std::string>& HOMARD_Cas::GetBoundaryGroup() const
1183 {
1184   return _ListBoundaryGroup;
1185 }
1186 //=============================================================================
1187 void HOMARD_Cas::SupprBoundaryGroup()
1188 {
1189   _ListBoundaryGroup.clear();
1190 }
1191 //=============================================================================
1192 void HOMARD_Cas::SetPyram( int Pyram )
1193 {
1194   _Pyram = Pyram;
1195 }
1196 //=============================================================================
1197 const int HOMARD_Cas::GetPyram() const
1198 {
1199   return _Pyram;
1200 }
1201 //=============================================================================
1202 //=============================================================================
1203 // Liens avec les autres structures
1204 //=============================================================================
1205 //=============================================================================
1206 std::string HOMARD_Cas::GetIter0Name() const
1207 {
1208 // Par construction de la liste, l'iteration a ete mise en tete.
1209   return (*(_ListIter.begin()));
1210 }
1211 //=============================================================================
1212 void HOMARD_Cas::AddIteration( const char* NomIteration )
1213 {
1214   _ListIter.push_back( std::string( NomIteration ) );
1215 }
1216 //=============================================================================
1217 const std::list<std::string>& HOMARD_Cas::GetIterations() const
1218 {
1219   return _ListIter;
1220 }
1221 //=============================================================================
1222 void HOMARD_Cas::SupprIterations()
1223 {
1224   _ListIter.clear();
1225 }
1226
1227 //=============================================================================
1228 //=============================================================================
1229 HomardDriver::HomardDriver(const std::string siter, const std::string siterp1):
1230   _HOMARD_Exec( "" ), _NomDir( "" ), _NomFichierConfBase( "HOMARD.Configuration" ),
1231   _NomFichierConf( "" ), _NomFichierDonn( "" ), _siter( "" ), _siterp1( "" ),
1232   _Texte( "" ), _bLu( false )
1233 {
1234   MESSAGE("siter = "<<siter<<", siterp1 = "<<siterp1);
1235 // Le repertoire ou se trouve l'executable HOMARD
1236   std::string dir ;
1237   if ( getenv("HOMARD_REP_EXE_PRIVATE") != NULL ) { dir = getenv("HOMARD_REP_EXE_PRIVATE") ; }
1238   else                                            { dir = getenv("HOMARD_REP_EXE") ; }
1239   MESSAGE("dir ="<<dir);
1240 // L'executable HOMARD
1241   std::string executable ;
1242   if ( getenv("HOMARD_EXE_PRIVATE") != NULL ) { executable = getenv("HOMARD_EXE_PRIVATE") ; }
1243   else                                        { executable = getenv("HOMARD_EXE") ; }
1244   MESSAGE("executable ="<<executable);
1245 // Memorisation du nom complet de l'executable HOMARD
1246   _HOMARD_Exec = dir + "/" + executable ;
1247   MESSAGE("==> _HOMARD_Exec ="<<_HOMARD_Exec) ;
1248 //
1249   _siter = siter ;
1250   _siterp1 = siterp1 ;
1251 }
1252 //=============================================================================
1253 //=============================================================================
1254 HomardDriver::~HomardDriver()
1255 {
1256 }
1257 //===============================================================================
1258 // A. Generalites
1259 //===============================================================================
1260 void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue )
1261 {
1262   MESSAGE("TexteInit, DirCompute ="<<DirCompute<<", LogFile ="<<LogFile);
1263 //
1264   _Texte  = "ListeStd \"" + LogFile + "\"\n" ;
1265   _Texte += "RepeTrav \"" + DirCompute + "\"\n" ;
1266   _Texte += "RepeInfo \"" + DirCompute + "\"\n" ;
1267   _Texte += "Langue \"" + Langue + "\"\n" ;
1268 //
1269 }
1270 //===============================================================================
1271 void HomardDriver::TexteAdap( int ExtType )
1272 {
1273   MESSAGE("TexteAdap");
1274 //
1275   _Texte += "Action   homa\n" ;
1276   if ( ExtType ==  0 )      { _Texte += "CCAssoci med\n" ; }
1277   else if ( ExtType ==  1 ) { _Texte += "CCAssoci saturne\n" ; }
1278   else                      { _Texte += "CCAssoci saturne_2d\n" ; }
1279   _Texte += "ModeHOMA 1\n" ;
1280   _Texte += "NumeIter " + _siter + "\n" ;
1281   _modeHOMARD = 1 ;
1282 //
1283 }
1284 //===============================================================================
1285 void HomardDriver::TexteInfo( int TypeBila, int NumeIter )
1286 {
1287   MESSAGE("TexteInfo: TypeBila ="<<TypeBila<<", NumeIter ="<<NumeIter);
1288 //
1289   _Texte += "ModeHOMA 2\n" ;
1290   std::stringstream saux1 ;
1291   saux1 << TypeBila ;
1292   std::string saux2 = saux1.str() ;
1293   _Texte += "TypeBila " + saux2 + "\n" ;
1294   if ( NumeIter ==  0 )
1295   {
1296     _Texte += "NumeIter 0\n" ;
1297     _Texte += "Action   info_av\n" ;
1298     _Texte += "CCAssoci med\n" ;
1299   }
1300   else
1301   {
1302     _Texte += "NumeIter " + _siter + "\n" ;
1303     _Texte += "Action   info_ap\n" ;
1304     _Texte += "CCAssoci homard\n" ;
1305   }
1306   _modeHOMARD = 2 ;
1307 //
1308 }
1309 //===============================================================================
1310 void HomardDriver::TexteMajCoords( int NumeIter )
1311 {
1312   MESSAGE("TexteMajCoords: NumeIter ="<<NumeIter);
1313 //
1314   _Texte += "ModeHOMA 5\n" ;
1315   _Texte += "NumeIter " + _siterp1 + "\n" ;
1316   _Texte += "Action   homa\n" ;
1317   _Texte += "CCAssoci med\n" ;
1318   _Texte += "EcriFiHO N_SANS_FRONTIERE\n" ;
1319   _modeHOMARD = 5 ;
1320 //
1321 }
1322 //===============================================================================
1323 // B. Les maillages en entree et en sortie
1324 //===============================================================================
1325 void HomardDriver::TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres )
1326 {
1327   MESSAGE("TexteMaillage, NomMesh  = "<<NomMesh);
1328   MESSAGE("TexteMaillage, MeshFile = "<<MeshFile);
1329   MESSAGE("TexteMaillage, apres = "<<apres);
1330   std::string saux ;
1331   saux = "P1" ;
1332   if ( apres < 1 ) { saux = "__" ; }
1333
1334   _Texte += "# Maillages Med " + saux + "\n" ;
1335   _Texte += "CCNoMN" + saux + " \"" + NomMesh  + "\"\n" ;
1336   _Texte += "CCMaiN" + saux + " \"" + MeshFile + "\"\n" ;
1337 }
1338
1339 //===============================================================================
1340 void HomardDriver::TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres )
1341 {
1342   MESSAGE("TexteMaillageHOMARD, Dir ="<<Dir<<", liter ="<<liter<<", apres ="<<apres);
1343   std::string saux ;
1344   if ( apres < 1 ) { saux = "__" ; }
1345   else             { saux = "P1" ; }
1346
1347   _Texte += "# Maillage HOMARD " + liter + "\n" ;
1348   _Texte += "HOMaiN" + saux + " Mai" + liter   + " \"" + Dir + "/maill." + liter   + ".hom.med\"\n" ;
1349 }
1350
1351 //===============================================================================
1352 // C. Le pilotage de l'adaptation
1353 //===============================================================================
1354 void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera )
1355 {
1356   MESSAGE("TexteConfRaffDera, ConfType ="<<ConfType);
1357   MESSAGE("TexteConfRaffDera, TypeAdap ="<<TypeAdap<<", TypeRaff ="<<TypeRaff<<", TypeDera ="<<TypeDera);
1358 //
1359 // Type de conformite
1360 //
1361   std::string saux ;
1362   switch (ConfType)
1363   {
1364     case -2: //
1365     {
1366       saux = "NON_CONFORME_1_ARETE" ;
1367       break;
1368     }
1369     case -1: //
1370     {
1371       saux = "CONFORME_BOITES" ;
1372       break;
1373     }
1374     case 0: //
1375     {
1376       saux = "CONFORME" ;
1377       break;
1378     }
1379     case 1: //
1380     {
1381       saux = "NON_CONFORME" ;
1382       break;
1383     }
1384     case 2: //
1385     {
1386       saux = "NON_CONFORME_1_NOEUD" ;
1387       break;
1388     }
1389     case 3: //
1390     {
1391       saux = "NON_CONFORME_INDICATEUR" ;
1392       break;
1393     }
1394   }
1395   _Texte += "# Type de conformite\nTypeConf " + saux + "\n" ;
1396 //
1397 // Type de raffinement/deraffinement
1398 //
1399   if ( TypeAdap == -1 )
1400   {
1401     if ( TypeRaff == 1 )
1402     {
1403       saux = "TypeRaff uniforme\n" ;
1404     }
1405     else
1406     {
1407       saux = "TypeRaff non\n" ;
1408     }
1409     if ( TypeDera == 1 )
1410     {
1411       saux += "TypeDera uniforme" ;
1412     }
1413     else
1414     {
1415       saux += "TypeDera non" ;
1416     }
1417   }
1418   else
1419   {
1420     if ( TypeRaff == 1 )
1421     {
1422       saux = "TypeRaff libre\n" ;
1423     }
1424     else
1425     {
1426       saux = "TypeRaff non\n" ;
1427     }
1428     if ( TypeDera == 1 )
1429     {
1430       saux += "TypeDera libre" ;
1431     }
1432     else
1433     {
1434       saux += "TypeDera non" ;
1435     }
1436   }
1437   _Texte += "# Type de raffinement/deraffinement\n" + saux + "\n" ;
1438 //
1439 //   MESSAGE("A la fin de HomardDriver::TexteConfRaffDera, _Texte ="<<_Texte);
1440 }
1441 //===============================================================================
1442 void HomardDriver::TexteCompo( int NumeComp, const std::string NomCompo)
1443 {
1444   MESSAGE("TexteCompo, NumeComp = "<<NumeComp<<", NomCompo = "<<NomCompo);
1445   _Texte +="CCCoChaI \"" + NomCompo + "\"\n" ;
1446 }
1447 //===============================================================================
1448 void HomardDriver::TexteZone( int NumeZone, int ZoneType, int TypeUse, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 )
1449 {
1450   MESSAGE("TexteZone, NumeZone = "<<NumeZone<<", ZoneType = "<<ZoneType<<", TypeUse = "<<TypeUse);
1451   MESSAGE("TexteZone, coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
1452 //
1453   std::string saux, saux2 ;
1454 //
1455 // Type de zones
1456 // On convertit le type de zone au sens du module HOMARD dans Salome, ZoneType, dans le
1457 // type au sens de l'executable HOMARD, ZoneTypeHOMARD
1458 // Attention a mettre le bon signe a ZoneTypeHOMARD :
1459 //    >0 signifie que l'on raffinera les mailles contenues dans la zone,
1460 //    <0 signifie que l'on deraffinera
1461 //
1462   int ZoneTypeHOMARD ;
1463   if ( ZoneType >= 11 && ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
1464   else if ( ZoneType >= 31 && ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
1465   else if ( ZoneType >= 61 && ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
1466   else { ZoneTypeHOMARD = ZoneType ; }
1467 //
1468   if ( TypeUse < 0 ) { ZoneTypeHOMARD = -ZoneTypeHOMARD ; }
1469 //
1470   std::stringstream saux1 ;
1471   saux1 << NumeZone ;
1472   saux = "#\n# Zone numero " + saux1.str() + "\n" ;
1473 //
1474   { std::stringstream saux1 ;
1475     saux1 << NumeZone << " " << ZoneTypeHOMARD ;
1476     saux += "ZoRaType " + saux1.str() + "\n" ;
1477   }
1478 //
1479 // Cas du rectangle
1480 //
1481   if ( ZoneType == 11 ) // Z est constant X Homard <=> X Salome
1482 //                                        Y Homard <=> Y Salome
1483   {
1484     saux += "#Rectangle\n" ;
1485     { std::stringstream saux1 ;
1486       saux1 << NumeZone << " " << x0 ;
1487       saux += "ZoRaXmin " + saux1.str() + "\n" ;
1488     }
1489     { std::stringstream saux1 ;
1490       saux1 << NumeZone << " " << x1 ;
1491       saux += "ZoRaXmax " + saux1.str() + "\n" ;
1492     }
1493     { std::stringstream saux1 ;
1494       saux1 << NumeZone << " " << x2 ;
1495       saux += "ZoRaYmin " + saux1.str() + "\n" ;
1496     }
1497     { std::stringstream saux1 ;
1498       saux1 << NumeZone << " " << x3 ;
1499       saux += "ZoRaYmax " + saux1.str() + "\n" ;
1500     }
1501   }
1502 //
1503   else if ( ZoneType == 12 ) // X est constant X Homard <=> Y Salome
1504 //                                             Y Homard <=> Z Salome
1505   {
1506     saux += "#Rectangle\n" ;
1507     { std::stringstream saux1 ;
1508       saux1 << NumeZone << " " << x2 ;
1509       saux += "ZoRaXmin " + saux1.str() + "\n" ;
1510     }
1511     { std::stringstream saux1 ;
1512       saux1 << NumeZone << " " << x3 ;
1513       saux += "ZoRaXmax " + saux1.str() + "\n" ;
1514     }
1515     { std::stringstream saux1 ;
1516       saux1 << NumeZone << " " << x4 ;
1517       saux += "ZoRaYmin " + saux1.str() + "\n" ;
1518     }
1519     { std::stringstream saux1 ;
1520       saux1 << NumeZone << " " << x5 ;
1521       saux += "ZoRaYmax " + saux1.str() + "\n" ;
1522     }
1523   }
1524 //
1525   else if ( ZoneType == 13 ) // Y est constant X Homard <=> X Salome
1526 //                                             Y Homard <=> Z Salome
1527   {
1528     saux += "#Rectangle\n" ;
1529     { std::stringstream saux1 ;
1530       saux1 << NumeZone << " " << x0 ;
1531       saux += "ZoRaXmin " + saux1.str() + "\n" ;
1532     }
1533     { std::stringstream saux1 ;
1534       saux1 << NumeZone << " " << x1 ;
1535       saux += "ZoRaXmax " + saux1.str() + "\n" ;
1536     }
1537     { std::stringstream saux1 ;
1538       saux1 << NumeZone << " " << x4 ;
1539       saux += "ZoRaYmin " + saux1.str() + "\n" ;
1540     }
1541     { std::stringstream saux1 ;
1542       saux1 << NumeZone << " " << x5 ;
1543       saux += "ZoRaYmax " + saux1.str() + "\n" ;
1544     }
1545   }
1546 //
1547 // Cas du parallelepipede
1548 //
1549   else if ( ZoneType == 2 )
1550   {
1551     saux += "# Boite\n" ;
1552     { std::stringstream saux1 ;
1553       saux1 << NumeZone << " " << x0 ;
1554       saux += "ZoRaXmin " + saux1.str() + "\n" ;
1555     }
1556     { std::stringstream saux1 ;
1557       saux1 << NumeZone << " " << x1 ;
1558       saux += "ZoRaXmax " + saux1.str() + "\n" ;
1559     }
1560     { std::stringstream saux1 ;
1561       saux1 << NumeZone << " " << x2 ;
1562       saux += "ZoRaYmin " + saux1.str() + "\n" ;
1563     }
1564     { std::stringstream saux1 ;
1565       saux1 << NumeZone << " " << x3 ;
1566       saux += "ZoRaYmax " + saux1.str() + "\n" ;
1567     }
1568     { std::stringstream saux1 ;
1569       saux1 << NumeZone << " " << x4 ;
1570       saux += "ZoRaZmin " + saux1.str() + "\n" ;
1571     }
1572     { std::stringstream saux1 ;
1573       saux1 << NumeZone << " " << x5 ;
1574       saux += "ZoRaZmax " + saux1.str() + "\n" ;
1575     }
1576   }
1577 //
1578 // Cas du disque
1579 //
1580   else if ( ZoneType == 31 || ZoneType == 61 )
1581   {
1582     saux += "# Sphere\n" ;
1583     { std::stringstream saux1 ;
1584       saux1 << NumeZone << " " << x0 ;
1585       saux += "ZoRaXCen " + saux1.str() + "\n" ;
1586     }
1587     { std::stringstream saux1 ;
1588       saux1 << NumeZone << " " << x1 ;
1589       saux += "ZoRaYCen " + saux1.str() + "\n" ;
1590     }
1591     { std::stringstream saux1 ;
1592       saux1 << NumeZone << " " << x6 ;
1593       saux2 = saux1.str() ;
1594       if ( ZoneType == 61 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
1595       else                  { saux += "ZoRaRayo " + saux2 + "\n" ; }
1596     }
1597     if ( ZoneType == 61 )
1598     { std::stringstream saux1 ;
1599       saux1 << NumeZone << " " << x8 ;
1600       saux += "ZoRaRayI " + saux1.str() + "\n" ;
1601     }
1602   }
1603   else if ( ZoneType == 32 || ZoneType == 62 )
1604   {
1605     saux += "# Sphere\n" ;
1606     { std::stringstream saux1 ;
1607       saux1 << NumeZone << " " << x1 ;
1608       saux += "ZoRaXCen " + saux1.str() + "\n" ;
1609     }
1610     { std::stringstream saux1 ;
1611       saux1 << NumeZone << " " << x2 ;
1612       saux += "ZoRaYCen " + saux1.str() + "\n" ;
1613     }
1614     { std::stringstream saux1 ;
1615       saux1 << NumeZone << " " << x6 ;
1616       saux2 = saux1.str() ;
1617       if ( ZoneType == 62 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
1618       else                  { saux += "ZoRaRayo " + saux2 + "\n" ; }
1619     }
1620     if ( ZoneType == 62 )
1621     { std::stringstream saux1 ;
1622       saux1 << NumeZone << " " << x8 ;
1623       saux += "ZoRaRayI " + saux1.str() + "\n" ;
1624     }
1625   }
1626   else if ( ZoneType == 33 || ZoneType == 63 )
1627   {
1628     saux += "# Sphere\n" ;
1629     { std::stringstream saux1 ;
1630       saux1 << NumeZone << " " << x0 ;
1631       saux += "ZoRaXCen " + saux1.str() + "\n" ;
1632     }
1633     { std::stringstream saux1 ;
1634       saux1 << NumeZone << " " << x2 ;
1635       saux += "ZoRaYCen " + saux1.str() + "\n" ;
1636     }
1637     { std::stringstream saux1 ;
1638       saux1 << NumeZone << " " << x6 ;
1639       saux2 = saux1.str() ;
1640       if ( ZoneType == 63 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
1641       else                  { saux += "ZoRaRayo " + saux2 + "\n" ; }
1642     }
1643     if ( ZoneType == 63 )
1644     { std::stringstream saux1 ;
1645       saux1 << NumeZone << " " << x8 ;
1646       saux += "ZoRaRayI " + saux1.str() + "\n" ;
1647     }
1648   }
1649 //
1650 // Cas de la sphere
1651 //
1652   else if ( ZoneType == 4 )
1653   {
1654     saux += "# Sphere\n" ;
1655     { std::stringstream saux1 ;
1656       saux1 << NumeZone << " " << x0 ;
1657       saux += "ZoRaXCen " + saux1.str() + "\n" ;
1658     }
1659     { std::stringstream saux1 ;
1660       saux1 << NumeZone << " " << x1 ;
1661       saux += "ZoRaYCen " + saux1.str() + "\n" ;
1662     }
1663     { std::stringstream saux1 ;
1664       saux1 << NumeZone << " " << x2 ;
1665       saux += "ZoRaZCen " + saux1.str() + "\n" ;
1666     }
1667     { std::stringstream saux1 ;
1668       saux1 << NumeZone << " " << x3 ;
1669       saux += "ZoRaRayo " + saux1.str() + "\n" ;
1670     }
1671   }
1672 //
1673 // Cas du cylindre ou du tuyau
1674 //
1675   else if ( ZoneType == 5 || ZoneType == 7 )
1676   {
1677     if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; }
1678     else                 { saux += "# Tuyau\n" ; }
1679     { std::stringstream saux1 ;
1680       saux1 << NumeZone << " " << x0 ;
1681       saux += "ZoRaXBas " + saux1.str() + "\n" ;
1682     }
1683     { std::stringstream saux1 ;
1684       saux1 << NumeZone << " " << x1 ;
1685       saux += "ZoRaYBas " + saux1.str() + "\n" ;
1686     }
1687     { std::stringstream saux1 ;
1688       saux1 << NumeZone << " " << x2 ;
1689       saux += "ZoRaZBas " + saux1.str() + "\n" ;
1690     }
1691     { std::stringstream saux1 ;
1692       saux1 << NumeZone << " " << x3 ;
1693       saux += "ZoRaXAxe " + saux1.str() + "\n" ;
1694     }
1695     { std::stringstream saux1 ;
1696       saux1 << NumeZone << " " << x4 ;
1697       saux += "ZoRaYAxe " + saux1.str() + "\n" ;
1698     }
1699     { std::stringstream saux1 ;
1700       saux1 << NumeZone << " " << x5 ;
1701       saux += "ZoRaZAxe " + saux1.str() + "\n" ;
1702     }
1703     { std::stringstream saux1 ;
1704       saux1 << NumeZone << " " << x6 ;
1705       saux2 = saux1.str() ;
1706      if ( ZoneType == 5 ) { saux += "ZoRaRayo " + saux2 + "\n" ; }
1707      else                 { saux += "ZoRaRayE " + saux2 + "\n" ; }
1708     }
1709     { std::stringstream saux1 ;
1710       saux1 << NumeZone << " " << x7 ;
1711       saux += "ZoRaHaut " + saux1.str() + "\n" ;
1712     }
1713     if ( ZoneType == 7 )
1714     { std::stringstream saux1 ;
1715       saux1 << NumeZone << " " << x8 ;
1716       saux += "ZoRaRayI " + saux1.str() + "\n" ;
1717     }
1718   }
1719 //
1720   _Texte += saux + "#\n" ;
1721 //
1722 //   MESSAGE("A la fin de HomardDriver::TexteZone, _Texte ="<<_Texte);
1723 }
1724 //===============================================================================
1725 void HomardDriver::TexteField( const std::string FieldName, const std::string FieldFile, int TimeStep, int Rank,
1726                int TypeThR, double ThreshR, int TypeThC, double ThreshC,
1727                int UsField, int UsCmpI )
1728 {
1729   MESSAGE("TexteField, FieldName = "<<FieldName<<", FieldFile = "<<FieldFile);
1730   MESSAGE("TexteField, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
1731
1732   std::string saux, saux2 ;
1733 //
1734 //
1735   _Texte += "# Champ d'indicateurs\n" ;
1736   _Texte += "CCIndica \"" + FieldFile  + "\"\n" ;
1737   _Texte += "CCNoChaI \"" + FieldName  + "\"\n" ;
1738
1739 // Cas ou on prend le dernier pas de temps
1740   if ( TimeStep == -2 )
1741   { _Texte += "CCNumPTI Last\n" ; }
1742 // Cas avec pas de temps
1743   else if ( TimeStep >= 0 )
1744   {
1745     {
1746       std::stringstream saux1 ;
1747       saux1 << TimeStep ;
1748       saux2 = saux1.str() ;
1749       _Texte += "CCNumPTI " + saux2  + "\n" ;
1750     }
1751     if ( Rank >= 0 )
1752     {
1753       std::stringstream saux1 ;
1754       saux1 << Rank ;
1755       saux2 = saux1.str() ;
1756       _Texte += "CCNumOrI " + saux2  + "\n" ;
1757     }
1758   }
1759 //
1760   saux = " " ;
1761   if ( TypeThR == 1 )
1762   { saux = "Hau" ; }
1763   if ( TypeThR == 2 )
1764   { saux = "HRe" ; }
1765   if ( TypeThR == 3 )
1766   { saux = "HPE" ; }
1767   if ( TypeThR == 4 )
1768   { saux = "HMS" ; }
1769   if ( saux != " " )
1770   {
1771     std::stringstream saux1 ;
1772     saux1 << ThreshR ;
1773     _Texte += "Seuil" + saux + " " + saux1.str()  + "\n" ;
1774   }
1775 //
1776   saux = " " ;
1777   if ( TypeThC == 1 )
1778   { saux = "Bas" ; }
1779   if ( TypeThC == 2 )
1780   { saux = "BRe" ; }
1781   if ( TypeThC == 3 )
1782   { saux = "BPE" ; }
1783   if ( TypeThC == 4 )
1784   { saux = "BMS" ; }
1785   if ( saux != " " )
1786   {
1787     std::stringstream saux1 ;
1788     saux1 << ThreshC ;
1789     _Texte += "Seuil" + saux + " " + saux1.str()  + "\n" ;
1790   }
1791 //
1792   saux = " " ;
1793   if ( UsField == 0 )
1794   { saux = "MAILLE" ; }
1795   if ( UsField == 1 )
1796   { saux = "SAUT" ; }
1797   if ( saux != " " )
1798   {
1799     _Texte += "CCModeFI " + saux  + "\n" ;
1800   }
1801 //
1802   saux = " " ;
1803   if ( UsCmpI == 0 )
1804   { saux = "L2" ; }
1805   if ( UsCmpI == 1 )
1806   { saux = "INFINI" ; }
1807   if ( UsCmpI == 2 )
1808   { saux = "RELATIF" ; }
1809   if ( saux != " " )
1810   {
1811     _Texte += "CCUsCmpI " + saux  + "\n" ;
1812   }
1813 }
1814 //===============================================================================
1815 void HomardDriver::TexteGroup( const std::string GroupName )
1816 {
1817   MESSAGE("TexteGroup, GroupName = "<<GroupName);
1818 //
1819   _Texte += "CCGroAda \"" + GroupName  + "\"\n" ;
1820 //
1821 }
1822 //===============================================================================
1823 // D. Les frontieres
1824 //===============================================================================
1825 void HomardDriver::TexteBoundaryOption( int BoundaryOption )
1826 {
1827   MESSAGE("TexteBoundaryOption, BoundaryOption = "<<BoundaryOption);
1828 //
1829 // Type de suivi de frontiere
1830 //
1831   std::stringstream saux1 ;
1832   saux1 << BoundaryOption ;
1833   std::string saux = saux1.str() ;
1834   _Texte += "SuivFron " + saux + "\n" ;
1835 //
1836 }//===============================================================================
1837 void HomardDriver::TexteBoundaryCAOGr(  const std::string GroupName )
1838 {
1839   MESSAGE("TexteBoundaryCAOGr, GroupName  = "<<GroupName);
1840 //
1841   _Texte += "GrFroCAO \"" + GroupName + "\"\n" ;
1842 //
1843 }
1844
1845 //===============================================================================
1846 void HomardDriver::TexteBoundaryDi(  const std::string MeshName, const std::string MeshFile )
1847 {
1848   MESSAGE("TexteBoundaryDi, MeshName  = "<<MeshName);
1849   MESSAGE("TexteBoundaryDi, MeshFile  = "<<MeshFile);
1850 //
1851   _Texte += "#\n# Frontiere discrete\n" ;
1852   _Texte += "CCNoMFro \"" + MeshName + "\"\n" ;
1853   _Texte += "CCFronti \"" + MeshFile + "\"\n" ;
1854 //
1855 }
1856 //===============================================================================
1857 void HomardDriver::TexteBoundaryDiGr(  const std::string GroupName )
1858 {
1859   MESSAGE("TexteBoundaryDiGr, GroupName  = "<<GroupName);
1860 //
1861   _Texte += "CCGroFro \"" + GroupName + "\"\n" ;
1862 //
1863 }
1864 //===============================================================================
1865 void HomardDriver::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 )
1866 {
1867   MESSAGE("TexteBoundaryAn, NameBoundary = "<<NameBoundary);
1868 //   MESSAGE("TexteBoundaryAn, NumeBoundary = "<<NumeBoundary);
1869   MESSAGE("TexteBoundaryAn, BoundaryType = "<<BoundaryType);
1870 //   MESSAGE("TexteBoundaryAn, coor         = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6","<<x7);
1871 //
1872   std::string saux, saux2 ;
1873 //
1874 // Commentaires
1875 //
1876   std::stringstream saux1 ;
1877   saux1 << NumeBoundary ;
1878   saux2 = saux1.str() ;
1879   saux = "#\n# Frontiere numero " + saux2 + "\n" ;
1880   if ( BoundaryType == 1 )
1881   { saux += "# Cylindre\n" ; }
1882   if ( BoundaryType == 2 )
1883   { saux += "# Sphere\n" ; }
1884   if ( BoundaryType == 3 || BoundaryType == 4 )
1885   { saux += "# Cone\n" ; }
1886   if ( BoundaryType == 5 )
1887   { saux += "# Tore\n" ; }
1888 //
1889 // Le nom de la frontiere
1890 //
1891   { std::stringstream saux1 ;
1892     saux1 << NumeBoundary ;
1893     saux += "FANom " + saux1.str() + " \"" + NameBoundary + "\"\n" ;
1894   }
1895 //
1896 // Type de frontiere
1897 //
1898   { std::stringstream saux1 ;
1899     saux1 << NumeBoundary << " " << BoundaryType ;
1900     saux += "FAType " + saux1.str() + "\n" ;
1901   }
1902 //
1903 // Cas du cylindre
1904 //
1905   if ( BoundaryType == 1 )
1906   {
1907     { std::stringstream saux1 ;
1908       saux1 << NumeBoundary << " " << x0 ;
1909       saux2 = saux1.str() ;
1910       saux += "FAXCen " + saux1.str() + "\n" ;
1911     }
1912     { std::stringstream saux1 ;
1913       saux1 << NumeBoundary << " " << x1 ;
1914       saux += "FAYCen " + saux1.str() + "\n" ;
1915     }
1916     { std::stringstream saux1 ;
1917       saux1 << NumeBoundary << " " << x2 ;
1918       saux += "FAZCen " + saux1.str() + "\n" ;
1919     }
1920     { std::stringstream saux1 ;
1921       saux1 << NumeBoundary << " " << x3 ;
1922       saux += "FAXAxe " + saux1.str() + "\n" ;
1923     }
1924     { std::stringstream saux1 ;
1925       saux1 << NumeBoundary << " " << x4 ;
1926       saux += "FAYAxe " + saux1.str() + "\n" ;
1927     }
1928     { std::stringstream saux1 ;
1929       saux1 << NumeBoundary << " " << x5 ;
1930       saux += "FAZAxe " + saux1.str() + "\n" ;
1931     }
1932     { std::stringstream saux1 ;
1933       saux1 << NumeBoundary << " " << x6 ;
1934       saux += "FARayon " + saux1.str() + "\n" ;
1935     }
1936  }
1937 //
1938 // Cas de la sphere
1939 //
1940   else if ( BoundaryType == 2 )
1941   {
1942     { std::stringstream saux1 ;
1943       saux1 << NumeBoundary << " " << x0 ;
1944       saux += "FAXCen " + saux1.str() + "\n" ;
1945     }
1946     { std::stringstream saux1 ;
1947       saux1 << NumeBoundary << " " << x1 ;
1948       saux += "FAYCen " + saux1.str() + "\n" ;
1949     }
1950     { std::stringstream saux1 ;
1951       saux1 << NumeBoundary << " " << x2 ;
1952       saux += "FAZCen " + saux1.str() + "\n" ;
1953     }
1954     { std::stringstream saux1 ;
1955       saux1 << NumeBoundary << " " << x3 ;
1956       saux += "FARayon " + saux1.str() + "\n" ;
1957     }
1958   }
1959 //
1960 // Cas du cone defini par un axe et un angle
1961 //
1962   if ( BoundaryType == 3 )
1963   {
1964     { std::stringstream saux1 ;
1965       saux1 << NumeBoundary << " " << x0 ;
1966       saux += "FAXAxe " + saux1.str() + "\n" ;
1967     }
1968     { std::stringstream saux1 ;
1969       saux1 << NumeBoundary << " " << x1 ;
1970       saux += "FAYAxe " + saux1.str() + "\n" ;
1971     }
1972     { std::stringstream saux1 ;
1973       saux1 << NumeBoundary << " " << x2 ;
1974       saux += "FAZAxe " + saux1.str() + "\n" ;
1975     }
1976     { std::stringstream saux1 ;
1977       saux1 << NumeBoundary << " " << x3 ;
1978       saux += "FAAngle " + saux1.str() + "\n" ;
1979     }
1980     { std::stringstream saux1 ;
1981       saux1 << NumeBoundary << " " << x4 ;
1982       saux += "FAXCen " + saux1.str() + "\n" ;
1983     }
1984     { std::stringstream saux1 ;
1985       saux1 << NumeBoundary << " " << x5 ;
1986       saux += "FAYCen " + saux1.str() + "\n" ;
1987     }
1988     { std::stringstream saux1 ;
1989       saux1 << NumeBoundary << " " << x6 ;
1990       saux += "FAZCen " + saux1.str() + "\n" ;
1991     }
1992  }
1993 //
1994 // Cas du cone defini par les 2 rayons
1995 //
1996   if ( BoundaryType == 4 )
1997   {
1998     { std::stringstream saux1 ;
1999       saux1 << NumeBoundary << " " << x0 ;
2000       saux += "FAXCen " + saux1.str() + "\n" ;
2001     }
2002     { std::stringstream saux1 ;
2003       saux1 << NumeBoundary << " " << x1 ;
2004       saux += "FAYCen " + saux1.str() + "\n" ;
2005     }
2006     { std::stringstream saux1 ;
2007       saux1 << NumeBoundary << " " << x2 ;
2008       saux += "FAZCen " + saux1.str() + "\n" ;
2009     }
2010     { std::stringstream saux1 ;
2011       saux1 << NumeBoundary << " " << x3 ;
2012       saux += "FARayon " + saux1.str() + "\n" ;
2013     }
2014     { std::stringstream saux1 ;
2015       saux1 << NumeBoundary << " " << x4 ;
2016       saux += "FAXCen2 " + saux1.str() + "\n" ;
2017     }
2018     { std::stringstream saux1 ;
2019       saux1 << NumeBoundary << " " << x5 ;
2020       saux += "FAYCen2 " + saux1.str() + "\n" ;
2021     }
2022     { std::stringstream saux1 ;
2023       saux1 << NumeBoundary << " " << x6 ;
2024       saux += "FAZCen2 " + saux1.str() + "\n" ;
2025     }
2026     { std::stringstream saux1 ;
2027       saux1 << NumeBoundary << " " << x7 ;
2028       saux += "FARayon2 " + saux1.str() + "\n" ;
2029     }
2030  }
2031 //
2032 // Cas du tore
2033 //
2034   if ( BoundaryType == 5 )
2035   {
2036     { std::stringstream saux1 ;
2037       saux1 << NumeBoundary << " " << x0 ;
2038       saux2 = saux1.str() ;
2039       saux += "FAXCen " + saux1.str() + "\n" ;
2040     }
2041     { std::stringstream saux1 ;
2042       saux1 << NumeBoundary << " " << x1 ;
2043       saux += "FAYCen " + saux1.str() + "\n" ;
2044     }
2045     { std::stringstream saux1 ;
2046       saux1 << NumeBoundary << " " << x2 ;
2047       saux += "FAZCen " + saux1.str() + "\n" ;
2048     }
2049     { std::stringstream saux1 ;
2050       saux1 << NumeBoundary << " " << x3 ;
2051       saux += "FAXAxe " + saux1.str() + "\n" ;
2052     }
2053     { std::stringstream saux1 ;
2054       saux1 << NumeBoundary << " " << x4 ;
2055       saux += "FAYAxe " + saux1.str() + "\n" ;
2056     }
2057     { std::stringstream saux1 ;
2058       saux1 << NumeBoundary << " " << x5 ;
2059       saux += "FAZAxe " + saux1.str() + "\n" ;
2060     }
2061     { std::stringstream saux1 ;
2062       saux1 << NumeBoundary << " " << x6 ;
2063       saux += "FARayon  " + saux1.str() + "\n" ;
2064     }
2065     { std::stringstream saux1 ;
2066       saux1 << NumeBoundary << " " << x7 ;
2067       saux += "FARayon2 " + saux1.str() + "\n" ;
2068     }
2069  }
2070 //
2071   _Texte += saux + "#\n" ;
2072 //
2073 }
2074 //===============================================================================
2075 void HomardDriver::TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName )
2076 {
2077   MESSAGE("TexteBoundaryAnGr, NameBoundary  = "<<NameBoundary);
2078 //   MESSAGE("TexteBoundaryAnGr, NumeBoundary  = "<<NumeBoundary);
2079 //   MESSAGE("TexteBoundaryAnGr, GroupName  = "<<GroupName);
2080 //
2081 // Commentaires
2082 //
2083   std::string saux, saux2 ;
2084   std::stringstream saux1 ;
2085   saux1 << NumeBoundary ;
2086   saux2 = saux1.str() ;
2087   saux = "#\n# Lien Frontiere/Groupe numero " + saux2 + "\n" ;
2088 //
2089   saux += "FGNomFro " + saux2 + " \"" + NameBoundary + "\"\n" ;
2090   saux += "FGNomGro " + saux2 + " \"" + GroupName + "\"\n" ;
2091 //
2092   _Texte += saux + "#\n" ;
2093 //
2094 }
2095 //===============================================================================
2096 // E. Les interpolations
2097 //===============================================================================
2098 // Les fichiers d'entree et de sortie des champs a interpoler
2099 void HomardDriver::TexteFieldInterp( const std::string FieldFile, const std::string MeshFile )
2100 {
2101   MESSAGE("TexteFieldInterp, FieldFile = "<<FieldFile<<", MeshFile = "<<MeshFile);
2102 //
2103   _Texte += "#\n# Interpolations des champs\n" ;
2104 //
2105 // Fichier en entree
2106   _Texte += "CCSolN__ \"" + FieldFile + "\"\n" ;
2107 // Fichier en sortie
2108   _Texte += "CCSolNP1 \"" + MeshFile  + "\"\n" ;
2109 //
2110 //  std::cerr << "A la fin de TexteFieldInterp _Texte ="<<_Texte << std::endl;
2111 }
2112 //===============================================================================
2113 // Tous les champs sont a interpoler
2114 void HomardDriver::TexteFieldInterpAll( )
2115 {
2116   MESSAGE("TexteFieldInterpAll");
2117 //
2118   _Texte += "CCChaTou oui\n" ;
2119 }
2120 //===============================================================================
2121 // Ecrit les caracteristiques de chaque interpolation sous la forme :
2122 //   CCChaNom 1 "DEPL"     ! Nom du 1er champ a interpoler
2123 //   CCChaTIn 1 0          ! Mode d'interpolation : automatique
2124 //   CCChaNom 2 "VOLUME"   ! Nom du 2nd champ a interpoler
2125 //   CCChaTIn 2 1          ! Mode d'interpolation : une variable extensive
2126 //   CCChaPdT 2 14         ! Pas de temps 14
2127 //   CCChaNuO 2 14         ! Numero d'ordre 14
2128 //   etc.
2129 //
2130 // NumeChamp : numero d'ordre du champ a interpoler
2131 // FieldName : nom du champ
2132 // TypeInterp : type d'interpolation
2133 // TimeStep : pas de temps retenu (>0 si pas de precision)
2134 // Rank : numero d'ordre retenu
2135 //
2136 void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank)
2137 {
2138   MESSAGE("TexteFieldInterpNameType, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName<<", TypeInterp = "<<TypeInterp);
2139   MESSAGE("TexteFieldInterpNameType, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
2140 // Numero d'ordre du champ a interpoler
2141   std::stringstream saux1 ;
2142   saux1 << NumeChamp ;
2143   std::string saux = saux1.str() ;
2144 // Nom du champ
2145   _Texte +="CCChaNom " + saux + " \"" + FieldName + "\"\n" ;
2146 // Type d'interpolation pour le champ
2147   _Texte +="CCChaTIn " + saux + " " + TypeInterp + "\n" ;
2148 //
2149   if ( TimeStep >= 0 )
2150   {
2151     {
2152       std::stringstream saux1 ;
2153       saux1 << TimeStep ;
2154       _Texte += "CCChaPdT " + saux + " " + saux1.str()  + "\n" ;
2155     }
2156     {
2157       std::stringstream saux1 ;
2158       saux1 << Rank ;
2159       _Texte += "CCChaNuO " + saux + " " + saux1.str()  + "\n" ;
2160     }
2161   }
2162 }
2163 //===============================================================================
2164 // F. Les options avancees
2165 //===============================================================================
2166 void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int ExtraOutput )
2167 {
2168   MESSAGE("TexteAdvanced, Pyram ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", ExtraOutput ="<<ExtraOutput);
2169
2170   if ( Pyram > 0 )
2171   {
2172     _Texte += "# Autorisation de pyramides dans le maillage initial\n" ;
2173     _Texte += "TypeElem ignore_pyra\n" ;
2174   }
2175   if ( NivMax > 0 )
2176   {
2177     _Texte += "# Niveaux extremes\n" ;
2178     { std::stringstream saux1 ;
2179       saux1 << NivMax ;
2180       _Texte += "NiveauMa " + saux1.str() + "\n" ;
2181     }
2182   }
2183   if ( DiamMin > 0 )
2184   {
2185     _Texte += "# Diametre minimal\n" ;
2186     { std::stringstream saux1 ;
2187       saux1 << DiamMin ;
2188       _Texte += "DiametMi " + saux1.str()  + "\n" ;
2189     }
2190   }
2191   if ( AdapInit != 0 )
2192   {
2193     if ( AdapInit > 0 )
2194     { _Texte += "# Raffinement" ; }
2195     else
2196     { _Texte += "# Deraffinement" ; }
2197     _Texte += " des regions sans indicateur\n" ;
2198     { std::stringstream saux1 ;
2199       saux1 << AdapInit ;
2200       _Texte += "AdapInit " + saux1.str() + "\n" ;
2201     }
2202   }
2203   if ( ExtraOutput % 2 == 0 )
2204   {
2205     _Texte += "# Sortie des niveaux de raffinement\n" ;
2206     _Texte += "NCNiveau NIVEAU\n" ;
2207   }
2208   if ( ExtraOutput % 3 == 0 )
2209   {
2210     _Texte += "# Sortie des qualités des mailles\n" ;
2211     _Texte += "NCQualit QUAL\n" ;
2212   }
2213   if ( ExtraOutput % 5 == 0 )
2214   {
2215     _Texte += "# Sortie des diamètres des mailles\n" ;
2216     _Texte += "NCDiamet DIAM\n" ;
2217   }
2218   if ( ExtraOutput % 7 == 0 )
2219   {
2220     _Texte += "# Sortie des parents des mailles\n" ;
2221     _Texte += "NCParent PARENT\n" ;
2222   }
2223   if ( ExtraOutput % 11 == 0 )
2224   {
2225     _Texte += "# Volumes voisins par recollement\n" ;
2226     _Texte += "NCVoisRc Voisin-Recollement\n" ;
2227   }
2228 }
2229 //===============================================================================
2230 // G. Les messages
2231 //===============================================================================
2232 void HomardDriver::TexteInfoCompute( int MessInfo )
2233 {
2234   MESSAGE("TexteAdvanced, MessInfo ="<<MessInfo);
2235
2236   if ( MessInfo != 0 )
2237   {
2238      _Texte += "# Messages d'informations\n" ;
2239     { std::stringstream saux1 ;
2240       saux1 << MessInfo ;
2241       _Texte += "MessInfo " + saux1.str()  + "\n" ;
2242     }
2243    }
2244 }
2245 //===============================================================================
2246 void HomardDriver::CreeFichier( )
2247 {
2248 //
2249   if ( _modeHOMARD == 1 )
2250   { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".vers." + _siterp1 ; }
2251   else if ( _modeHOMARD == 2 )
2252   { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".info" ; }
2253   else if ( _modeHOMARD == 5 )
2254   { _NomFichierConf = _NomFichierConfBase + ".majc" ; }
2255 //
2256   std::ofstream Fic(_NomFichierConf.c_str(), std::ios::out ) ;
2257   if (Fic.is_open() == true) { Fic << _Texte << std::endl ; }
2258   Fic.close() ;
2259 //
2260 }
2261 //===============================================================================
2262 // Creation du fichier de donnees pour l'information
2263 //===============================================================================
2264 void HomardDriver::CreeFichierDonn( )
2265 {
2266 //
2267   MESSAGE("CreeFichierDonn");
2268   _NomFichierDonn = "info.donn" ;
2269 //
2270   std::string data ;
2271   data  = "0\n" ;
2272   data += "0\n" ;
2273   data += "q\n" ;
2274   std::ofstream Fic(_NomFichierDonn.c_str(), std::ios::out ) ;
2275   if (Fic.is_open() == true) { Fic << data << std::endl ; }
2276   Fic.close() ;
2277 //
2278 }
2279 //===============================================================================
2280 int HomardDriver::ExecuteHomard(int option)
2281 {
2282   MESSAGE("ExecuteHomard, avec option = "<<option);
2283   std::string commande ;
2284   int codret ;
2285 // Copie des Fichiers HOMARD
2286   commande = "cp " + _NomFichierConf + " " + _NomFichierConfBase ;
2287   codret = system(commande.c_str()) ;
2288
2289 // Execution de HOMARD
2290   if ( codret == 0)
2291   {
2292     commande = _HOMARD_Exec.c_str() ;
2293     if ( _NomFichierDonn != "" ) { commande += " < " + _NomFichierDonn ; }
2294     codret = system(commande.c_str());
2295     if ( codret != 0) { MESSAGE ( "Erreur en executant HOMARD : " << codret ); };
2296     _NomFichierDonn = "" ;
2297   };
2298   return codret ;
2299 }
2300
2301 //=============================================================================
2302 //=============================================================================
2303 HOMARD_Gen::HOMARD_Gen()
2304 {
2305   MESSAGE("HOMARD_Gen");
2306 }
2307
2308 //=============================================================================
2309 //=============================================================================
2310 HOMARD_Gen::~HOMARD_Gen()
2311 {
2312   MESSAGE("~HOMARD_Gen");
2313 }
2314 //=============================================================================
2315
2316 //=============================================================================
2317 /*!
2318  *  default constructor:
2319  */
2320 //=============================================================================
2321 HOMARD_Hypothesis::HOMARD_Hypothesis():
2322   _Name(""), _NomCasCreation(""),
2323   _TypeAdap(-1), _TypeRaff(0), _TypeDera(0),
2324   _Field(""),
2325   _TypeThR(0), _ThreshR(0),
2326   _TypeThC(0), _ThreshC(0),
2327   _UsField(0), _UsCmpI(0),  _TypeFieldInterp(0)
2328 {
2329   MESSAGE("HOMARD_Hypothesis");
2330 }
2331
2332 //=============================================================================
2333 /*!
2334  */
2335 //=============================================================================
2336 HOMARD_Hypothesis::~HOMARD_Hypothesis()
2337 {
2338   MESSAGE("~HOMARD_Hypothesis");
2339 }
2340 //=============================================================================
2341 //=============================================================================
2342 // Generalites
2343 //=============================================================================
2344 //=============================================================================
2345 void HOMARD_Hypothesis::SetName( const char* Name )
2346 {
2347   _Name = std::string( Name );
2348 }
2349 //=============================================================================
2350 std::string HOMARD_Hypothesis::GetName() const
2351 {
2352   return _Name;
2353 }
2354 //=============================================================================
2355 std::string HOMARD_Hypothesis::GetDumpPython() const
2356 {
2357   std::ostringstream aScript;
2358   aScript << "\n# Creation of the hypothesis " << _Name << "\n" ;
2359   aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n";
2360   if ( _TypeAdap == -1 )
2361   {
2362     int TypeRaffDera ;
2363     if ( _TypeRaff == 1 ) { TypeRaffDera = 1 ; }
2364     else                  { TypeRaffDera = -1 ; }
2365     aScript << "\t" << _Name << ".SetUnifRefinUnRef(" << TypeRaffDera << ")\n";
2366   }
2367
2368 // Raffinement selon des zones geometriques
2369   std::list<std::string>::const_iterator it = _ListZone.begin();
2370   int TypeUse ;
2371   while(it != _ListZone.end())
2372   {
2373       aScript << "\t" << _Name << ".AddZone(\"" << *it;
2374       it++;
2375       if ( *it == "1" ) { TypeUse =  1 ; }
2376       else              { TypeUse = -1 ; }
2377       aScript << "\", " << TypeUse << ")\n";
2378       it++;
2379   }
2380
2381 // Raffinement selon un champ
2382   if ( _TypeAdap == 1 )
2383   {
2384     aScript << "\t" << _Name << ".SetField(\"" << _Field << "\")\n";
2385     aScript << "\t" << _Name << ".SetUseField(" << _UsField << ")\n";
2386     aScript << "\t" << _Name << ".SetUseComp(" << _UsCmpI << ")\n";
2387     std::list<std::string>::const_iterator it_comp = _ListComp.begin();
2388     while(it_comp != _ListComp.end())
2389     {
2390       aScript << "\t" << _Name << ".AddComp(\"" << *it_comp << "\")\n";
2391       it_comp++;
2392     }
2393     if ( _TypeRaff == 1 )
2394     {
2395       aScript << "\t" << _Name << ".SetRefinThr(" << _TypeThR << ", " << _ThreshR << ")\n";
2396     }
2397     if ( _TypeDera == 1 )
2398     {
2399       aScript << "\t" << _Name << ".SetUnRefThr(" << _TypeThC << ", " << _ThreshC << ")\n";
2400     }
2401   }
2402
2403 // Filtrage du raffinement par des groupes
2404    for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++)
2405        aScript << "\t" << _Name << ".AddGroup(\""  << (*it) <<  "\")\n" ;
2406
2407 // Interpolation des champs
2408   if ( _TypeFieldInterp == 2 )
2409   {
2410     std::list<std::string>::const_iterator it_champ = _ListFieldInterp.begin();
2411     while(it_champ != _ListFieldInterp.end())
2412     {
2413       aScript << "\t" << _Name << ".AddFieldInterpType( \"" << *it_champ  <<  "\" " ;
2414       it_champ++;
2415       aScript << ", " << *it_champ << ")\n";
2416       it_champ++;
2417     }
2418   }
2419   else if ( _TypeFieldInterp != 0 )
2420   {
2421     aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n";
2422   }
2423   if ( _NivMax > 0 )
2424   {
2425     aScript << "\t" <<_Name << ".SetNivMax(" << _NivMax << ")\n";
2426   }
2427   if ( _DiamMin > 0 )
2428   {
2429     aScript << "\t" <<_Name << ".SetDiamMin(" << _DiamMin << ")\n";
2430   }
2431   if ( _AdapInit != 0 )
2432   {
2433     aScript << "\t" <<_Name << ".SetAdapInit(" << _AdapInit << ")\n";
2434   }
2435   if ( _ExtraOutput != 1 )
2436   {
2437     aScript << "\t" <<_Name << ".SetExtraOutput(" << _ExtraOutput << ")\n";
2438   }
2439
2440   return aScript.str();
2441 }
2442 //=============================================================================
2443 //=============================================================================
2444 // Caracteristiques
2445 //=============================================================================
2446 //=============================================================================
2447 void HOMARD_Hypothesis::SetAdapType( int TypeAdap )
2448 {
2449   VERIFICATION( (TypeAdap>=-1) && (TypeAdap<=1) );
2450   _TypeAdap = TypeAdap;
2451 }
2452 //=============================================================================
2453 int HOMARD_Hypothesis::GetAdapType() const
2454 {
2455   return _TypeAdap;
2456 }
2457 //=============================================================================
2458 void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera )
2459 {
2460   VERIFICATION( (TypeRaff>=-1) && (TypeRaff<=1) );
2461   _TypeRaff = TypeRaff;
2462   VERIFICATION( (TypeDera>=-1) && (TypeDera<=1) );
2463   _TypeDera = TypeDera;
2464 }
2465 //=============================================================================
2466 int HOMARD_Hypothesis::GetRefinType() const
2467 {
2468   return _TypeRaff;
2469 }
2470 //=============================================================================
2471 int HOMARD_Hypothesis::GetUnRefType() const
2472 {
2473   return _TypeDera;
2474 }
2475 //=============================================================================
2476 void HOMARD_Hypothesis::SetField( const char* FieldName )
2477 {
2478   _Field = std::string( FieldName );
2479   MESSAGE( "SetField : FieldName = " << FieldName );
2480 }
2481 //=============================================================================
2482 std::string HOMARD_Hypothesis::GetFieldName() const
2483 {
2484   return _Field;
2485 }
2486 //=============================================================================
2487 void HOMARD_Hypothesis::SetUseField( int UsField )
2488 {
2489   VERIFICATION( (UsField>=0) && (UsField<=1) );
2490   _UsField = UsField;
2491 }
2492 //=============================================================================
2493 int HOMARD_Hypothesis::GetUseField() const
2494 {
2495   return _UsField;
2496 }
2497 //=============================================================================
2498 void HOMARD_Hypothesis::SetUseComp( int UsCmpI )
2499 {
2500   MESSAGE ("SetUseComp pour UsCmpI = "<<UsCmpI) ;
2501   VERIFICATION( (UsCmpI>=0) && (UsCmpI<=2) );
2502   _UsCmpI = UsCmpI;
2503 }
2504 //=============================================================================
2505 int HOMARD_Hypothesis::GetUseComp() const
2506 {
2507   return _UsCmpI;
2508 }
2509 //=============================================================================
2510 void HOMARD_Hypothesis::AddComp( const char* NomComp )
2511 {
2512 // On commence par supprimer la composante au cas ou elle aurait deja ete inseree
2513 // Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
2514 // definition de l'hypothese
2515   SupprComp( NomComp ) ;
2516 // Insertion veritable
2517   _ListComp.push_back( std::string( NomComp ) );
2518 }
2519 //=============================================================================
2520 void HOMARD_Hypothesis::SupprComp( const char* NomComp )
2521 {
2522   MESSAGE ("SupprComp pour "<<NomComp) ;
2523   std::list<std::string>::iterator it = find( _ListComp.begin(), _ListComp.end(), NomComp );
2524   if ( it != _ListComp.end() ) { it = _ListComp.erase( it ); }
2525 }
2526 //=============================================================================
2527 void HOMARD_Hypothesis::SupprComps()
2528 {
2529   _ListComp.clear();
2530 }
2531 //=============================================================================
2532 const std::list<std::string>& HOMARD_Hypothesis::GetComps() const
2533 {
2534   return _ListComp;
2535 }
2536 //=============================================================================
2537 void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR )
2538 {
2539   MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR );
2540   VERIFICATION( (TypeThR>=0) && (TypeThR<=4) );
2541   _TypeThR = TypeThR;
2542   _ThreshR = ThreshR;
2543 }
2544 //=============================================================================
2545 int HOMARD_Hypothesis::GetRefinThrType() const
2546 {
2547   return _TypeThR;
2548 }
2549 //=============================================================================
2550 double HOMARD_Hypothesis::GetThreshR() const
2551 {
2552   return _ThreshR;
2553 }
2554 //=============================================================================
2555 void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC )
2556 {
2557   VERIFICATION( (TypeThC>=0) && (TypeThC<=4) );
2558   _TypeThC = TypeThC;
2559   _ThreshC = ThreshC;
2560 }
2561 //=============================================================================
2562 int HOMARD_Hypothesis::GetUnRefThrType() const
2563 {
2564   return _TypeThC;
2565 }
2566 //=============================================================================
2567 double HOMARD_Hypothesis::GetThreshC() const
2568 {
2569   return _ThreshC;
2570 }
2571 //=============================================================================
2572 void HOMARD_Hypothesis::SetNivMax( int NivMax )
2573 //=============================================================================
2574 {
2575   _NivMax = NivMax;
2576 }
2577 //=============================================================================
2578 const int HOMARD_Hypothesis::GetNivMax() const
2579 //=============================================================================
2580 {
2581   return _NivMax;
2582 }
2583 //=============================================================================
2584 void HOMARD_Hypothesis::SetDiamMin( double DiamMin )
2585 //=============================================================================
2586 {
2587   _DiamMin = DiamMin;
2588 }
2589 //=============================================================================
2590 const double HOMARD_Hypothesis::GetDiamMin() const
2591 //=============================================================================
2592 {
2593   return _DiamMin;
2594 }
2595 //=============================================================================
2596 void HOMARD_Hypothesis::SetAdapInit( int AdapInit )
2597 //=============================================================================
2598 {
2599   _AdapInit = AdapInit;
2600 }
2601 //=============================================================================
2602 const int HOMARD_Hypothesis::GetAdapInit() const
2603 //=============================================================================
2604 {
2605   return _AdapInit;
2606 }
2607 //=============================================================================
2608 void HOMARD_Hypothesis::SetExtraOutput( int ExtraOutput )
2609 //=============================================================================
2610 {
2611   _ExtraOutput = ExtraOutput;
2612 }
2613 //=============================================================================
2614 const int HOMARD_Hypothesis::GetExtraOutput() const
2615 //=============================================================================
2616 {
2617   return _ExtraOutput;
2618 }
2619 //=============================================================================
2620 void HOMARD_Hypothesis::AddGroup( const char* Group)
2621 {
2622 // On commence par supprimer le groupe au cas ou il aurait deja ete insere
2623 // Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
2624 // definition de l'hypothese
2625   SupprGroup( Group ) ;
2626 // Insertion veritable
2627   _ListGroupSelected.push_back(Group);
2628 }
2629 //=============================================================================
2630 void HOMARD_Hypothesis::SupprGroup( const char* Group )
2631 {
2632   MESSAGE ("SupprGroup pour "<<Group) ;
2633   std::list<std::string>::iterator it = find( _ListGroupSelected.begin(), _ListGroupSelected.end(), Group );
2634   if ( it != _ListGroupSelected.end() ) { it = _ListGroupSelected.erase( it ); }
2635 }
2636 //=============================================================================
2637 void HOMARD_Hypothesis::SupprGroups()
2638 {
2639   _ListGroupSelected.clear();
2640 }
2641 //=============================================================================
2642 void HOMARD_Hypothesis::SetGroups( const std::list<std::string>& ListGroup )
2643 {
2644   _ListGroupSelected.clear();
2645   std::list<std::string>::const_iterator it = ListGroup.begin();
2646   while(it != ListGroup.end())
2647     _ListGroupSelected.push_back((*it++));
2648 }
2649 //=============================================================================
2650 const std::list<std::string>& HOMARD_Hypothesis::GetGroups() const
2651 {
2652   return _ListGroupSelected;
2653 }
2654 //=============================================================================
2655 // Type d'interpolation des champs :
2656 //   0 : aucun champ n'est interpole
2657 //   1 : tous les champs sont interpoles
2658 //   2 : certains champs sont interpoles
2659 void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp )
2660 {
2661   VERIFICATION( (TypeFieldInterp>=0) && (TypeFieldInterp<=2) );
2662   _TypeFieldInterp = TypeFieldInterp;
2663 }
2664 //=============================================================================
2665 int HOMARD_Hypothesis::GetTypeFieldInterp() const
2666 {
2667   return _TypeFieldInterp;
2668 }
2669 //=============================================================================
2670 void HOMARD_Hypothesis::AddFieldInterpType( const char* FieldInterp, int TypeInterp )
2671 {
2672   MESSAGE ("Dans AddFieldInterpType pour " << FieldInterp << " et TypeInterp = " << TypeInterp) ;
2673 // On commence par supprimer le champ au cas ou il aurait deja ete insere
2674 // Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
2675 // definition de l'hypothese
2676   SupprFieldInterp( FieldInterp ) ;
2677 // Insertion veritable
2678 // . Nom du champ
2679   _ListFieldInterp.push_back( std::string( FieldInterp ) );
2680 // . Usage du champ
2681   std::stringstream saux1 ;
2682   saux1 << TypeInterp ;
2683   _ListFieldInterp.push_back( saux1.str() );
2684 // . Indication generale : certains champs sont a interpoler
2685   SetTypeFieldInterp ( 2 ) ;
2686 }
2687 //=============================================================================
2688 void HOMARD_Hypothesis::SupprFieldInterp( const char* FieldInterp )
2689 {
2690   MESSAGE ("Dans SupprFieldInterp pour " << FieldInterp) ;
2691   std::list<std::string>::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ) ;
2692 // Attention a supprimer le nom du champ et le type d'usage
2693   if ( it != _ListFieldInterp.end() )
2694   {
2695     it = _ListFieldInterp.erase( it ) ;
2696     it = _ListFieldInterp.erase( it ) ;
2697   }
2698 // Decompte du nombre de champs restant a interpoler
2699   it = _ListFieldInterp.begin() ;
2700   int cpt = 0 ;
2701   while(it != _ListFieldInterp.end())
2702   {
2703     cpt += 1 ;
2704     (*it++);
2705   }
2706   MESSAGE("Nombre de champ restants = "<<cpt/2);
2707 // . Indication generale : aucun champ ne reste a interpoler
2708   if ( cpt == 0 )
2709   {
2710     SetTypeFieldInterp ( 0 ) ;
2711   }
2712 }
2713 //=============================================================================
2714 void HOMARD_Hypothesis::SupprFieldInterps()
2715 {
2716   MESSAGE ("SupprFieldInterps") ;
2717   _ListFieldInterp.clear();
2718 // . Indication generale : aucun champ ne reste a interpoler
2719   SetTypeFieldInterp ( 0 ) ;
2720 }
2721 //=============================================================================
2722 const std::list<std::string>& HOMARD_Hypothesis::GetFieldInterps() const
2723 {
2724   return _ListFieldInterp;
2725 }
2726 //=============================================================================
2727 //=============================================================================
2728 // Liens avec les autres structures
2729 //=============================================================================
2730 //=============================================================================
2731 void HOMARD_Hypothesis::SetCaseCreation( const char* NomCasCreation )
2732 {
2733   _NomCasCreation = std::string( NomCasCreation );
2734 }
2735 //=============================================================================
2736 std::string HOMARD_Hypothesis::GetCaseCreation() const
2737 {
2738   return _NomCasCreation;
2739 }
2740 //=============================================================================
2741 void HOMARD_Hypothesis::LinkIteration( const char* NomIteration )
2742 {
2743   _ListIter.push_back( std::string( NomIteration ) );
2744 }
2745 //=============================================================================
2746 void HOMARD_Hypothesis::UnLinkIteration( const char* NomIteration )
2747 {
2748   std::list<std::string>::iterator it = find( _ListIter.begin(), _ListIter.end(), NomIteration ) ;
2749   if ( it != _ListIter.end() )
2750   {
2751     MESSAGE ("Dans UnLinkIteration pour " << NomIteration) ;
2752     it = _ListIter.erase( it ) ;
2753   }
2754 }
2755 //=============================================================================
2756 void HOMARD_Hypothesis::UnLinkIterations()
2757 {
2758   _ListIter.clear();
2759 }
2760 //=============================================================================
2761 const std::list<std::string>& HOMARD_Hypothesis::GetIterations() const
2762 {
2763   return _ListIter;
2764 }
2765 //=============================================================================
2766 void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse )
2767 {
2768   MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse) ;
2769 // On commence par supprimer la zone au cas ou elle aurait deja ete inseree
2770 // Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
2771 // definition de l'hypothese
2772   SupprZone( NomZone ) ;
2773 // Insertion veritable
2774 // . Nom de la zone
2775   _ListZone.push_back( std::string( NomZone ) );
2776 // . Usage de la zone
2777   std::stringstream saux1 ;
2778   saux1 << TypeUse ;
2779   _ListZone.push_back( saux1.str() );
2780 }
2781 //=============================================================================
2782 void HOMARD_Hypothesis::SupprZone( const char* NomZone )
2783 {
2784   MESSAGE ("Dans SupprZone pour " << NomZone) ;
2785   std::list<std::string>::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone );
2786 // Attention a supprimer le nom de zone et le type d'usage
2787   if ( it != _ListZone.end() )
2788   {
2789     it = _ListZone.erase( it );
2790     it = _ListZone.erase( it );
2791   }
2792 }
2793 //=============================================================================
2794 void HOMARD_Hypothesis::SupprZones()
2795 {
2796   _ListZone.clear();
2797 }
2798 //=============================================================================
2799 const std::list<std::string>& HOMARD_Hypothesis::GetZones() const
2800 {
2801   return _ListZone;
2802 }
2803
2804 //=============================================================================
2805 /*!
2806  *  default constructor:
2807  */
2808 //=============================================================================
2809 HOMARD_Iteration::HOMARD_Iteration():
2810   _Name( "" ), _Etat( 0 ),
2811  _NumIter( -1 ),
2812   _NomMesh( "" ), _MeshFile( "" ),
2813   _FieldFile( "" ), _TimeStep( -1 ), _Rank( -1 ),
2814   _LogFile( "" ),
2815   _IterParent( "" ),
2816   _NomHypo( "" ), _NomCas( "" ), _NomDir( "" ),
2817   _FileInfo( "" ),
2818  _MessInfo( 1 )
2819 {
2820   MESSAGE("HOMARD_Iteration");
2821 }
2822 //=============================================================================
2823 /*!
2824  *
2825  */
2826 //=============================================================================
2827 HOMARD_Iteration::~HOMARD_Iteration()
2828 {
2829   MESSAGE("~HOMARD_Iteration");
2830 }
2831 //=============================================================================
2832 //=============================================================================
2833 // Generalites
2834 //=============================================================================
2835 //=============================================================================
2836 void HOMARD_Iteration::SetName( const char* Name )
2837 {
2838   _Name = std::string( Name );
2839 }
2840 //=============================================================================
2841 std::string HOMARD_Iteration::GetName() const
2842 {
2843   return _Name;
2844 }
2845 //=============================================================================
2846 std::string HOMARD_Iteration::GetDumpPython() const
2847 {
2848   if (_IterParent == "") return std::string(" ") ;   // Pas de creation explicite de iteration 0";
2849
2850   MESSAGE (". Ecriture de l iteration " << _Name );
2851   std::ostringstream aScript;
2852   aScript << "\n# Creation of the iteration " << _Name << "\n";
2853   if( _NumIter == 1 )
2854   {
2855        aScript << "\t" << _Name << " = " << _NomCas << ".NextIteration(\"" << _Name << "\")\n";
2856   }
2857    else
2858   {
2859        aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n";
2860   }
2861 // L'hypothese (doit etre au debut)
2862   aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n";
2863 // Le nom du maillage produit
2864 //   MESSAGE (".. maillage produit " << _NomMesh );
2865   aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ;
2866 // Le fichier du maillage produit
2867   aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n";
2868 // Le fichier des champs
2869   if ( _FieldFile != "" )
2870   {
2871     aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n";
2872   }
2873 // Si champ de pilotage, valeurs de pas de temps
2874   MESSAGE (". champ de pilotage : _TimeStep = " << _TimeStep << ", _Rank : " << _Rank);
2875   if ( _TimeStep != -1 )
2876   {
2877     if ( _TimeStep == -2 ) {
2878       aScript << "\t" << _Name << ".SetTimeStepRankLast()\n";
2879     }
2880     else
2881     {
2882       if ( _TimeStep != -1 )
2883       {
2884         if ( _Rank == -1 )
2885         {
2886           aScript << "\t" << _Name << ".SetTimeStep( " << _TimeStep << " )\n";
2887         }
2888         else
2889         {
2890           aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n";
2891         }
2892       }
2893     }
2894   }
2895 // Les instants d'interpolation
2896   MESSAGE (". instants d'interpolation ");
2897   std::list<std::string>::const_iterator it = _ListFieldInterpTSR.begin() ;
2898   while(it != _ListFieldInterpTSR.end())
2899   {
2900     std::string FieldName = std::string((*it)) ;
2901 //     MESSAGE ("... FieldName = "<< FieldName);
2902     (*it++);
2903     std::string TimeStepstr = std::string((*it)) ;
2904 //     MESSAGE ("... TimeStepstr = "<< TimeStepstr);
2905     (*it++);
2906     std::string Rankstr = std::string((*it)) ;
2907 //     MESSAGE ("... Rankstr = "<< Rankstr);
2908     (*it++);
2909     aScript << "\t" << _Name << ".SetFieldInterpTimeStepRank( \"" << FieldName << "\"" ;
2910     aScript << ", " << TimeStepstr ;
2911     aScript << ", " << Rankstr << " )\n" ;
2912   }
2913
2914 // Compute
2915   MESSAGE (". Compute ");
2916   if ( _Etat == 2 ) { aScript << "\tcodret = "  <<_Name << ".Compute(1, 1)\n"; }
2917   else              { aScript << "\t#codret = " <<_Name << ".Compute(1, 1)\n"; }
2918 //   MESSAGE (". Fin de l ecriture de l iteration " << _Name );
2919
2920   return aScript.str();
2921 }
2922 //=============================================================================
2923 //=============================================================================
2924 // Caracteristiques
2925 //=============================================================================
2926 //=============================================================================
2927 void HOMARD_Iteration::SetDirNameLoc( const char* NomDir )
2928 {
2929   _NomDir = std::string( NomDir );
2930 }
2931 //=============================================================================
2932 std::string HOMARD_Iteration::GetDirNameLoc() const
2933 {
2934    return _NomDir;
2935 }
2936 //=============================================================================
2937 void HOMARD_Iteration::SetNumber( int NumIter )
2938 {
2939   _NumIter = NumIter;
2940 }
2941 //=============================================================================
2942 int HOMARD_Iteration::GetNumber() const
2943 {
2944   return _NumIter;
2945 }
2946 //=============================================================================
2947 void HOMARD_Iteration::SetState( int etat )
2948 {
2949   _Etat = etat;
2950 }
2951 //=============================================================================
2952 int HOMARD_Iteration::GetState() const
2953 {
2954   return _Etat;
2955 }
2956 //=============================================================================
2957 void HOMARD_Iteration::SetMeshName( const char* NomMesh )
2958 {
2959   _NomMesh = std::string( NomMesh );
2960 }
2961 //=============================================================================
2962 std::string HOMARD_Iteration::GetMeshName() const
2963 {
2964   return _NomMesh;
2965 }
2966 //=============================================================================
2967 void HOMARD_Iteration::SetMeshFile( const char* MeshFile )
2968 {
2969   _MeshFile = std::string( MeshFile );
2970 }
2971 //=============================================================================
2972 std::string HOMARD_Iteration::GetMeshFile() const
2973 {
2974   return _MeshFile;
2975 }
2976 //=============================================================================
2977 void HOMARD_Iteration::SetFieldFile( const char* FieldFile )
2978 {
2979   _FieldFile = std::string( FieldFile );
2980 }
2981 //=============================================================================
2982 std::string HOMARD_Iteration::GetFieldFile() const
2983 {
2984   return _FieldFile;
2985 }
2986 //=============================================================================
2987 // Instants pour le champ de pilotage
2988 //=============================================================================
2989 void HOMARD_Iteration::SetTimeStep( int TimeStep )
2990 {
2991   _TimeStep = TimeStep;
2992 }
2993 //=============================================================================
2994 void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank )
2995 {
2996   _TimeStep = TimeStep;
2997   _Rank = Rank;
2998 }
2999 //=============================================================================
3000 void HOMARD_Iteration::SetTimeStepRankLast()
3001 {
3002   _TimeStep = -2;
3003 }
3004 //=============================================================================
3005 int HOMARD_Iteration::GetTimeStep() const
3006 {
3007   return _TimeStep;
3008 }
3009 //=============================================================================
3010 int HOMARD_Iteration::GetRank() const
3011 {
3012   return _Rank;
3013 }
3014 //=============================================================================
3015 // Instants pour un champ a interpoler
3016 //=============================================================================
3017 void HOMARD_Iteration::SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep )
3018 {
3019   SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ) ;
3020 }
3021 //=============================================================================
3022 void HOMARD_Iteration::SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank )
3023 {
3024   MESSAGE("Champ " << FieldInterp << ", hypothese " << _NomHypo )
3025 // Verification de la presence du champ dans l'hypothese
3026   std::list<std::string>::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp );
3027   if ( it == _ListFieldInterp.end() )
3028   {
3029     INFOS("Champ " << FieldInterp << " ; hypothese " << _NomHypo )
3030     VERIFICATION("Le champ est inconnu dans l'hypothese associee a cette iteration." == 0);
3031   }
3032
3033 // . Nom du champ
3034   _ListFieldInterpTSR.push_back( std::string( FieldInterp ) );
3035 // . Pas de temps
3036   std::stringstream saux1 ;
3037   saux1 << TimeStep ;
3038   _ListFieldInterpTSR.push_back( saux1.str() );
3039 // . Numero d'ordre
3040   std::stringstream saux2 ;
3041   saux2 << Rank ;
3042   _ListFieldInterpTSR.push_back( saux2.str() );
3043 }
3044 //=============================================================================
3045 const std::list<std::string>& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const
3046 {
3047   return _ListFieldInterpTSR;
3048 }
3049 //=============================================================================
3050 void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp )
3051 {
3052   _ListFieldInterp.push_back( std::string( FieldInterp ) );
3053 }
3054 //=============================================================================
3055 const std::list<std::string>& HOMARD_Iteration::GetFieldInterps() const
3056 {
3057   return _ListFieldInterp;
3058 }
3059 //=============================================================================
3060 void HOMARD_Iteration::SupprFieldInterps()
3061 {
3062   _ListFieldInterp.clear();
3063 }
3064 //=============================================================================
3065 void HOMARD_Iteration::SetLogFile( const char* LogFile )
3066 {
3067   _LogFile = std::string( LogFile );
3068 }
3069 //=============================================================================
3070 std::string HOMARD_Iteration::GetLogFile() const
3071 {
3072   return _LogFile;
3073 }
3074 //=============================================================================
3075 void HOMARD_Iteration::SetFileInfo( const char* FileInfo )
3076 {
3077   _FileInfo = std::string( FileInfo );
3078 }
3079 //=============================================================================
3080 std::string HOMARD_Iteration::GetFileInfo() const
3081 {
3082   return _FileInfo;
3083 }
3084 //=============================================================================
3085 //=============================================================================
3086 // Liens avec les autres iterations
3087 //=============================================================================
3088 //=============================================================================
3089 void HOMARD_Iteration::LinkNextIteration( const char* NomIteration )
3090 {
3091   _mesIterFilles.push_back( std::string( NomIteration ) );
3092 }
3093 //=============================================================================
3094 void HOMARD_Iteration::UnLinkNextIteration( const char* NomIteration )
3095 {
3096   std::list<std::string>::iterator it = find( _mesIterFilles.begin(), _mesIterFilles.end(), NomIteration ) ;
3097   if ( it != _mesIterFilles.end() )
3098   {
3099     MESSAGE ("Dans UnLinkNextIteration pour " << NomIteration) ;
3100     it = _mesIterFilles.erase( it ) ;
3101   }
3102 }
3103 //=============================================================================
3104 void HOMARD_Iteration::UnLinkNextIterations()
3105 {
3106   _mesIterFilles.clear();
3107 }
3108 //=============================================================================
3109 const std::list<std::string>& HOMARD_Iteration::GetIterations() const
3110 {
3111   return _mesIterFilles;
3112 }
3113 //=============================================================================
3114 void HOMARD_Iteration::SetIterParentName( const char* IterParent )
3115 {
3116   _IterParent = IterParent;
3117 }
3118 //=============================================================================
3119 std::string HOMARD_Iteration::GetIterParentName() const
3120 {
3121   return _IterParent;
3122 }
3123 //=============================================================================
3124 //=============================================================================
3125 // Liens avec les autres structures
3126 //=============================================================================
3127 //=============================================================================
3128 void HOMARD_Iteration::SetCaseName( const char* NomCas )
3129 {
3130   _NomCas = std::string( NomCas );
3131 }
3132 //=============================================================================
3133 std::string HOMARD_Iteration::GetCaseName() const
3134 {
3135   return _NomCas;
3136 }
3137 //=============================================================================
3138 void HOMARD_Iteration::SetHypoName( const char* NomHypo )
3139 {
3140   _NomHypo = std::string( NomHypo );
3141 }
3142 //=============================================================================
3143 std::string HOMARD_Iteration::GetHypoName() const
3144 {
3145   return _NomHypo;
3146 }
3147 //=============================================================================
3148 //=============================================================================
3149 // Divers
3150 //=============================================================================
3151 //=============================================================================
3152 void HOMARD_Iteration::SetInfoCompute( int MessInfo )
3153 {
3154   _MessInfo = MessInfo;
3155 }
3156 //=============================================================================
3157 int HOMARD_Iteration::GetInfoCompute() const
3158 {
3159   return _MessInfo;
3160 }
3161
3162 } // namespace SMESHHOMARDImpl /end/