X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD%2FHomardDriver.cxx;h=51bf17654466445af381a8fc741e410228328b2c;hb=eebf1b13bb80de547e7e45e391b3e05a351505b1;hp=da93013337f220e83b85efdc2cf01566ca6df0b9;hpb=2e13824c952ed9fccfc420822f983bc88f8a5b2d;p=modules%2Fhomard.git diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index da930133..51bf1765 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -1,3 +1,24 @@ +// HOMARD HOMARD : implementaion of HOMARD idl descriptions +// +// Copyright (C) 2011 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include #include #include @@ -18,15 +39,15 @@ HomardDriver::HomardDriver(const std::string siter, const std::string siterp1): std::string dir; std::string executable; if ( !(dirchar = getenv("HOMARD_REP_EXE")) ) - dir = "/logiciels/HOMARD/HOMARD_PUBLIC/Linux64" ; + dir = "/local00/HOMARD_SVN/trunk/bin" ; else dir = std::string(dirchar); if ( !(execchar = getenv("HOMARD_EXE")) ) - executable = "HOMARD"; + executable = "HOMARD.out"; else executable = std::string(execchar); _HOMARD_Exec = dir + "/" + executable ; - MESSAGE("Dans HomardDriver::HomardDriver, _HOMARD_Exec ="<<_HOMARD_Exec); + MESSAGE("Dans HomardDriver, _HOMARD_Exec ="<<_HOMARD_Exec); // _siter = siter ; _siterp1 = siterp1 ; @@ -41,7 +62,7 @@ HomardDriver::~HomardDriver() ////============================================================================= void HomardDriver::TexteInit( const std::string DirCompute, const std::string DirComputePa, const std::string MessFile ) { - MESSAGE("Dans HomardDriver::TexteInit, MessFile ="<= 11 and ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; } + else if ( ZoneType >= 31 and ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; } + else if ( ZoneType >= 61 and ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; } + else { ZoneTypeHOMARD = ZoneType ; } // std::stringstream saux1 ; saux1 << NumeZone ; @@ -169,14 +196,94 @@ void HomardDriver::TexteZone( int NumeZone, int ZoneType, double x0, double x1, saux = "#\n# Zone numero " + saux2 + "\n" ; // { std::stringstream saux1 ; - saux1 << NumeZone << " " << ZoneType ; + saux1 << NumeZone << " " << ZoneTypeHOMARD ; saux2 = saux1.str() ; saux += "ZoRaType " + saux2 + "\n" ; } // -// Cas du rectangle/parallelepipede +// Cas du rectangle +// + if ( ZoneType == 11 ) // Z est constant X Homard <=> X Salome +// Y Homard <=> Y Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux2 = saux1.str() ; + saux += "ZoRaXmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux2 = saux1.str() ; + saux += "ZoRaXmax " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux2 = saux1.str() ; + saux += "ZoRaYmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux2 = saux1.str() ; + saux += "ZoRaYmax " + saux2 + "\n" ; + } + } +// + else if ( ZoneType == 12 ) // X est constant X Homard <=> Y Salome +// Y Homard <=> Z Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux2 = saux1.str() ; + saux += "ZoRaXmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux2 = saux1.str() ; + saux += "ZoRaXmax " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux2 = saux1.str() ; + saux += "ZoRaYmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux2 = saux1.str() ; + saux += "ZoRaYmax " + saux2 + "\n" ; + } + } +// + else if ( ZoneType == 13 ) // Y est constant X Homard <=> X Salome +// Y Homard <=> Z Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux2 = saux1.str() ; + saux += "ZoRaXmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux2 = saux1.str() ; + saux += "ZoRaXmax " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux2 = saux1.str() ; + saux += "ZoRaYmin " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux2 = saux1.str() ; + saux += "ZoRaYmax " + saux2 + "\n" ; + } + } +// +// Cas du parallelepipede // - if ( ZoneType == 2 ) + else if ( ZoneType == 2 ) { saux += "# Boite\n" ; { std::stringstream saux1 ; @@ -211,7 +318,88 @@ void HomardDriver::TexteZone( int NumeZone, int ZoneType, double x0, double x1, } } // -// Cas du cercle/sphere +// Cas du disque +// + else if ( ZoneType == 31 or ZoneType == 61 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux2 = saux1.str() ; + saux += "ZoRaXCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux2 = saux1.str() ; + saux += "ZoRaYCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 61 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 61 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux2 = saux1.str() ; + saux += "ZoRaRayI " + saux2 + "\n" ; + } + } + else if ( ZoneType == 32 or ZoneType == 62 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux2 = saux1.str() ; + saux += "ZoRaXCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux2 = saux1.str() ; + saux += "ZoRaYCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 62 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 62 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux2 = saux1.str() ; + saux += "ZoRaRayI " + saux2 + "\n" ; + } + } + else if ( ZoneType == 33 or ZoneType == 63 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux2 = saux1.str() ; + saux += "ZoRaXCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux2 = saux1.str() ; + saux += "ZoRaYCen " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 63 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 63 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux2 = saux1.str() ; + saux += "ZoRaRayI " + saux2 + "\n" ; + } + } +// +// Cas de la sphere // else if ( ZoneType == 4 ) { @@ -237,6 +425,61 @@ void HomardDriver::TexteZone( int NumeZone, int ZoneType, double x0, double x1, saux += "ZoRaRayo " + saux2 + "\n" ; } } +// +// Cas du cylindre ou du tuyau +// + else if ( ZoneType == 5 or ZoneType == 7 ) + { + if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; } + else { saux += "# Tuyau\n" ; } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux2 = saux1.str() ; + saux += "ZoRaXBas " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux2 = saux1.str() ; + saux += "ZoRaYBas " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux2 = saux1.str() ; + saux += "ZoRaZBas " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux2 = saux1.str() ; + saux += "ZoRaXAxe " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux2 = saux1.str() ; + saux += "ZoRaYAxe " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux2 = saux1.str() ; + saux += "ZoRaZAxe " + saux2 + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 5 ) { saux += "ZoRaRayo " + saux2 + "\n" ; } + else { saux += "ZoRaRayE " + saux2 + "\n" ; } + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x7 ; + saux2 = saux1.str() ; + saux += "ZoRaHaut " + saux2 + "\n" ; + } + if ( ZoneType == 7 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux2 = saux1.str() ; + saux += "ZoRaRayI " + saux2 + "\n" ; + } + } // _Texte += saux + "#\n" ; // @@ -245,10 +488,11 @@ void HomardDriver::TexteZone( int NumeZone, int ZoneType, double x0, double x1, ////============================================================================= void HomardDriver::TexteField( const std::string FieldName, const std::string FieldFile, int TimeStep, int Rank, - int TypeThR, double ThreshR, int TypeThC, double ThreshC, int UsCmpI ) + int TypeThR, double ThreshR, int TypeThC, double ThreshC, + int UsField, int UsCmpI ) { - MESSAGE("Dans HomardDriver::TexteField, FieldName = "< 0 ) _Texte += "CCGroFro " + GroupName + "\n" ; // } ////============================================================================= -void HomardDriver::TexteBoundaryAn( int NumeBoundary, int BoundaryType, const std::string Group, double x0, double x1, double x2, double x3, double x4, double x5, double x6 ) +void HomardDriver::TexteBoundaryDiGr( const std::string GroupName ) { - MESSAGE("Dans HomardDriver::TexteBoundaryAn, NumeBoundary = "<