X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD_I%2FHOMARD_Iteration_i.cxx;h=544e5a54db406a51fafa048dd690d7c30f0efd6c;hb=6689e7dd2f2883516d5f57833bc94dfeb1ccaa44;hp=222dd663695f9c40b76d8917a64fb706428ce7cd;hpb=b93f68e791d9a197c7130c94d2e317b1ebcd7220;p=modules%2Fhomard.git diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index 222dd663..544e5a54 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2011-2012 CEA/DEN, EDF R&D +// Copyright (C) 2011-2024 CEA, EDF // // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,6 +16,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // Remarques : // L'ordre de description des fonctions est le meme dans tous les fichiers // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : @@ -45,7 +46,6 @@ HOMARD_Iteration_i::HOMARD_Iteration_i() MESSAGE( "Default constructor, not for use" ); ASSERT( 0 ); } - //============================================================================= /*! * standard constructor @@ -60,7 +60,6 @@ HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb, myHomardIteration = new ::HOMARD_Iteration(); ASSERT( myHomardIteration ); } - //============================================================================= /*! * standard destructor @@ -86,12 +85,12 @@ char* HOMARD_Iteration_i::GetName() return CORBA::string_dup( myHomardIteration->GetName().c_str() ); } //============================================================================= -CORBA::Long HOMARD_Iteration_i::Delete() +CORBA::Long HOMARD_Iteration_i::Delete( CORBA::Long Option ) { ASSERT( myHomardIteration ); char* IterName = GetName() ; - MESSAGE ( "Delete : destruction de l'iteration " << IterName ); - return _gen_i->DeleteIteration(IterName) ; + MESSAGE ( "Delete : destruction de l'iteration " << IterName << ", Option = " << Option ); + return _gen_i->DeleteIteration(IterName, Option) ; } //============================================================================= char* HOMARD_Iteration_i::GetDumpPython() @@ -114,16 +113,26 @@ bool HOMARD_Iteration_i::Restore( const std::string& stream ) // Caracteristiques //============================================================================= //============================================================================= -void HOMARD_Iteration_i::SetDirName( const char* NomDir ) +void HOMARD_Iteration_i::SetDirNameLoc( const char* NomDir ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetDirNameLoc( NomDir ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetDirNameLoc() { ASSERT( myHomardIteration ); - myHomardIteration->SetDirName( NomDir ); + return CORBA::string_dup( myHomardIteration->GetDirNameLoc().c_str() ); } //============================================================================= char* HOMARD_Iteration_i::GetDirName() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetDirName().c_str() ); + std::string casename = myHomardIteration->GetCaseName() ; + HOMARD::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; + std::string dirnamecase = caseiter->GetDirName() ; + std::string dirname = dirnamecase + "/" + GetDirNameLoc() ; + return CORBA::string_dup( dirname.c_str() ); } //============================================================================= void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) @@ -135,19 +144,19 @@ void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) CORBA::Long HOMARD_Iteration_i::GetNumber() { ASSERT( myHomardIteration ); - return myHomardIteration->GetNumber() ; + return myHomardIteration->GetNumber() ; } //============================================================================= -void HOMARD_Iteration_i::SetEtat( CORBA::Boolean Etat ) +void HOMARD_Iteration_i::SetState( CORBA::Long Etat ) { ASSERT( myHomardIteration ); - myHomardIteration->SetEtat( Etat ); + myHomardIteration->SetState( Etat ); } //============================================================================= -CORBA::Boolean HOMARD_Iteration_i::GetEtat() +CORBA::Long HOMARD_Iteration_i::GetState() { ASSERT( myHomardIteration ); - return CORBA::Boolean( myHomardIteration->GetEtat()); + return myHomardIteration->GetState() ; } //============================================================================= void HOMARD_Iteration_i::SetMeshName( const char* NomMesh ) @@ -186,6 +195,14 @@ char* HOMARD_Iteration_i::GetFieldFile() return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() ); } //============================================================================= +// Instants pour le champ de pilotage +//============================================================================= +void HOMARD_Iteration_i::SetTimeStep( CORBA::Long TimeStep ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetTimeStep( TimeStep ); +} +//============================================================================= void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ) { ASSERT( myHomardIteration ); @@ -210,6 +227,60 @@ CORBA::Long HOMARD_Iteration_i::GetRank() return CORBA::Long( myHomardIteration->GetRank() ); } //============================================================================= +// Instants pour un champ a interpoler +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ) +{ + SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ); +} +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetFieldInterpTimeStepRank( FieldInterp, TimeStep, Rank ); +} +//============================================================================= +HOMARD::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank() +{ + ASSERT( myHomardIteration ); + const std::list& ListString = myHomardIteration->GetFieldInterpsTimeStepRank(); + HOMARD::listeFieldInterpTSRsIter_var aResult = new HOMARD::listeFieldInterpTSRsIter; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterp( const char* FieldInterp ) +{ + myHomardIteration->SetFieldInterp( FieldInterp ); +} +//============================================================================= +HOMARD::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps() +{ + ASSERT( myHomardIteration ); + const std::list& ListString = myHomardIteration->GetFieldInterps(); + HOMARD::listeFieldInterpsIter_var aResult = new HOMARD::listeFieldInterpsIter; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Iteration_i::SupprFieldInterps() +{ + ASSERT( myHomardIteration ); + myHomardIteration->SupprFieldInterps(); +} +//============================================================================= void HOMARD_Iteration_i::SetLogFile( const char* LogFile ) { ASSERT( myHomardIteration ); @@ -222,17 +293,17 @@ char* HOMARD_Iteration_i::GetLogFile() return CORBA::string_dup( myHomardIteration->GetLogFile().c_str() ); } //============================================================================= -CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage) +CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage, CORBA::Long Option) { - MESSAGE ( "Compute : calcul d'une iteration" ); + MESSAGE ( "Compute : calcul d'une iteration, etatMenage = "<Compute(IterName, etatMenage, modeHOMARD, Option) ; + return _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option1, Option) ; } //============================================================================= void HOMARD_Iteration_i::MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) @@ -261,7 +332,8 @@ void HOMARD_Iteration_i::MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORB if ( Tail != 0 ) { modeHOMARD = modeHOMARD*13 ; } if ( Inte != 0 ) { modeHOMARD = modeHOMARD*3 ; } MESSAGE ( "MeshInfoOption : information sur le maillage de l'iteration " << IterName ); - CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option) ; + CORBA::Long Option2 = 1 ; + CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option, Option2) ; MESSAGE ( "MeshInfoOption : codret = " << codret ); // return ; @@ -375,3 +447,19 @@ char* HOMARD_Iteration_i::GetHypoName() ASSERT( myHomardIteration ); return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); } +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetInfoCompute( CORBA::Long MessInfo ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetInfoCompute( MessInfo ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetInfoCompute() +{ + ASSERT( myHomardIteration ); + return myHomardIteration->GetInfoCompute() ; +}