-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// 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
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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 "MEDMEM_Compatibility21_22.hxx"
#include "MEDMEM_MedMedDriver21.hxx"
MED_MED_DRIVER21::~MED_MED_DRIVER21()
{
- MESSAGE("MED_MED_DRIVER21::~MED_MED_DRIVER21() has been destroyed");
+ MESSAGE_MED("MED_MED_DRIVER21::~MED_MED_DRIVER21() has been destroyed");
}
void MED_MED_DRIVER21::read()
{
const char * LOC ="MED_MED_DRIVER21::open() : ";
- BEGIN_OF(LOC);
+ BEGIN_OF_MED(LOC);
// REFLECHIR SUR CE TEST PAR RAPPORT A L'OUVERTURE/FERMETURE
// if ( _medIdt != MED_INVALID )
)
);
int accessMode = getMedAccessMode( _accessMode, MED_EN::V21 );
- MESSAGE(LOC<<"_fileName.c_str : "<< _fileName.c_str()<<",mode : "<< accessMode);
+ MESSAGE_MED(LOC<<"_fileName.c_str : "<< _fileName.c_str()<<",mode : "<< accessMode);
_medIdt = med_2_1::MEDouvrir( (const_cast <char *> (_fileName.c_str())), (med_2_1::med_mode_acces) accessMode);
- MESSAGE(LOC<<" _medIdt = "<<_medIdt);
+ MESSAGE_MED(LOC<<" _medIdt = "<<_medIdt);
if (_medIdt > 0)
_status=MED_OPENED;
);
}
- END_OF(LOC);
+ END_OF_MED(LOC);
}
void MED_MED_DRIVER21::close()
{
med_2_1::med_int err = 0;
- const char * LOC = "MED_MED_DRIVER21::close() : ";
+ const char* LOC = "MED_MED_DRIVER21::close() : ";
+ BEGIN_OF_MED(LOC);
// if ( _status == MED_CLOSED)
_status = MED_CLOSED;
_medIdt = MED_INVALID;
- END_OF(LOC);
+ END_OF_MED(LOC);
}
MED_MED_RDONLY_DRIVER21::MED_MED_RDONLY_DRIVER21()
{
+ this->GENDRIVER::_accessMode = MED_EN::RDONLY;
}
MED_MED_RDONLY_DRIVER21::MED_MED_RDONLY_DRIVER21(const string & fileName, MED * const ptrMed):
- IMED_MED_RDONLY_DRIVER(fileName,ptrMed),MED_MED_DRIVER21(fileName,ptrMed,MED_EN::MED_RDONLY),MED_MED_DRIVER(fileName,ptrMed,MED_EN::MED_RDONLY)
+ IMED_MED_RDONLY_DRIVER(fileName,ptrMed),
+ MED_MED_DRIVER21(fileName,ptrMed,MED_EN::RDONLY),
+ MED_MED_DRIVER(fileName,ptrMed,MED_EN::RDONLY)
{
- MESSAGE("MED_MED_RDONLY_DRIVER21::MED_MED_RDONLY_DRIVER21(const string & fileName, MED * const ptrMed) Constructeur read only");
+ MESSAGE_MED("MED_MED_RDONLY_DRIVER21::MED_MED_RDONLY_DRIVER21(const string & fileName, MED * const ptrMed) Constructeur read only");
}
MED_MED_RDONLY_DRIVER21::MED_MED_RDONLY_DRIVER21(const MED_MED_RDONLY_DRIVER21 & driver):
MED_MED_RDONLY_DRIVER21::~MED_MED_RDONLY_DRIVER21()
{
- MESSAGE("MED_MED_RDONLY_DRIVER21::~MED_MED_RDONLY_DRIVER21() has been destroyed");
+ MESSAGE_MED("MED_MED_RDONLY_DRIVER21::~MED_MED_RDONLY_DRIVER21() has been destroyed");
}
GENDRIVER * MED_MED_RDONLY_DRIVER21::copy(void) const
else
IMED_MED_RDONLY_DRIVER::_fileStructIsRead = true;
- BEGIN_OF(LOC);
+ BEGIN_OF_MED(LOC);
if ( _medIdt == MED_INVALID )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
numberOfMeshes = med_2_1::MEDnMaa(_medIdt) ;
if ( numberOfMeshes <= 0 )
- MESSAGE(LOC << "Be careful there is no mesh in file |"<<_fileName<<"| !");
+ MESSAGE_MED(LOC << "Be careful there is no mesh in file |"<<_fileName<<"| !");
MESH_ENTITIES::const_iterator currentEntity;
for (i=1;i<=numberOfMeshes;i++) {
<< i <<" of the file |" << _fileName << "| !"
)
);
- MESSAGE(LOC<<": Mesh n°"<<i<<" nammed "<<meshName);
+ MESSAGE_MED(LOC<<": Mesh n°"<<i<<" nammed "<<meshName);
if (isAGrid)
ptrMesh = new GRID((MED_EN::med_grid_type) type);
ptrDriver->setMeshName ( meshName );
ptrMesh->setDescription(meshDescription);
- SCRUTE(ptrDriver);
+ SCRUTE_MED(ptrDriver);
ptrMesh->addDriver(*ptrDriver);
delete ptrDriver ;
// add by B. Secher for filter module
ptrMesh->setMeshDimension(meshDim);
- SCRUTE(ptrMesh);
+ SCRUTE_MED(ptrMesh);
- MESSAGE(LOC<<"is" << (isAGrid ? "" : " NOT") << " a GRID and its name is "<<ptrMesh->getName());
+ MESSAGE_MED(LOC<<"is" << (isAGrid ? "" : " NOT") << " a GRID and its name is "<<ptrMesh->getName());
// we create all global support (for each entity type :
int index = 0;
mySupport->setEntity((MED_EN::medEntityMesh) (*currentEntity).first);
mySupport->setAll(true);
(_ptrMed->_support)[meshName][(MED_EN::medEntityMesh)(*currentEntity).first] = mySupport ;
- MESSAGE(LOC<< "The support " << supportName.c_str() << " on entity " << (*currentEntity).first << " is built");
+ MESSAGE_MED(LOC<< "The support " << supportName.c_str() << " on entity " << (*currentEntity).first << " is built");
index++;
}
- MESSAGE(LOC <<"The mesh " <<ptrMesh->getName() << " has " << index << " support(s)");
+ MESSAGE_MED(LOC <<"The mesh " <<ptrMesh->getName() << " has " << index << " support(s)");
}
map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator const_itSupportOnMesh ;
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++) index++;
}
- MESSAGE(LOC << "In this MED object there is(are) " << index << " support(s):");
+ MESSAGE_MED(LOC << "In this MED object there is(are) " << index << " support(s):");
vectSupp.resize(index);
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++)
{
vectSupp[index] = (*const_itSupport).second;
- SCRUTE(vectSupp[index]);
- MESSAGE(LOC << "Support number " << index << " is "<< *vectSupp[index]);
+ SCRUTE_MED(vectSupp[index]);
+ // comment the next line for PAL19767 Modification for icc and icpc (INTEL compilators)
+ //MESSAGE_MED(STRING(LOC) << "Support number " << index << " is "<< *vectSupp[index]));
index++;
}
}
numberOfFields = med_2_1::MEDnChamp(_medIdt,0) ;
if ( numberOfFields <= 0 )
- MESSAGE(LOC << "Be careful there is no field in file |"<<_fileName<<"| !");
+ MESSAGE_MED(LOC << "Be careful there is no field in file |"<<_fileName<<"| !");
for (i=1;i<=numberOfFields;i++) {
<< ": can't get information about the field n°"
<< i <<" of the file |" << _fileName << "| !"));
- MESSAGE(LOC << "Field n°"<<i<<" nammed "<< fieldName
+ MESSAGE_MED(LOC << "Field n°"<<i<<" nammed "<< fieldName
<< " ,component(s) : " << componentName
<<" ,unit(s) : " << unitName);
for (currentEntity=meshEntities.begin();currentEntity != meshEntities.end(); currentEntity++) {
// numberOfTimeSteps MUST be given by MEDchampInfo !!!!!
for (currentGeometry = (*currentEntity).second.begin();currentGeometry != (*currentEntity).second.end(); currentGeometry++) {
- MESSAGE("Field information with Entity,Geom = "<<(*currentEntity).first<<","<<(*currentGeometry));
+ MESSAGE_MED("Field information with Entity,Geom = "<<(*currentEntity).first<<","<<(*currentGeometry));
numberOfTimeSteps = MEDnPasdetemps(_medIdt, fieldName,
(med_2_1::med_entite_maillage)(*currentEntity).first,
(med_2_1::med_geometrie_element) (*currentGeometry) );
- MESSAGE("Field information 2 : NumberOfTimeStep :"<<numberOfTimeSteps);
+ MESSAGE_MED("Field information 2 : NumberOfTimeStep :"<<numberOfTimeSteps);
if ( numberOfTimeSteps > MED_VALID )
break ; // There are value for some med_geometrie_element of this med_entite_maillage.
}
for (currentGeometry = (*currentEntity).second.begin();currentGeometry != (*currentEntity).second.end(); currentGeometry++) {
- MESSAGE("Field information 3 : Geom : "<<(*currentGeometry));
+ MESSAGE_MED("Field information 3 : Geom : "<<(*currentGeometry));
for (j=1;j <= numberOfTimeSteps; j++) {
- MESSAGE("Field information 4 : time step j = "<<j);
+ MESSAGE_MED("Field information 4 : time step j = "<<j);
err = MEDpasdetempsInfo( _medIdt, fieldName,
(med_2_1::med_entite_maillage) (*currentEntity).first,
(med_2_1::med_geometrie_element) (*currentGeometry),j,
&orderNumber);
if (err == MED_VALID) { // we have found for (*currentEntity).first and (*currentGeometry)
- MESSAGE("Field information 5 ;: NumberOfGaussPoint : "<<NbOfGaussPts<<", timeStepNumber : "<<timeStepNumber);
+ MESSAGE_MED("Field information 5 ;: NumberOfGaussPoint : "<<NbOfGaussPts<<", timeStepNumber : "<<timeStepNumber);
// CORRECT a bug in MEDpasdetempsInfo :
// we get a value n'importe quoi in NbOfGaussPts !!!!
map<MESH_NAME_,MESH*>::iterator _meshesIt = _meshes.find(meshName);
if ( _meshesIt == _meshes.end() ) {
- MESSAGE(LOC << "There is no mesh |"
+ MESSAGE_MED(LOC << "There is no mesh |"
<< meshName <<"| in the file |"
<< _fileName <<"|, but |" << meshName <<"| is referenced by field |"
<< fieldName <<"|, entity : |"
<< entNames [(*currentEntity).first] <<"|, geometric element of type |"
<< geoNames [(*currentGeometry)] <<"|"
);
- } // POURQUOI SI JE NE MET PAS DE BLOCK J'AI UN PARSE ERROR : PG : c'est la macro MESSAGE qui fait ca !
+ } // POURQUOI SI JE NE MET PAS DE BLOCK J'AI UN PARSE ERROR : PG : c'est la macro MESSAGE_MED qui fait ca !
else
ptrMesh = _meshes[meshName];
((FIELD<int>*) ptrField)->setSupport(ptrSupport);
((FIELD<int>*) ptrField)->setNumberOfComponents(numberOfComponents);
((FIELD<int>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
- MESSAGE("#### SET NAME in FIELD : "<<fieldName);
+ MESSAGE_MED("#### SET NAME in FIELD : "<<fieldName);
MED_EN::med_mode_acces myMode = getAccessMode();
// switch (myMode) {
ptrDriver = DRIVERFACTORY::buildConcreteMedDriverForField<int>(_fileName, (FIELD<int> *)ptrField, myMode, V21);
- SCRUTE(ptrDriver);
+ SCRUTE_MED(ptrDriver);
break;
}
((FIELD<med_2_1::med_float>*) ptrField)->setSupport(ptrSupport);
((FIELD<med_2_1::med_float>*) ptrField)->setNumberOfComponents(numberOfComponents);
((FIELD<med_2_1::med_float>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
- MESSAGE("#### SET NAME in FIELD : "<<fieldName);
+ MESSAGE_MED("#### SET NAME in FIELD : "<<fieldName);
MED_EN::med_mode_acces myMode = getAccessMode();
// switch (myMode) {
// }
ptrDriver = DRIVERFACTORY::buildConcreteMedDriverForField<med_2_1::med_float>(_fileName, (FIELD<med_2_1::med_float> *)ptrField, myMode, V21);
- SCRUTE(ptrDriver);
+ SCRUTE_MED(ptrDriver);
break;
}
}
}
- MESSAGE("timeStepNumber :"<<timeStepNumber<<",orderNumber :"<<orderNumber);
+ MESSAGE_MED("timeStepNumber :"<<timeStepNumber<<",orderNumber :"<<orderNumber);
ptrField->setIterationNumber ( timeStepNumber); // A ajouter dans la classe FIELD
ptrField->setOrderNumber ( orderNumber);
ptrField->setTime ( timeStep);
// Create a driver for this (field n°dt,n°it)
ptrDriver->setId ( getId() );
- MESSAGE("###### ptrDriver->setFieldName : #"<<fieldName<<"#");
+ MESSAGE_MED("###### ptrDriver->setFieldName : #"<<fieldName<<"#");
ptrDriver->setFieldName(fieldName);
ptrField->addDriver(*ptrDriver);
// driver is duplicated : remove it
// il faut lire les champs pour avoir les profils stockes !!!
// il faudrait implémenter la lecture des profils dans med !!!
- END_OF(LOC);
+ END_OF_MED(LOC);
}
void MED_MED_RDONLY_DRIVER21::read( void )
throw (MEDEXCEPTION) // from objects method read !
{
- const char * LOC = "MED_MED_DRIVER21::read() : ";
-
- BEGIN_OF(LOC);
+ const char* LOC = "MED_MED_DRIVER21::read() : ";
+ BEGIN_OF_MED(LOC);
// For PAL12192: assure that file structure is already read
this->open();
(*currentField).first->read(*this);
//(*currentField).first->read(); // default reader, from readFileStruct
- END_OF(LOC);
+ END_OF_MED(LOC);
}
// ------------- Write Only Part --------------
MED_MED_WRONLY_DRIVER21::MED_MED_WRONLY_DRIVER21()
{
+ this->GENDRIVER::_accessMode = MED_EN::WRONLY;
}
MED_MED_WRONLY_DRIVER21::MED_MED_WRONLY_DRIVER21(const string & fileName, MED * const ptrMed):
- IMED_MED_WRONLY_DRIVER(fileName,ptrMed),MED_MED_DRIVER21(fileName,ptrMed),MED_MED_DRIVER(fileName,ptrMed,MED_EN::MED_WRONLY)
+ IMED_MED_WRONLY_DRIVER(fileName,ptrMed),
+ MED_MED_DRIVER21(fileName,ptrMed),
+ MED_MED_DRIVER(fileName,ptrMed,MED_EN::WRONLY)
{}
MED_MED_WRONLY_DRIVER21::MED_MED_WRONLY_DRIVER21(const MED_MED_WRONLY_DRIVER21 & driver):
MED_MED_WRONLY_DRIVER21::~MED_MED_WRONLY_DRIVER21()
{
- MESSAGE("MED_MED_WRONLY_DRIVER21::~MED_MED_WRONLY_DRIVER21() has been destroyed");
+ MESSAGE_MED("MED_MED_WRONLY_DRIVER21::~MED_MED_WRONLY_DRIVER21() has been destroyed");
}
GENDRIVER * MED_MED_WRONLY_DRIVER21::copy(void) const
void MED_MED_WRONLY_DRIVER21::writeFrom( void) const
throw (MEDEXCEPTION) //from object method write !
{
- const char * LOC = "MED_MED_DRIVER21::writeFrom() : ";
-
- BEGIN_OF(LOC);
+ const char* LOC = "MED_MED_DRIVER21::writeFrom() : ";
+ BEGIN_OF_MED(LOC);
const map<MESH_NAME_, MESH*> & _meshes = const_cast<const map<MESH_NAME_, MESH*>& > (_ptrMed->_meshes);
map<MESH_NAME_,MESH*>::const_iterator currentMesh;
}
}
- END_OF(LOC);
+ END_OF_MED(LOC);
}
void MED_MED_WRONLY_DRIVER21::write(void ) const
throw (MEDEXCEPTION) // from object method write !
{
- const char * LOC = "MED_MED_DRIVER21::write() : ";
int current;
-
- BEGIN_OF(LOC);
+ const char* LOC = "MED_MED_DRIVER21::write() : ";
+ BEGIN_OF_MED(LOC);
// BCLE SUR LES OBJETS AVEC AJOUT DE DRIVER ET APPELS write
// that's work, but it is more efficenty to write directly when we had driver, no ?
// writeFrom();
- END_OF(LOC);
+ END_OF_MED(LOC);
}
// ------------- Read Write Part --------------
MED_MED_RDWR_DRIVER21::MED_MED_RDWR_DRIVER21()
-{}
+{
+ this->GENDRIVER::_accessMode = MED_EN::RDWR;
+}
MED_MED_RDWR_DRIVER21::MED_MED_RDWR_DRIVER21(const string & fileName, MED * const ptrMed):
MED_MED_RDONLY_DRIVER21(fileName,ptrMed),
MED_MED_WRONLY_DRIVER21(fileName,ptrMed),
IMED_MED_RDWR_DRIVER(fileName,ptrMed),
- MED_MED_DRIVER21(fileName,ptrMed,MED_REMP),
+ MED_MED_DRIVER21(fileName,ptrMed,RDWR),
IMED_MED_WRONLY_DRIVER(fileName,ptrMed),
IMED_MED_RDONLY_DRIVER(fileName,ptrMed),
- MED_MED_DRIVER(fileName,ptrMed,MED_REMP)
+ MED_MED_DRIVER(fileName,ptrMed,RDWR)
{}
MED_MED_RDWR_DRIVER21::MED_MED_RDWR_DRIVER21(const MED_MED_RDWR_DRIVER21 & driver):
{}
MED_MED_RDWR_DRIVER21::~MED_MED_RDWR_DRIVER21() {
- MESSAGE("MED_MED_RDWR_DRIVER21::~MED_MED_RDWR_DRIVER21() has been destroyed");
+ MESSAGE_MED("MED_MED_RDWR_DRIVER21::~MED_MED_RDWR_DRIVER21() has been destroyed");
}
GENDRIVER * MED_MED_RDWR_DRIVER21::copy(void) const
void MED_MED_RDWR_DRIVER21::read(void)
throw (MEDEXCEPTION) // from MED_MED_RDONLY_DRIVER::read()
{
- BEGIN_OF("MED_MED_RDWR_DRIVER21::read(void)");
+ const char* LOC = "MED_MED_RDWR_DRIVER21::read(void)";
+ BEGIN_OF_MED(LOC);
MED_MED_RDONLY_DRIVER21::read();
- END_OF("MED_MED_RDWR_DRIVER21::read(void)");
+ END_OF_MED(LOC);
}
void MED_MED_RDWR_DRIVER21::readFileStruct(void)
throw (MEDEXCEPTION) // from MED_MED_RDONLY_DRIVER::readFileStruct()
{
- BEGIN_OF("MED_MED_RDWR_DRIVER21::readFileStruct(void)");
+ const char* LOC = "MED_MED_RDWR_DRIVER21::readFileStruct(void)";
+ BEGIN_OF_MED(LOC);
MED_MED_RDONLY_DRIVER21::readFileStruct();
- END_OF("MED_MED_RDWR_DRIVER21::readFileStruct(void)");
+ END_OF_MED(LOC);
}
void MED_MED_RDWR_DRIVER21::write(void) const
throw (MEDEXCEPTION) // from MED_MED_WRONLY_DRIVER::write()
{
- BEGIN_OF("MED_MED_RDWR_DRIVER21::write(void) const");
+ const char* LOC = "MED_MED_RDWR_DRIVER21::write(void) const";
+ BEGIN_OF_MED(LOC);
MED_MED_WRONLY_DRIVER21::write();
- END_OF("MED_MED_RDWR_DRIVER21::write(void) const");
+ END_OF_MED(LOC);
}
void MED_MED_RDWR_DRIVER21::writeFrom(void) const
throw (MEDEXCEPTION) // from MED_MED_WRONLY_DRIVER::writeFrom();
{
- BEGIN_OF("MED_MED_RDWR_DRIVER21::writeFrom(void) const");
+ const char* LOC = "MED_MED_RDWR_DRIVER21::writeFrom(void) const";
+ BEGIN_OF_MED(LOC);
MED_MED_WRONLY_DRIVER21::writeFrom();
- END_OF("MED_MED_RDWR_DRIVER21::writeFrom(void) const");
+ END_OF_MED(LOC);
}