1 // HOMARD HOMARD : implementaion of HOMARD idl descriptions
3 // Copyright (C) 2011 CEA/DEN, EDF R&D
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.
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.
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
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 #include "Utils_SALOME_Exception.hxx"
27 #include "utilities.h"
28 #include "HomardDriver.hxx"
30 //=============================================================================
31 //=============================================================================
32 HomardDriver::HomardDriver(const std::string siter, const std::string siterp1):
33 _HOMARD_Exec( "" ), _NomDir( "" ), _NomFichierConfBase( "HOMARD.Configuration" ),
34 _NomFichierConf( "" ), _siter( "" ), _siterp1( "" ),
35 _Texte( "" ), _bLu( false )
37 // Memorisation du nom complet de l'executable HOMARD
38 char* dirchar; char* execchar;
40 std::string executable;
41 if ( !(dirchar = getenv("HOMARD_REP_EXE")) )
42 dir = "/local00/HOMARD_SVN/trunk/bin" ;
44 dir = std::string(dirchar);
45 if ( !(execchar = getenv("HOMARD_EXE")) )
46 executable = "HOMARD.out";
48 executable = std::string(execchar);
49 _HOMARD_Exec = dir + "/" + executable ;
50 MESSAGE("Dans HomardDriver, _HOMARD_Exec ="<<_HOMARD_Exec);
56 //=============================================================================
57 //=============================================================================
58 HomardDriver::~HomardDriver()
62 ////=============================================================================
63 void HomardDriver::TexteInit( const std::string DirCompute, const std::string DirComputePa, const std::string MessFile )
65 MESSAGE("Dans TexteInit, MessFile ="<<MessFile);
67 _Texte = "Action homa\n" ;
68 _Texte += "CCAssoci med\n" ;
69 _Texte += "ModeHOMA 1\n" ;
70 _Texte += "NumeIter " + _siter + "\n" ;
71 _Texte += "ListeStd " + MessFile + "\n" ;
72 _Texte += "# Maillages HOMARD \n" ;
73 _Texte += "HOMaiN__ Mai" + _siter + " " + DirComputePa + "/maill." + _siter + ".hom.med\n" ;
74 _Texte += "HOMaiNP1 Mai" + _siterp1 + " " + DirCompute + "/maill." + _siterp1 + ".hom.med\n" ;
75 _Texte += "RepeTrav " + DirCompute + "\n" ;
79 ////=============================================================================
80 void HomardDriver::TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres )
82 MESSAGE("Dans TexteMaillage, NomMesh ="<<NomMesh<<", MeshFile ="<<MeshFile);
85 if ( apres < 1 ) { saux = "__" ; }
87 _Texte += "# Maillages Med " + saux + "\n" ;
88 _Texte += "CCNoMN" + saux + " \"" + NomMesh + "\"\n" ;
89 _Texte += "CCMaiN" + saux + " " + MeshFile + "\n" ;
92 ////=============================================================================
93 void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera )
95 MESSAGE("Dans TexteConfRaffDera, ConfType ="<<ConfType);
96 MESSAGE("Dans TexteConfRaffDera, TypeAdap ="<<TypeAdap<<", TypeRaff ="<<TypeRaff<<", TypeDera ="<<TypeDera);
110 saux = "non_conforme_1_noeud" ;
115 saux = "non_conforme_1_arete" ;
120 saux = "non_conforme_indicateur" ;
124 _Texte += "# Type de conformite\nTypeConf " + saux + "\n" ;
126 // Type de raffinement/deraffinement
128 if ( TypeAdap == -1 )
132 saux = "TypeRaff uniforme\n" ;
136 saux = "TypeRaff non\n" ;
140 saux += "TypeDera uniforme" ;
144 saux += "TypeDera non" ;
151 saux = "TypeRaff libre\n" ;
155 saux = "TypeRaff non\n" ;
159 saux += "TypeDera libre" ;
163 saux += "TypeDera non" ;
166 _Texte += "# Type de raffinement/deraffinement\n" + saux + "\n" ;
168 // MESSAGE("A la fin de HomardDriver::TexteConfRaffDera, _Texte ="<<_Texte);
170 ////=============================================================================
171 void HomardDriver::TexteCompo( int NumeComp, const std::string NompCompo)
173 MESSAGE("Dans TexteCompo, NumeComp = "<<NumeComp<<", NompCompo = "<<NompCompo);
174 _Texte +="CCCoChaI \"" + NompCompo + "\"\n" ;
177 ////=============================================================================
178 void HomardDriver::TexteZone( int NumeZone, int ZoneType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 )
180 MESSAGE("TexteZone, NumeZone = "<<NumeZone<<", ZoneType = "<<ZoneType);
181 MESSAGE("TexteZone, coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
183 std::string saux, saux2 ;
188 if ( ZoneType >= 11 and ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
189 else if ( ZoneType >= 31 and ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
190 else if ( ZoneType >= 61 and ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
191 else { ZoneTypeHOMARD = ZoneType ; }
193 std::stringstream saux1 ;
195 saux2 = saux1.str() ;
196 saux = "#\n# Zone numero " + saux2 + "\n" ;
198 { std::stringstream saux1 ;
199 saux1 << NumeZone << " " << ZoneTypeHOMARD ;
200 saux2 = saux1.str() ;
201 saux += "ZoRaType " + saux2 + "\n" ;
206 if ( ZoneType == 11 ) // Z est constant X Homard <=> X Salome
207 // Y Homard <=> Y Salome
209 saux += "#Rectangle\n" ;
210 { std::stringstream saux1 ;
211 saux1 << NumeZone << " " << x0 ;
212 saux2 = saux1.str() ;
213 saux += "ZoRaXmin " + saux2 + "\n" ;
215 { std::stringstream saux1 ;
216 saux1 << NumeZone << " " << x1 ;
217 saux2 = saux1.str() ;
218 saux += "ZoRaXmax " + saux2 + "\n" ;
220 { std::stringstream saux1 ;
221 saux1 << NumeZone << " " << x2 ;
222 saux2 = saux1.str() ;
223 saux += "ZoRaYmin " + saux2 + "\n" ;
225 { std::stringstream saux1 ;
226 saux1 << NumeZone << " " << x3 ;
227 saux2 = saux1.str() ;
228 saux += "ZoRaYmax " + saux2 + "\n" ;
232 else if ( ZoneType == 12 ) // X est constant X Homard <=> Y Salome
233 // Y Homard <=> Z Salome
235 saux += "#Rectangle\n" ;
236 { std::stringstream saux1 ;
237 saux1 << NumeZone << " " << x2 ;
238 saux2 = saux1.str() ;
239 saux += "ZoRaXmin " + saux2 + "\n" ;
241 { std::stringstream saux1 ;
242 saux1 << NumeZone << " " << x3 ;
243 saux2 = saux1.str() ;
244 saux += "ZoRaXmax " + saux2 + "\n" ;
246 { std::stringstream saux1 ;
247 saux1 << NumeZone << " " << x4 ;
248 saux2 = saux1.str() ;
249 saux += "ZoRaYmin " + saux2 + "\n" ;
251 { std::stringstream saux1 ;
252 saux1 << NumeZone << " " << x5 ;
253 saux2 = saux1.str() ;
254 saux += "ZoRaYmax " + saux2 + "\n" ;
258 else if ( ZoneType == 13 ) // Y est constant X Homard <=> X Salome
259 // Y Homard <=> Z Salome
261 saux += "#Rectangle\n" ;
262 { std::stringstream saux1 ;
263 saux1 << NumeZone << " " << x0 ;
264 saux2 = saux1.str() ;
265 saux += "ZoRaXmin " + saux2 + "\n" ;
267 { std::stringstream saux1 ;
268 saux1 << NumeZone << " " << x1 ;
269 saux2 = saux1.str() ;
270 saux += "ZoRaXmax " + saux2 + "\n" ;
272 { std::stringstream saux1 ;
273 saux1 << NumeZone << " " << x4 ;
274 saux2 = saux1.str() ;
275 saux += "ZoRaYmin " + saux2 + "\n" ;
277 { std::stringstream saux1 ;
278 saux1 << NumeZone << " " << x5 ;
279 saux2 = saux1.str() ;
280 saux += "ZoRaYmax " + saux2 + "\n" ;
284 // Cas du parallelepipede
286 else if ( ZoneType == 2 )
288 saux += "# Boite\n" ;
289 { std::stringstream saux1 ;
290 saux1 << NumeZone << " " << x0 ;
291 saux2 = saux1.str() ;
292 saux += "ZoRaXmin " + saux2 + "\n" ;
294 { std::stringstream saux1 ;
295 saux1 << NumeZone << " " << x1 ;
296 saux2 = saux1.str() ;
297 saux += "ZoRaXmax " + saux2 + "\n" ;
299 { std::stringstream saux1 ;
300 saux1 << NumeZone << " " << x2 ;
301 saux2 = saux1.str() ;
302 saux += "ZoRaYmin " + saux2 + "\n" ;
304 { std::stringstream saux1 ;
305 saux1 << NumeZone << " " << x3 ;
306 saux2 = saux1.str() ;
307 saux += "ZoRaYmax " + saux2 + "\n" ;
309 { std::stringstream saux1 ;
310 saux1 << NumeZone << " " << x4 ;
311 saux2 = saux1.str() ;
312 saux += "ZoRaZmin " + saux2 + "\n" ;
314 { std::stringstream saux1 ;
315 saux1 << NumeZone << " " << x5 ;
316 saux2 = saux1.str() ;
317 saux += "ZoRaZmax " + saux2 + "\n" ;
323 else if ( ZoneType == 31 or ZoneType == 61 )
325 saux += "# Sphere\n" ;
326 { std::stringstream saux1 ;
327 saux1 << NumeZone << " " << x0 ;
328 saux2 = saux1.str() ;
329 saux += "ZoRaXCen " + saux2 + "\n" ;
331 { std::stringstream saux1 ;
332 saux1 << NumeZone << " " << x1 ;
333 saux2 = saux1.str() ;
334 saux += "ZoRaYCen " + saux2 + "\n" ;
336 { std::stringstream saux1 ;
337 saux1 << NumeZone << " " << x6 ;
338 saux2 = saux1.str() ;
339 if ( ZoneType == 61 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
340 else { saux += "ZoRaRayo " + saux2 + "\n" ; }
342 if ( ZoneType == 61 )
343 { std::stringstream saux1 ;
344 saux1 << NumeZone << " " << x8 ;
345 saux2 = saux1.str() ;
346 saux += "ZoRaRayI " + saux2 + "\n" ;
349 else if ( ZoneType == 32 or ZoneType == 62 )
351 saux += "# Sphere\n" ;
352 { std::stringstream saux1 ;
353 saux1 << NumeZone << " " << x1 ;
354 saux2 = saux1.str() ;
355 saux += "ZoRaXCen " + saux2 + "\n" ;
357 { std::stringstream saux1 ;
358 saux1 << NumeZone << " " << x2 ;
359 saux2 = saux1.str() ;
360 saux += "ZoRaYCen " + saux2 + "\n" ;
362 { std::stringstream saux1 ;
363 saux1 << NumeZone << " " << x6 ;
364 saux2 = saux1.str() ;
365 if ( ZoneType == 62 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
366 else { saux += "ZoRaRayo " + saux2 + "\n" ; }
368 if ( ZoneType == 62 )
369 { std::stringstream saux1 ;
370 saux1 << NumeZone << " " << x8 ;
371 saux2 = saux1.str() ;
372 saux += "ZoRaRayI " + saux2 + "\n" ;
375 else if ( ZoneType == 33 or ZoneType == 63 )
377 saux += "# Sphere\n" ;
378 { std::stringstream saux1 ;
379 saux1 << NumeZone << " " << x0 ;
380 saux2 = saux1.str() ;
381 saux += "ZoRaXCen " + saux2 + "\n" ;
383 { std::stringstream saux1 ;
384 saux1 << NumeZone << " " << x2 ;
385 saux2 = saux1.str() ;
386 saux += "ZoRaYCen " + saux2 + "\n" ;
388 { std::stringstream saux1 ;
389 saux1 << NumeZone << " " << x6 ;
390 saux2 = saux1.str() ;
391 if ( ZoneType == 63 ) { saux += "ZoRaRayE " + saux2 + "\n" ; }
392 else { saux += "ZoRaRayo " + saux2 + "\n" ; }
394 if ( ZoneType == 63 )
395 { std::stringstream saux1 ;
396 saux1 << NumeZone << " " << x8 ;
397 saux2 = saux1.str() ;
398 saux += "ZoRaRayI " + saux2 + "\n" ;
404 else if ( ZoneType == 4 )
406 saux += "# Sphere\n" ;
407 { std::stringstream saux1 ;
408 saux1 << NumeZone << " " << x0 ;
409 saux2 = saux1.str() ;
410 saux += "ZoRaXCen " + saux2 + "\n" ;
412 { std::stringstream saux1 ;
413 saux1 << NumeZone << " " << x1 ;
414 saux2 = saux1.str() ;
415 saux += "ZoRaYCen " + saux2 + "\n" ;
417 { std::stringstream saux1 ;
418 saux1 << NumeZone << " " << x2 ;
419 saux2 = saux1.str() ;
420 saux += "ZoRaZCen " + saux2 + "\n" ;
422 { std::stringstream saux1 ;
423 saux1 << NumeZone << " " << x3 ;
424 saux2 = saux1.str() ;
425 saux += "ZoRaRayo " + saux2 + "\n" ;
429 // Cas du cylindre ou du tuyau
431 else if ( ZoneType == 5 or ZoneType == 7 )
433 if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; }
434 else { saux += "# Tuyau\n" ; }
435 { std::stringstream saux1 ;
436 saux1 << NumeZone << " " << x0 ;
437 saux2 = saux1.str() ;
438 saux += "ZoRaXBas " + saux2 + "\n" ;
440 { std::stringstream saux1 ;
441 saux1 << NumeZone << " " << x1 ;
442 saux2 = saux1.str() ;
443 saux += "ZoRaYBas " + saux2 + "\n" ;
445 { std::stringstream saux1 ;
446 saux1 << NumeZone << " " << x2 ;
447 saux2 = saux1.str() ;
448 saux += "ZoRaZBas " + saux2 + "\n" ;
450 { std::stringstream saux1 ;
451 saux1 << NumeZone << " " << x3 ;
452 saux2 = saux1.str() ;
453 saux += "ZoRaXAxe " + saux2 + "\n" ;
455 { std::stringstream saux1 ;
456 saux1 << NumeZone << " " << x4 ;
457 saux2 = saux1.str() ;
458 saux += "ZoRaYAxe " + saux2 + "\n" ;
460 { std::stringstream saux1 ;
461 saux1 << NumeZone << " " << x5 ;
462 saux2 = saux1.str() ;
463 saux += "ZoRaZAxe " + saux2 + "\n" ;
465 { std::stringstream saux1 ;
466 saux1 << NumeZone << " " << x6 ;
467 saux2 = saux1.str() ;
468 if ( ZoneType == 5 ) { saux += "ZoRaRayo " + saux2 + "\n" ; }
469 else { saux += "ZoRaRayE " + saux2 + "\n" ; }
471 { std::stringstream saux1 ;
472 saux1 << NumeZone << " " << x7 ;
473 saux2 = saux1.str() ;
474 saux += "ZoRaHaut " + saux2 + "\n" ;
477 { std::stringstream saux1 ;
478 saux1 << NumeZone << " " << x8 ;
479 saux2 = saux1.str() ;
480 saux += "ZoRaRayI " + saux2 + "\n" ;
484 _Texte += saux + "#\n" ;
486 // MESSAGE("A la fin de HomardDriver::TexteZone, _Texte ="<<_Texte);
489 ////=============================================================================
490 void HomardDriver::TexteField( const std::string FieldName, const std::string FieldFile, int TimeStep, int Rank,
491 int TypeThR, double ThreshR, int TypeThC, double ThreshC,
492 int UsField, int UsCmpI )
494 MESSAGE("Dans TexteField, FieldName = "<<FieldName<<", FieldFile = "<<FieldFile);
495 MESSAGE("Dans TexteField, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
497 std::string saux, saux2 ;
500 _Texte += "# Champ d'indicateurs\n" ;
501 _Texte += "CCIndica " + FieldFile + "\n" ;
502 _Texte += "CCNoChaI \"" + FieldName + "\"\n" ;
504 // Cas ou on prend le dernier pas de temps
505 if ( TimeStep == -2 )
506 { _Texte += "CCNumPTI Last\n" ; }
507 // Cas avec pas de temps
508 else if ( TimeStep >= 0 )
511 std::stringstream saux1 ;
513 saux2 = saux1.str() ;
514 _Texte += "CCNumPTI " + saux2 + "\n" ;
517 std::stringstream saux1 ;
519 saux2 = saux1.str() ;
520 _Texte += "CCNumOrI " + saux2 + "\n" ;
533 std::stringstream saux1 ;
535 saux2 = saux1.str() ;
536 _Texte += "Seuil" + saux + " " + saux2 + "\n" ;
548 std::stringstream saux1 ;
550 saux2 = saux1.str() ;
551 _Texte += "Seuil" + saux + " " + saux2 + "\n" ;
556 { saux = "MAILLE" ; }
561 _Texte += "CCModeFI " + saux + "\n" ;
568 { saux = "INFINI" ; }
570 { saux = "V_RELATIVE" ; }
573 _Texte += "CCUsCmpI " + saux + "\n" ;
577 ////=============================================================================
578 void HomardDriver::TexteGroup( const std::string GroupName )
580 MESSAGE("Dans TexteGroup, GroupName = "<<GroupName);
582 _Texte += "CCGroAda " + GroupName + "\n" ;
585 ////=============================================================================
586 void HomardDriver::TexteBoundaryOption( int BoundaryOption )
588 MESSAGE("Dans TexteBoundaryOption, BoundaryOption = "<<BoundaryOption);
590 // Type de suivi de frontiere
592 std::stringstream saux1 ;
593 saux1 << BoundaryOption ;
594 std::string saux = saux1.str() ;
595 _Texte += "SuivFron " + saux + "\n" ;
598 ////=============================================================================
599 void HomardDriver::TexteBoundaryDi( const std::string MeshName, const std::string MeshFile )
601 MESSAGE("Dans TexteBoundaryDi, MeshName = "<<MeshName);
602 MESSAGE("Dans TexteBoundaryDi, MeshFile = "<<MeshFile);
604 _Texte += "CCNoMFro " + MeshName + "\n" ;
605 _Texte += "CCFronti " + MeshFile + "\n" ;
608 ////=============================================================================
609 void HomardDriver::TexteBoundaryDiGr( const std::string GroupName )
611 MESSAGE("Dans TexteBoundaryDiGr, GroupName = "<<GroupName);
613 _Texte += "CCGroFro " + GroupName + "\n" ;
616 ////=============================================================================
617 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 )
619 MESSAGE("Dans TexteBoundaryAn, NameBoundary = "<<NameBoundary);
620 // MESSAGE("Dans TexteBoundaryAn, NumeBoundary = "<<NumeBoundary);
621 MESSAGE("Dans TexteBoundaryAn, BoundaryType = "<<BoundaryType);
622 // MESSAGE("Dans TexteBoundaryAn, coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6);
624 std::string saux, saux2 ;
628 std::stringstream saux1 ;
629 saux1 << NumeBoundary ;
630 saux2 = saux1.str() ;
631 saux = "#\n# Frontiere numero " + saux2 + "\n" ;
632 if ( BoundaryType == 1 )
633 { saux += "# Cylindre\n" ; }
634 if ( BoundaryType == 2 )
635 { saux += "# Sphere\n" ; }
637 // Le nom de la frontiere
639 { std::stringstream saux1 ;
640 saux1 << NumeBoundary ;
641 saux2 = saux1.str() ;
642 saux += "FANom " + saux2 + " '" + NameBoundary + "'\n" ;
647 { std::stringstream saux1 ;
648 saux1 << NumeBoundary << " " << BoundaryType ;
649 saux2 = saux1.str() ;
650 saux += "FAType " + saux2 + "\n" ;
655 if ( BoundaryType == 1 )
657 { std::stringstream saux1 ;
658 saux1 << NumeBoundary << " " << x0 ;
659 saux2 = saux1.str() ;
660 saux += "FAXCen " + saux2 + "\n" ;
662 { std::stringstream saux1 ;
663 saux1 << NumeBoundary << " " << x1 ;
664 saux2 = saux1.str() ;
665 saux += "FAYCen " + saux2 + "\n" ;
667 { std::stringstream saux1 ;
668 saux1 << NumeBoundary << " " << x2 ;
669 saux2 = saux1.str() ;
670 saux += "FAZCen " + saux2 + "\n" ;
672 { std::stringstream saux1 ;
673 saux1 << NumeBoundary << " " << x3 ;
674 saux2 = saux1.str() ;
675 saux += "FAXAxe " + saux2 + "\n" ;
677 { std::stringstream saux1 ;
678 saux1 << NumeBoundary << " " << x4 ;
679 saux2 = saux1.str() ;
680 saux += "FAYAxe " + saux2 + "\n" ;
682 { std::stringstream saux1 ;
683 saux1 << NumeBoundary << " " << x5 ;
684 saux2 = saux1.str() ;
685 saux += "FAZAxe " + saux2 + "\n" ;
687 { std::stringstream saux1 ;
688 saux1 << NumeBoundary << " " << x6 ;
689 saux2 = saux1.str() ;
690 saux += "FARayon " + saux2 + "\n" ;
696 else if ( BoundaryType == 2 )
698 { std::stringstream saux1 ;
699 saux1 << NumeBoundary << " " << x0 ;
700 saux2 = saux1.str() ;
701 saux += "FAXCen " + saux2 + "\n" ;
703 { std::stringstream saux1 ;
704 saux1 << NumeBoundary << " " << x1 ;
705 saux2 = saux1.str() ;
706 saux += "FAYCen " + saux2 + "\n" ;
708 { std::stringstream saux1 ;
709 saux1 << NumeBoundary << " " << x2 ;
710 saux2 = saux1.str() ;
711 saux += "FAZCen " + saux2 + "\n" ;
713 { std::stringstream saux1 ;
714 saux1 << NumeBoundary << " " << x3 ;
715 saux2 = saux1.str() ;
716 saux += "FARayon " + saux2 + "\n" ;
720 _Texte += saux + "#\n" ;
723 ////=============================================================================
724 void HomardDriver::TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName )
726 MESSAGE("Dans TexteBoundaryAnGr, NameBoundary = "<<NameBoundary);
727 // MESSAGE("Dans TexteBoundaryAnGr, NumeBoundary = "<<NumeBoundary);
728 // MESSAGE("Dans TexteBoundaryAnGr, GroupName = "<<GroupName);
732 std::string saux, saux2 ;
733 std::stringstream saux1 ;
734 saux1 << NumeBoundary ;
735 saux2 = saux1.str() ;
736 saux = "#\n# Lien Frontiere/Groupe numero " + saux2 + "\n" ;
738 saux += "FGNomFro " + saux2 + " '" + NameBoundary + "'\n" ;
739 saux += "FGNomGro " + saux2 + " '" + GroupName + "'\n" ;
741 _Texte += saux + "#\n" ;
744 ////=============================================================================
745 void HomardDriver::TexteFieldInterp( int TypeFieldInterp, const std::string FieldFile, const std::string MeshFile, int TimeStep, int Rank )
747 MESSAGE("Dans TexteFieldInterp, TypeFieldInterp = "<<TypeFieldInterp);
748 MESSAGE("Dans TexteFieldInterp, FieldFile = "<<FieldFile<<", MeshFile = "<<MeshFile);
749 MESSAGE("Dans TexteFieldInterp, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
751 // Type d'interpolation
753 _Texte += "# Interpolations des champs\n" ;
754 _Texte += "CCSolN__ " + FieldFile + "\n" ;
755 _Texte += "CCSolNP1 " + MeshFile + "\n" ;
756 if ( TypeFieldInterp == 1 )
758 _Texte += "CCChaTou oui\n" ;
761 _TimeStep = TimeStep ;
764 // std::cerr << "A la fin de TexteFieldInterp _Texte ="<<_Texte << std::endl;
766 ////=============================================================================
767 void HomardDriver::TexteFieldInterpName( int NumeChamp, const std::string FieldName)
769 MESSAGE("Dans TexteFieldInterpName, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName);
770 std::stringstream saux1 ;
771 saux1 << NumeChamp+1 ;
772 std::string saux = saux1.str() ;
773 _Texte +="CCChaNom " + saux + " \"" + FieldName + "\"\n" ;
775 MESSAGE("TexteFieldInterpName, _TimeStep = "<<_TimeStep<<", _Rank = "<<_Rank);
776 if ( _TimeStep >= 0 )
779 std::stringstream saux1 ;
781 std::string saux2 = saux1.str() ;
782 _Texte += "CCChaPdT " + saux + " " + saux2 + "\n" ;
785 std::stringstream saux1 ;
787 std::string saux2 = saux1.str() ;
788 _Texte += "CCChaNuO " + saux + " " + saux2 + "\n" ;
792 ////=============================================================================
793 void HomardDriver::TexteAdvanced( int NivMax, double DiamMin)
795 MESSAGE("Dans TexteAdvanced, NivMax ="<<NivMax<<", DiamMin ="<<DiamMin);
798 _Texte += "# Niveaux extremes\n" ;
799 { std::stringstream saux1 ;
801 std::string saux2 = saux1.str() ;
802 _Texte += "NiveauMa " + saux2 + "\n" ;
805 std::stringstream saux1 ;
807 std::string saux2 = saux1.str() ;
808 _Texte += "DiametMi " + saux2 + "\n" ;
812 ////=============================================================================
813 void HomardDriver::CreeFichier( )
816 _NomFichierConf = _NomFichierConfBase + "." + _siter + ".vers." + _siterp1 ;
818 std::ofstream FicConf(_NomFichierConf.c_str(), std::ios::out ) ;
819 if (FicConf.is_open() == true)
821 FicConf << _Texte << std::endl ;
827 ////=============================================================================
828 int HomardDriver::ExecuteHomard()
830 // Copie des Fichiers HOMARD
831 std::string commande= "cp " + _NomFichierConf + " " + _NomFichierConfBase ;
832 system(commande.c_str());
834 MESSAGE("ExecuteHomard");
835 int codret = system(_HOMARD_Exec.c_str()) ;
838 // GERALD -- QMESSAGE BOX
839 MESSAGE ( "Erreur en executant HOMARD : " << codret );
840 // ASSERT("Erreur en executant HOMARD" == 0);