1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : CalculatorEngine.cxx
23 // Author : Laurent DADA, CEA
24 // Module : CalculatorComponent
32 #include "CalculatorEngine.hxx"
33 #include "MEDMEM_Support_i.hxx"
34 #include "SUPPORTClient.hxx"
36 #include "MEDMEM_define.hxx"
37 #include "MEDMEM_STRING.hxx"
38 #include "MEDMEM_Exception.hxx"
39 #include "MEDMEM_Unit.hxx"
43 #include "utilities.h"
45 using namespace MEDMEM;
48 #ifndef MED_TAILLE_PNOM
49 #define MED_TAILLE_PNOM MED_TAILLE_PNOM21
52 typedef FIELD<double,MEDMEM::FullInterlace> TFieldDouble;
53 typedef FIELDTEMPLATE_I<double,MEDMEM::FullInterlace> TFieldDouble_i;
55 //================================================================================
56 // static PrintFieldValues - shows field contents
57 //================================================================================
59 static void PrintFieldValues (TFieldDouble * field, int until_index)
61 const double * values = field -> getValue();
62 int nb_comp = field -> getNumberOfComponents();
63 MESSAGE( "Field : " << field -> getName() );
64 MESSAGE( " Description : " << field -> getDescription() );
65 MESSAGE( " Number of components : " << nb_comp );
67 for (int i=0 ; i<nb_comp ; i++) {
68 MESSAGE ( " Component " << field -> getComponentName(i+1) << endl \
69 << " Unit : " << field -> getMEDComponentUnit(i+1) << endl \
70 << " Description : " << field -> getComponentDescription(i+1) );
72 MESSAGE( " First " << until_index << " values : " );
74 for (int j=0 ; j < until_index ; j++) {
75 for (int i=0;i<nb_comp;i++) MESSAGE( values[i+j*nb_comp] << " " );
80 //================================================================================
82 //================================================================================
84 CalculatorEngine::CalculatorEngine(CORBA::ORB_ptr orb,
85 PortableServer::POA_ptr poa,
86 PortableServer::ObjectId * contId,
87 const char *instanceName,
88 const char *interfaceName) :
89 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true)
91 MESSAGE("CalculatorEngine::CalculatorEngine activate object instanceName("
92 << instanceName << ") interfaceName(" << interfaceName << ")" )
94 _id = _poa->activate_object(_thisObj);
95 SALOME_NamingService *NS = new SALOME_NamingService(orb);
99 CalculatorEngine::CalculatorEngine()
103 //================================================================================
105 //================================================================================
107 CalculatorEngine::~CalculatorEngine()
112 static omni_mutex aPutToStudyMutex;
113 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::PutToStudy(SALOME_MED::FIELDDOUBLE_ptr theField1,
114 CORBA::Long theStudyId) {
115 omni_mutex_lock aLock(aPutToStudyMutex);
117 CORBA::Object_var anObj = _NS->Resolve("/myStudyManager");
118 SALOMEDS::StudyManager_var aManager = SALOMEDS::StudyManager::_narrow(anObj);
119 // SALOMEDS::ListOfOpenStudies_var aList = aManager->GetOpenStudies();
120 // SALOMEDS::Study_var aStudy = aManager->GetStudyByName(aList[0]);
121 SALOMEDS::Study_var aStudy = aManager->GetStudyByID(theStudyId);
122 SALOMEDS::StudyBuilder_var aBuilder = aStudy->NewBuilder();
124 SALOMEDS::SComponent_var aComponent = aStudy->FindComponent("Calculator");
125 if (aComponent->_is_nil()) aComponent = aBuilder->NewComponent("Calculator");
126 SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
127 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
128 aName->SetValue("Calculator");
130 SALOMEDS::SObject_var aSO = aBuilder->NewObject(aComponent);
131 anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName");
132 aName = SALOMEDS::AttributeName::_narrow(anAttr);
134 sprintf(aFieldName, "Field_%d", (int)aSO->Tag());
135 aName->SetValue(strdup(aFieldName));
137 ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
138 ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
139 CORBA::ORB_var &orb = init(0,0);
141 string iorStr = orb->object_to_string(theField1);
142 anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeIOR");
143 SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
144 anIOR->SetValue(iorStr.c_str());
146 return SALOME_MED::FIELDDOUBLE::_duplicate(theField1);
150 //=======================================================================================
151 // Addition of 2 FieldNodeDouble (based on Med library)
155 // - number of components
156 // - name, type, unit and description of components
157 // are the same for the 2 fields.
160 // the result will be a copy of the first field.
162 //=======================================================================================
164 static omni_mutex anAddMutex;
165 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,
166 SALOME_MED::FIELDDOUBLE_ptr SecondField)
168 omni_mutex_lock aLock(anAddMutex);
171 bool same_support = true;
173 beginService("CalculatorEngine::Add");
175 sendMessage(NOTIF_TRACE, "CalculatorEngine::Add is Computing");
177 BEGIN_OF("CalculatorEngine::Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,SALOME_MED::FIELDDOUBLE_ptr SecondField)");
182 CORBA::String_var field1_name = FirstField -> getName();
183 CORBA::String_var field2_name = SecondField -> getName();
184 CORBA::String_var field_description = FirstField -> getDescription();
186 string message = string("\n CalculatorEngine::Add : ") +
187 string("\n first field name --> ") + string(field1_name.in()) +
188 string("\n second field name --> ") + string(field2_name.in());
190 sendMessage(NOTIF_TRACE, message.c_str());
192 // Number of components
193 int nb_comp1 = FirstField -> getNumberOfComponents();
194 int nb_comp2 = SecondField -> getNumberOfComponents();
195 if (nb_comp1 != nb_comp2) same_support = false;
196 MESSAGE( " nb_comp1 --> " << nb_comp1 <<endl );
197 MESSAGE( " nb_comp2 --> " << nb_comp2 <<endl );
200 /* Name Description and Unit of each component of the field */
202 string * component_name = new string[nb_comp1];
203 string * component_unit = new string[nb_comp1];
205 for (int i=0 ; i<nb_comp1 ; i++) {
206 CORBA::String_var name = FirstField -> getComponentName(i+1);
207 CORBA::String_var unit = FirstField -> getComponentUnit(i+1);
208 component_name[i].assign(name.in());
209 component_unit[i].assign(unit.in());
212 CORBA::String_var name2 = SecondField -> getComponentName(i+1);
213 CORBA::String_var unit2 = SecondField -> getComponentUnit(i+1);
214 if ( (component_name[i] != name2.in()) || (component_unit[i] != unit2.in()))
215 same_support = false;
219 MESSAGE("CalculatorEngine::Add Number of entities in the Support of each fields");
221 // Number of entities in the Support of the field
225 SALOME_MED::SUPPORT_var support1 = FirstField -> getSupport();
226 SALOME_MED::SUPPORT_var support2 = SecondField -> getSupport();
232 SALOME_MED::MESH_var mesh1 = support1 -> getMesh();
233 SALOME_MED::MESH_var mesh2 = support2 -> getMesh();
238 if (same_support && support1 != support2) same_support = false;
240 if (support1 -> isOnAllElements())
241 len_value1 = mesh1-> getNumberOfElements(support1 -> getEntity(),SALOME_MED::MED_ALL_ELEMENTS);
243 len_value1 = support1 -> getNumberOfElements(SALOME_MED::MED_ALL_ELEMENTS);
247 if (support2 -> isOnAllElements())
248 len_value2 = mesh2-> getNumberOfElements(support2 -> getEntity(),SALOME_MED::MED_ALL_ELEMENTS);
250 len_value2 = support2 -> getNumberOfElements(SALOME_MED::MED_ALL_ELEMENTS);
252 if (same_support && len_value1 != len_value2) same_support = false;
256 // Values of new field
257 SALOME_MED::double_array * first_value = FirstField -> getValue(SALOME_MED::MED_FULL_INTERLACE);
258 SALOME_MED::double_array * second_value;
260 second_value = SecondField -> getValue(SALOME_MED::MED_FULL_INTERLACE);
261 tmp << "\n CalculatorEngine::Add : " ;
262 tmp << "\n Number of entities in the Support of first field = " << len_value1 ;
263 tmp << "\n Number of entities in the Support of second field = " << len_value2 ;
266 sendMessage(NOTIF_TRACE, message.c_str());
270 int totalLength = nb_comp1*len_value1;
271 double * new_value = new double[totalLength];
274 sendMessage(NOTIF_TRACE, "CalculatorEngine::Add - field1 and field2 have the same support");
276 for(int i=0 ; i<totalLength ; i++)
277 new_value[i] = ((*first_value)[i]) + ((*second_value)[i]);
280 for(int i=0 ; i<totalLength ; i++)
281 new_value[i] = ((*first_value)[i]) ;
284 // Creation of a Local Field
286 MESSAGE("CalculatorEngine::Add Creation of the local field "<< totalLength);
288 TFieldDouble * fieldloc = new TFieldDouble();
289 fieldloc -> allocValue(nb_comp1,len_value1);
290 fieldloc -> setValue(new_value);
291 fieldloc -> setName("-new_Add-");
292 fieldloc -> setDescription( field_description.in() );
293 fieldloc -> setComponentsNames(component_name);
294 fieldloc -> setMEDComponentsUnits(component_unit);
300 delete [] component_name;
301 delete [] component_unit;
307 int until_index = ( 20 > len_value1)? len_value1 : 20;
308 PrintFieldValues (fieldloc,until_index);
310 sendMessage(NOTIF_TRACE, "CalculatorEngine::Add - new field created");
313 // Creation of the new CORBA field
315 MESSAGE("CalculatorEngine::Add Creation of the CORBA field");
317 SUPPORT *support1Clt=new SUPPORTClient(support1);
318 fieldloc->setSupport(support1Clt);
319 support1Clt->removeReference();
321 TFieldDouble_i * NewField = new TFieldDouble_i(fieldloc,true) ;
322 SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = NewField->_this() ;
326 END_OF("CalculatorEngine::Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,SALOME_MED::FIELDDOUBLE_ptr SecondField)");
328 endService("CalculatorEngine::Add");
334 //===============================================================================
335 // Multiplication of a FieldNodeDouble by a double value (based on Med library)
336 //===============================================================================
338 static omni_mutex aMulMutex;
339 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,
342 omni_mutex_lock aLock(aMulMutex);
344 beginService("CalculatorEngine::Mul");
345 BEGIN_OF("CalculatorEngine::Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,CORBA::Double x1)");
350 // Name and description of field
351 CORBA::String_var field_name = OldField -> getName();
352 CORBA::String_var field_description = OldField -> getDescription();
354 // Number of components
355 int nb_comp = OldField -> getNumberOfComponents();
356 string * component_name = new string[nb_comp];
357 string * component_unit = new string[nb_comp];
359 for (int i=0 ; i<nb_comp ; i++) {
360 CORBA::String_var name = OldField -> getComponentName(i+1);
361 component_name[i] = name.in();
362 CORBA::String_var unit = OldField -> getComponentUnit(i+1);
363 component_unit[i] = unit.in();
366 MESSAGE("CalculatorEngine::Mul Number of entities in the Support of the field");
368 // Number of entities in the Support of the field
371 SALOME_MED::SUPPORT_var support = OldField -> getSupport();
375 SALOME_MED::MESH_var mesh = support -> getMesh();
379 if (support -> isOnAllElements())
380 len_value = mesh-> getNumberOfElements(support -> getEntity(),SALOME_MED::MED_ALL_ELEMENTS);
382 len_value = support -> getNumberOfElements(SALOME_MED::MED_ALL_ELEMENTS);
386 // Values of new field
387 SALOME_MED::double_array * old_value = OldField -> getValue(SALOME_MED::MED_FULL_INTERLACE);
389 int totalLength = nb_comp*len_value;
390 double * new_value = new double[totalLength];
391 for(int i=0 ; i<totalLength ; i++) {
392 new_value[i] = x1 * ((*old_value)[i]);
395 // Creation of a Local Field
397 MESSAGE("CalculatorEngine::Mul Creation of the local field "<< totalLength);
399 TFieldDouble * fieldloc = new TFieldDouble();
400 fieldloc -> allocValue(nb_comp,len_value);
401 fieldloc -> setValue(new_value);
402 fieldloc -> setName("-new_Mul-");
403 fieldloc -> setDescription(field_description.in());
404 fieldloc -> setComponentsNames(component_name);
405 fieldloc -> setMEDComponentsUnits(component_unit);
409 delete [] component_name;
410 delete [] component_unit;
413 // Creation of the new CORBA field
415 MESSAGE("CalculatorEngine::Mul Creation of the CORBA field");
417 SUPPORT *supportClt=new SUPPORTClient(support);
418 fieldloc->setSupport(supportClt);
419 supportClt->removeReference();
420 TFieldDouble_i * NewField = new TFieldDouble_i(fieldloc,true) ;
421 SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = NewField->_this() ;
425 END_OF("CalculatorEngine::Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,CORBA::Double x1)");
427 endService("CalculatorEngine::Mul");
432 //================================================================================
433 // Build a constant field of double based on first field support (Med library)
434 //================================================================================
436 static omni_mutex aConstantMutex;
437 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,
440 omni_mutex_lock aLock(aConstantMutex);
442 beginService("CalculatorEngine::Const");
443 BEGIN_OF("CalculatorEngine::Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,CORBA::Double x1)");
445 // Name and description of field
446 CORBA::String_var field_name = FirstField -> getName();
447 CORBA::String_var field_description = FirstField -> getDescription();
449 SALOME_MED::SUPPORT_var FirstSupport = FirstField -> getSupport();
451 // Number of components
452 int nb_comp = FirstField -> getNumberOfComponents();
454 // Type, name, unit and description of components
455 string * component_name = new string[nb_comp];
456 string * component_unit = new string[nb_comp];
458 for (int i = 0 ; i<nb_comp ; i++) {
459 CORBA::String_var name = FirstField -> getComponentName(i+1);
460 component_name[i] = name.in();
461 CORBA::String_var unit = FirstField -> getComponentUnit(i+1);
462 component_unit[i] = unit.in();
465 MESSAGE("CalculatorEngine::Constant Number of entities in the Support of the field");
467 // Number of entities in the Support of the field
470 SCRUTE(FirstSupport);
472 SALOME_MED::MESH_var mesh = FirstSupport -> getMesh();
476 if ( FirstSupport -> isOnAllElements() )
477 len_value = mesh -> getNumberOfElements(FirstSupport -> getEntity(),SALOME_MED::MED_ALL_ELEMENTS);
479 len_value = FirstSupport -> getNumberOfElements(SALOME_MED::MED_ALL_ELEMENTS);
481 // Values of new field
482 int totalLength = nb_comp*len_value;
483 double * new_value = new double[totalLength];
485 for(int i=0 ; i<totalLength ; i++)
489 // Creation of a Local Field
491 MESSAGE("CalculatorEngine::Constant Creation of the local field "<< totalLength);
493 TFieldDouble * fieldloc = new TFieldDouble();
494 fieldloc -> allocValue(nb_comp,len_value);
495 fieldloc -> setValue(new_value);
496 fieldloc -> setName("-new_Const_Field-");
497 fieldloc -> setDescription(field_description.in());
498 fieldloc -> setComponentsNames(component_name);
499 fieldloc -> setMEDComponentsUnits(component_unit);
502 delete [] component_name;
503 delete [] component_unit;
507 int until_index = ( 20 > len_value)? len_value : 20 ;
508 PrintFieldValues (fieldloc,until_index);
510 // Creation of the new CORBA field
512 MESSAGE("CalculatorEngine::Constant Creation of the CORBA field");
514 SUPPORT *supportClt=new SUPPORTClient(FirstSupport);
515 fieldloc->setSupport(supportClt);
516 supportClt->removeReference();
517 TFieldDouble_i * NewField = new TFieldDouble_i(fieldloc,true) ;
519 SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = NewField->_this() ;
523 endService("CalculatorEngine::Const");
525 END_OF("CalculatorEngine::Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,CORBA::Double x1)");
531 //================================================================================
532 // write a field in a MED file
533 //================================================================================
535 static omni_mutex aWriteMEDfileMutex;
536 void CalculatorEngine::writeMEDfile(SALOME_MED::FIELDDOUBLE_ptr field, const char *filename)
538 omni_mutex_lock aLock(aWriteMEDfileMutex);
540 beginService("CalculatorEngine::writeMEDfile");
541 MESSAGE("fichier d'impression du champ resultat:"<<filename);
543 // get support of the field
545 SALOME_MED::SUPPORT_ptr support = field -> getSupport();
547 // get mesh from this support
549 SALOME_MED::MESH_ptr mesh = support -> getMesh();
553 int index_m = mesh->addDriver(SALOME_MED::MED_DRIVER,filename,mesh->getName());
555 mesh -> write(index_m,"");
559 const char * LOC = "CalculatorEngine::writeMEDfile ";
561 MESSAGE("fichier :"<<filename);
563 med_2_1::med_idt _medIdt = med_2_1::MEDouvrir(const_cast <char *> (filename) , med_2_1::MED_ECRI);
566 if (_medIdt<0) return;
570 int component_count= field->getNumberOfComponents();
571 string component_name(component_count*MED_TAILLE_PNOM,' ') ;
572 string component_unit(component_count*MED_TAILLE_PNOM,' ') ;
574 for (int i=0; i < component_count ; i++) {
575 component_name.replace(i*MED_TAILLE_PNOM,MED_TAILLE_PNOM,(field -> getComponentName(i+1)),0,MED_TAILLE_PNOM);
576 component_unit.replace(i*MED_TAILLE_PNOM,MED_TAILLE_PNOM,(field -> getComponentUnit(i+1)),0,MED_TAILLE_PNOM);
579 MESSAGE("component_name=|"<<component_name<<"|");
580 MESSAGE("component_unit=|"<<component_unit<<"|");
582 // already existing ?
584 char * champName = new char[MED_TAILLE_NOM+1] ;
585 char * compName, * compUnit ;
588 int n = med_2_1::MEDnChamp(_medIdt,0);
591 med_2_1::med_type_champ type ;
593 for (int i = 1; i <= n; i++)
595 nbComp = med_2_1::MEDnChamp(_medIdt,i);
596 compName = new char[MED_TAILLE_PNOM*nbComp+1];
597 compUnit = new char[MED_TAILLE_PNOM*nbComp+1];
599 err = med_2_1::MEDchampInfo(_medIdt,i,champName,&type,compName,compUnit,nbComp);
601 if (strcmp(champName, field->getName())==0) { // Found !
612 if (nbComp != component_count)
613 throw MEDEXCEPTION ( LOCALIZED (STRING(LOC)
614 <<": Field exist in file, but number of component are different : " \
615 <<nbComp<<" in file and "<<component_count<<" in CORBA object."
618 // component name and unit
619 MESSAGE(LOC<<" Component name in file : "<<compName);
620 MESSAGE(LOC<<" Component name in CORBA object : "<<component_name);
621 MESSAGE(LOC<<" Component unit in file : "<<compUnit);
622 MESSAGE(LOC<<" Component unit in CORBA object : "<<component_unit);
627 // Verify the field doesn't exist
629 string dataGroupName = "/CHA/"+ string(field->getName());
631 MESSAGE(LOC << "|" << dataGroupName << "|" );
633 med_2_1::med_idt gid = H5Gopen(_medIdt, dataGroupName.c_str() );
637 err=med_2_1::MEDchampCr(_medIdt,
638 const_cast <char*> (field->getName()),
640 const_cast <char*> ( component_name.c_str() ),
641 const_cast <char*> ( component_unit.c_str() ),
644 throw MEDEXCEPTION( LOCALIZED (STRING(LOC)
645 << ": Error MEDchampCr : "<<err
652 SALOME_MED::SUPPORT_ptr mySupport = field -> getSupport();
655 if (! mySupport->isOnAllElements())
656 throw MEDEXCEPTION ( LOCALIZED (STRING(LOC)
657 <<": Field must be on all entity"
661 SALOME_MED::MESH_ptr myMesh = mySupport -> getMesh();
664 SALOME_MED::medGeometryElement_array* Types = mySupport->getTypes() ;
666 int NumberOfType = Types->length() ;
668 for ( int i = 0; i < NumberOfType; i++ )
670 int NumberOfElements = mySupport->getNumberOfElements ( (*Types)[i] ) ;
671 //Temporarily commented to avoid compilation errors:int NumberOfGaussPoint = mySupport->getNumberOfGaussPoint ( (*Types)[i] ) ;
672 int NumberOfGaussPoint = 1; //Temporary line instead of the above one
674 MESSAGE( " " << field->getName() );
675 MESSAGE( " " << NumberOfElements );
676 //!!!tmp commented:MESSAGE( " " << NumberOfGaussPoint );
677 MESSAGE( "Attention! NumberOfGaussPoint is invalid: " << NumberOfGaussPoint ); //tmp line!!!
678 MESSAGE( " " << (int) (convertIdlEntToMedEnt(mySupport->getEntity())) );
679 MESSAGE( " " << (int)(convertIdlEltToMedElt((*Types)[i])) );
680 MESSAGE( " " << field->getIterationNumber() );
681 MESSAGE( " " << field->getTime() );
682 MESSAGE( " " << field->getOrderNumber() );
683 MESSAGE( "MEDchampEcr :" << myMesh->getName() );
685 SALOME_MED::double_array * value = field->getValue( SALOME_MED::MED_FULL_INTERLACE ) ;
686 double *locvalue = new double[NumberOfElements];
687 for (int k = 0; k < NumberOfElements; k++)
688 locvalue[k] = (*value) [k];
690 err=med_2_1::MEDchampEcr(_medIdt,
691 const_cast <char*> (myMesh->getName()) ,
692 const_cast <char*> (field->getName()),
693 (unsigned char*)locvalue,
694 med_2_1::MED_FULL_INTERLACE,
700 (med_2_1::med_entite_maillage)convertIdlEntToMedEnt(mySupport->getEntity()),
701 (med_2_1::med_geometrie_element)(convertIdlEltToMedElt((*Types)[i])),
702 field->getIterationNumber(),
705 field->getOrderNumber()
709 if (err < MED_VALID )
710 throw MEDEXCEPTION(LOCALIZED( STRING(LOC)
711 <<": Error in writing Field "<< field->getName() <<", type "<<(*Types)[i]
718 if (err < 0 ) return ;
720 med_2_1::MEDfermer(_medIdt) ;
722 endService("CalculatorEngine::writeMEDfile");
729 //===========================================================================
730 // CalculatorEngine_factory
731 //===========================================================================
732 PortableServer::ObjectId * CalculatorEngine_factory
734 PortableServer::POA_ptr poa,
735 PortableServer::ObjectId * contId,
736 const char *instanceName,
737 const char *interfaceName)
739 MESSAGE("CalculatorEngine_factory CalculatorEngine ("
740 << instanceName << "," << interfaceName << ")");
741 CalculatorEngine * myCalculator
742 = new CalculatorEngine(orb, poa, contId, instanceName, interfaceName);
743 return myCalculator->getId() ;