1 // HOMARD HOMARD : implementation of HOMARD idl descriptions
3 // Copyright (C) 2011-2013 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
21 // File : HOMARD_YACS.cxx
22 // Author : Paul RASCLE, EDF
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
32 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
34 #include "HOMARD_YACS.hxx"
35 #include "utilities.h"
37 //=============================================================================
39 * default constructor:
41 //=============================================================================
42 HOMARD_YACS::HOMARD_YACS():
49 MESSAGE("HOMARD_YACS");
51 //=============================================================================
55 //=============================================================================
56 HOMARD_YACS::~HOMARD_YACS()
58 MESSAGE("~HOMARD_YACS");
60 //=============================================================================
61 //=============================================================================
63 //=============================================================================
64 //=============================================================================
65 void HOMARD_YACS::SetName( const char* Name )
67 _Name = std::string( Name );
69 //=============================================================================
70 std::string HOMARD_YACS::GetName() const
74 //=============================================================================
75 std::string HOMARD_YACS::GetDumpPython() const
77 MESSAGE (". Ecriture du schema " << _Name );
78 std::ostringstream aScript;
79 aScript << "\n# Creation of the schema " << _Name << "\n";
81 aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n";
83 aScript << "\t" << _Name << ".SetType(" << _Type << ")\n";
84 // Les controles de convergences
85 if ( _MaxIter > 0 ) { aScript << "\t" << _Name << ".SetMaxIter(" << _MaxIter << ")\n"; }
86 if ( _MaxNode > 0 ) { aScript << "\t" << _Name << ".SetMaxNode(" << _MaxNode << ")\n"; }
87 if ( _MaxElem > 0 ) { aScript << "\t" << _Name << ".SetMaxElem(" << _MaxElem << ")\n"; }
89 // L'ecriture du schema
90 aScript << "\tcodret = " << _Name << ".Write()\n";
92 MESSAGE (". Fin de l ecriture du schema " << _Name );
96 //=============================================================================
97 //=============================================================================
99 //=============================================================================
100 //=============================================================================
101 void HOMARD_YACS::SetType( int Type )
105 //=============================================================================
106 int HOMARD_YACS::GetType() const
110 //=============================================================================
111 void HOMARD_YACS::SetMaxIter( int MaxIter )
115 //=============================================================================
116 int HOMARD_YACS::GetMaxIter() const
120 //=============================================================================
121 void HOMARD_YACS::SetMaxNode( int MaxNode )
125 //=============================================================================
126 int HOMARD_YACS::GetMaxNode() const
130 //=============================================================================
131 void HOMARD_YACS::SetMaxElem( int MaxElem )
135 //=============================================================================
136 int HOMARD_YACS::GetMaxElem() const
140 //=============================================================================
141 void HOMARD_YACS::SetDirName( const char* NomDir )
143 _NomDir = std::string( NomDir );
145 //=============================================================================
146 std::string HOMARD_YACS::GetDirName() const
150 //=============================================================================
151 void HOMARD_YACS::SetMeshFile( const char* MeshFile )
153 _MeshFile = std::string( MeshFile );
155 //=============================================================================
156 std::string HOMARD_YACS::GetMeshFile() const
160 //=============================================================================
161 void HOMARD_YACS::SetScriptFile( const char* ScriptFile )
163 _ScriptFile = std::string( ScriptFile );
165 //=============================================================================
166 std::string HOMARD_YACS::GetScriptFile() const
170 //=============================================================================
171 void HOMARD_YACS::SetXMLFile( const char* XMLFile )
173 _XMLFile = std::string( XMLFile );
175 //=============================================================================
176 std::string HOMARD_YACS::GetXMLFile() const
180 //=============================================================================
181 //=============================================================================
182 // Liens avec les autres structures
183 //=============================================================================
184 //=============================================================================
185 void HOMARD_YACS::SetCaseName( const char* NomCas )
187 _NomCas = std::string( NomCas );
189 //=============================================================================
190 std::string HOMARD_YACS::GetCaseName() const
194 //=============================================================================
195 //=============================================================================
197 //=============================================================================
198 //=============================================================================