1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : CalculatorEngine.cxx
24 // Author : Laurent DADA, CEA
25 // Module : CalculatorComponent
33 #include "CalculatorEngine.hxx"
34 #include "MEDMEM_Support_i.hxx"
35 #include "SUPPORTClient.hxx"
37 #include "MEDMEM_define.hxx"
38 #include "MEDMEM_STRING.hxx"
39 #include "MEDMEM_Exception.hxx"
40 #include "MEDMEM_Unit.hxx"
42 #include "utilities.h"
44 using namespace MEDMEM;
47 #ifndef MED_TAILLE_PNOM
48 #define MED_TAILLE_PNOM MED_SNAME_SIZE
51 typedef FIELD<double,MEDMEM::FullInterlace> TFieldDouble;
52 typedef FIELDTEMPLATE_I<double,MEDMEM::FullInterlace> TFieldDouble_i;
54 //================================================================================
55 // static PrintFieldValues - shows field contents
56 //================================================================================
58 static void PrintFieldValues (TFieldDouble * field, int until_index)
60 const double * values = field -> getValue();
61 int nb_comp = field -> getNumberOfComponents();
62 MESSAGE( "Field : " << field -> getName() );
63 MESSAGE( " Description : " << field -> getDescription() );
64 MESSAGE( " Number of components : " << nb_comp );
66 for (int i=0 ; i<nb_comp ; i++) {
67 MESSAGE ( " Component " << field -> getComponentName(i+1) << endl \
68 << " Unit : " << field -> getMEDComponentUnit(i+1) << endl \
69 << " Description : " << field -> getComponentDescription(i+1) );
71 MESSAGE( " First " << until_index << " values : " );
73 for (int j=0 ; j < until_index ; j++) {
74 for (int i=0;i<nb_comp;i++) MESSAGE( values[i+j*nb_comp] << " " );
79 //================================================================================
81 //================================================================================
83 CalculatorEngine::CalculatorEngine(CORBA::ORB_ptr orb,
84 PortableServer::POA_ptr poa,
85 PortableServer::ObjectId * contId,
86 const char *instanceName,
87 const char *interfaceName) :
88 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true)
90 MESSAGE("CalculatorEngine::CalculatorEngine activate object instanceName("
91 << instanceName << ") interfaceName(" << interfaceName << ")" )
93 _id = _poa->activate_object(_thisObj);
94 SALOME_NamingService *NS = new SALOME_NamingService(orb);
98 CalculatorEngine::CalculatorEngine()
102 //================================================================================
104 //================================================================================
106 CalculatorEngine::~CalculatorEngine()
111 static omni_mutex aPutToStudyMutex;
112 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::PutToStudy(SALOME_MED::FIELDDOUBLE_ptr theField1,
113 CORBA::Long theStudyId) {
114 omni_mutex_lock aLock(aPutToStudyMutex);
116 CORBA::Object_var anObj = _NS->Resolve("/myStudyManager");
117 SALOMEDS::StudyManager_var aManager = SALOMEDS::StudyManager::_narrow(anObj);
118 // SALOMEDS::ListOfOpenStudies_var aList = aManager->GetOpenStudies();
119 // SALOMEDS::Study_var aStudy = aManager->GetStudyByName(aList[0]);
120 SALOMEDS::Study_var aStudy = aManager->GetStudyByID(theStudyId);
121 SALOMEDS::StudyBuilder_var aBuilder = aStudy->NewBuilder();
123 SALOMEDS::SComponent_var aComponent = aStudy->FindComponent("Calculator");
124 if (aComponent->_is_nil()) aComponent = aBuilder->NewComponent("Calculator");
125 SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
126 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
127 aName->SetValue("Calculator");
129 SALOMEDS::SObject_var aSO = aBuilder->NewObject(aComponent);
130 anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName");
131 aName = SALOMEDS::AttributeName::_narrow(anAttr);
133 sprintf(aFieldName, "Field_%d", (int)aSO->Tag());
134 aName->SetValue(strdup(aFieldName));
136 ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
137 ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
138 CORBA::ORB_var &orb = init(0,0);
140 string iorStr = orb->object_to_string(theField1);
141 anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeIOR");
142 SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
143 anIOR->SetValue(iorStr.c_str());
145 return SALOME_MED::FIELDDOUBLE::_duplicate(theField1);
149 //=======================================================================================
150 // Addition of 2 FieldNodeDouble (based on Med library)
154 // - number of components
155 // - name, type, unit and description of components
156 // are the same for the 2 fields.
159 // the result will be a copy of the first field.
161 //=======================================================================================
163 static omni_mutex anAddMutex;
164 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,
165 SALOME_MED::FIELDDOUBLE_ptr SecondField)
167 omni_mutex_lock aLock(anAddMutex);
170 bool same_support = true;
172 beginService("CalculatorEngine::Add");
174 sendMessage(NOTIF_TRACE, "CalculatorEngine::Add is Computing");
176 const char* LOC = "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::GMESH_var mesh1 = support1 -> getMesh();
233 SALOME_MED::GMESH_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_TYPES::ListOfDouble * first_value = FirstField -> getValue(SALOME_MED::MED_FULL_INTERLACE);
258 SALOME_TYPES::ListOfDouble * 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;
304 support2->UnRegister();
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() ;
328 endService("CalculatorEngine::Add");
333 //===============================================================================
334 // Multiplication of a FieldNodeDouble by a double value (based on Med library)
335 //===============================================================================
337 static omni_mutex aMulMutex;
338 SALOME_MED::FIELDDOUBLE_ptr CalculatorEngine::Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,
341 omni_mutex_lock aLock(aMulMutex);
343 beginService("CalculatorEngine::Mul");
344 const char* LOC = "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::GMESH_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_TYPES::ListOfDouble * 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() ;
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 const char* LOC = "CalculatorEngine::Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,CORBA::Double x1)";
446 // Name and description of field
447 CORBA::String_var field_name = FirstField -> getName();
448 CORBA::String_var field_description = FirstField -> getDescription();
450 SALOME_MED::SUPPORT_var FirstSupport = FirstField -> getSupport();
452 // Number of components
453 int nb_comp = FirstField -> getNumberOfComponents();
455 // Type, name, unit and description of components
456 string * component_name = new string[nb_comp];
457 string * component_unit = new string[nb_comp];
459 for (int i = 0 ; i<nb_comp ; i++) {
460 CORBA::String_var name = FirstField -> getComponentName(i+1);
461 component_name[i] = name.in();
462 CORBA::String_var unit = FirstField -> getComponentUnit(i+1);
463 component_unit[i] = unit.in();
466 MESSAGE("CalculatorEngine::Constant Number of entities in the Support of the field");
468 // Number of entities in the Support of the field
471 SCRUTE(FirstSupport);
473 SALOME_MED::GMESH_var mesh = FirstSupport -> getMesh();
477 if ( FirstSupport -> isOnAllElements() )
478 len_value = mesh -> getNumberOfElements(FirstSupport -> getEntity(),SALOME_MED::MED_ALL_ELEMENTS);
480 len_value = FirstSupport -> getNumberOfElements(SALOME_MED::MED_ALL_ELEMENTS);
482 // Values of new field
483 int totalLength = nb_comp*len_value;
484 double * new_value = new double[totalLength];
486 for(int i=0 ; i<totalLength ; i++)
490 // Creation of a Local Field
492 MESSAGE("CalculatorEngine::Constant Creation of the local field "<< totalLength);
494 TFieldDouble * fieldloc = new TFieldDouble();
495 fieldloc -> allocValue(nb_comp,len_value);
496 fieldloc -> setValue(new_value);
497 fieldloc -> setName("-new_Const_Field-");
498 fieldloc -> setDescription(field_description.in());
499 fieldloc -> setComponentsNames(component_name);
500 fieldloc -> setMEDComponentsUnits(component_unit);
503 delete [] component_name;
504 delete [] component_unit;
508 int until_index = ( 20 > len_value)? len_value : 20 ;
509 PrintFieldValues (fieldloc,until_index);
511 // Creation of the new CORBA field
513 MESSAGE("CalculatorEngine::Constant Creation of the CORBA field");
515 SUPPORT *supportClt=new SUPPORTClient(FirstSupport);
516 fieldloc->setSupport(supportClt);
517 supportClt->removeReference();
518 TFieldDouble_i * NewField = new TFieldDouble_i(fieldloc,true) ;
520 SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = NewField->_this() ;
524 endService("CalculatorEngine::Const");
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 const char * LOC = "CalculatorEngine::writeMEDfile ";
542 beginService("CalculatorEngine::writeMEDfile");
544 MESSAGE("fichier d'impression du champ resultat:"<<filename);
546 // get support of the field
548 SALOME_MED::SUPPORT_ptr support = field -> getSupport();
550 // get mesh from this support
552 SALOME_MED::GMESH_ptr mesh = support -> getMesh();
556 int index_m = mesh->addDriver(SALOME_MED::MED_DRIVER,filename,mesh->getName());
558 mesh -> write(index_m,"");
562 MESSAGE("fichier :"<<filename);
564 med_2_3::med_idt _medIdt = med_2_3::MEDfileOpen(const_cast <char *> (filename) , med_2_3::MED_ACC_RDWR);
567 if (_medIdt<0) return;
571 int component_count= field->getNumberOfComponents();
572 string component_name(component_count*MED_TAILLE_PNOM,' ') ;
573 string component_unit(component_count*MED_TAILLE_PNOM,' ') ;
575 for (int i=0; i < component_count ; i++) {
576 component_name.replace(i*MED_TAILLE_PNOM,MED_TAILLE_PNOM,(field -> getComponentName(i+1)),0,MED_TAILLE_PNOM);
577 component_unit.replace(i*MED_TAILLE_PNOM,MED_TAILLE_PNOM,(field -> getComponentUnit(i+1)),0,MED_TAILLE_PNOM);
580 MESSAGE("component_name=|"<<component_name<<"|");
581 MESSAGE("component_unit=|"<<component_unit<<"|");
583 // already existing ?
585 char * champName = new char[MED_NAME_SIZE+1] ;
586 char * meshName = new char[MED_NAME_SIZE+1] ;
587 char * compDtunit = new char[MED_SNAME_SIZE+1];
588 char * compName, * compUnit;
591 int n = med_2_3::MEDnField(_medIdt);
593 med_2_3::med_int nbComp ;
594 med_2_3::med_field_type type ;
595 med_2_3::med_bool _local;
597 for (int i = 1; i <= n; i++)
599 nbComp = med_2_3::MEDnField(_medIdt);
600 compName = new char[MED_TAILLE_PNOM*nbComp+1];
601 compUnit = new char[MED_TAILLE_PNOM*nbComp+1];
603 err = med_2_3::MEDfieldInfo(_medIdt,i,champName,meshName,&_local,&type,compName,compUnit,compDtunit,&nbComp);
605 if (strcmp(champName, field->getName())==0) { // Found !
618 if (nbComp != component_count)
619 throw MEDEXCEPTION ( LOCALIZED (STRING(LOC)
620 <<": Field exist in file, but number of component are different : " \
621 <<nbComp<<" in file and "<<component_count<<" in CORBA object."
625 // component name and unit
626 MESSAGE(LOC<<" Component name in file : "<<compName);
627 MESSAGE(LOC<<" Component name in CORBA object : "<<component_name);
628 MESSAGE(LOC<<" Component unit in file : "<<compUnit);
629 MESSAGE(LOC<<" Component unit in CORBA object : "<<component_unit);
636 // Verify the field doesn't exist
637 string dataGroupName = "/CHA/"+ string(field->getName());
639 MESSAGE(LOC << "|" << dataGroupName << "|" );
641 med_2_3::med_idt gid = H5Gopen(_medIdt, dataGroupName.c_str() );
646 err=med_2_3::MEDfieldCr(_medIdt,
647 const_cast <char*> (field->getName()),
648 med_2_3::MED_FLOAT64,
650 const_cast <char*> ( component_name.c_str() ),
651 const_cast <char*> ( component_unit.c_str() ),
655 throw MEDEXCEPTION( LOCALIZED (STRING(LOC) << ": Error MEDfieldCr : "<<err ));
661 SALOME_MED::SUPPORT_ptr mySupport = field -> getSupport();
664 if (! mySupport->isOnAllElements())
665 throw MEDEXCEPTION ( LOCALIZED (STRING(LOC)
666 <<": Field must be on all entity"
669 SALOME_MED::MESH_ptr myMesh = mySupport -> getMesh()->convertInMESH();
672 SALOME_MED::medGeometryElement_array* Types = mySupport->getTypes() ;
674 int NumberOfType = Types->length() ;
676 for ( int i = 0; i < NumberOfType; i++ )
678 int NumberOfElements = mySupport->getNumberOfElements ( (*Types)[i] ) ;
679 //Temporarily commented to avoid compilation errors:int NumberOfGaussPoint = mySupport->getNumberOfGaussPoint ( (*Types)[i] ) ;
680 int NumberOfGaussPoint = 1; //Temporary line instead of the above one
682 MESSAGE( " " << field->getName() );
683 MESSAGE( " " << NumberOfElements );
684 //!!!tmp commented:MESSAGE( " " << NumberOfGaussPoint );
685 MESSAGE( "Attention! NumberOfGaussPoint is invalid: " << NumberOfGaussPoint ); //tmp line!!!
686 MESSAGE( " " << (int) (convertIdlEntToMedEnt(mySupport->getEntity())) );
687 MESSAGE( " " << (int)(convertIdlEltToMedElt((*Types)[i])) );
688 MESSAGE( " " << field->getIterationNumber() );
689 MESSAGE( " " << field->getTime() );
690 MESSAGE( " " << field->getOrderNumber() );
691 MESSAGE( "MEDchampEcr :" << myMesh->getName() );
693 SALOME_TYPES::ListOfDouble * value = field->getValue( SALOME_MED::MED_FULL_INTERLACE ) ;
694 double *locvalue = new double[NumberOfElements];
695 for (int k = 0; k < NumberOfElements; k++)
696 locvalue[k] = (*value) [k];
698 err=med_2_3::MEDfieldValueWithProfileWr(_medIdt,
699 const_cast <char*> (field->getName()),
703 (med_2_3::med_entity_type)convertIdlEntToMedEnt(mySupport->getEntity()),
704 (med_2_3::med_geometry_type)(convertIdlEltToMedElt((*Types)[i])),
705 med_2_3::MED_COMPACT_PFLMODE,
706 MED_ALLENTITIES_PROFILE,
708 med_2_3::MED_FULL_INTERLACE,
709 SALOME_MED::MED_ALL_ELEMENTS,
711 (unsigned char*)locvalue
716 if (err < MED_VALID )
717 throw MEDEXCEPTION(LOCALIZED( STRING(LOC)
718 <<": Error in writing Field "<< field->getName() <<", type "<<(*Types)[i]
725 if (err < 0 ) return;
727 med_2_3::MEDfileClose(_medIdt);
729 endService("CalculatorEngine::writeMEDfile");
735 //===========================================================================
736 // CalculatorEngine_factory
737 //===========================================================================
738 PortableServer::ObjectId * CalculatorEngine_factory
740 PortableServer::POA_ptr poa,
741 PortableServer::ObjectId * contId,
742 const char *instanceName,
743 const char *interfaceName)
745 MESSAGE("CalculatorEngine_factory CalculatorEngine ("
746 << instanceName << "," << interfaceName << ")");
747 CalculatorEngine * myCalculator
748 = new CalculatorEngine(orb, poa, contId, instanceName, interfaceName);
749 return myCalculator->getId() ;