H_Traces_Se79_COUPLEX1.med \
maillage_5_5_5.med \
maillage_chemvalIV_cas1_40elts.med \
+Old_ChampsDarcy.med \
+Old_darcy_1.1_res.med \
+Old_darcy_1.3_resCASTEM.med \
+Old_darcy_1.3_resPORFLOW.med \
+Old_darcy_1.3_resTRACES.med \
+Old_darcy2_Castem_EFMH.med \
+Old_darcy2_Castem_qua_EFMH.med \
+Old_darcy2_Castem_qua_VF.med \
+Old_Deff_fdt_5.8_castem_efmh_diff_conc_dom.med \
+Old_Deff_fdt_5.8_castem_vf_diff_conc_dom.med \
+Old_H_CastCast_EFMH_I129_COUPLEX1.med \
+Old_H_CastCast_VF_I129_COUPLEX1.med \
+Old_H_CastCast_VF_Se79_COUPLEX1.med \
+Old_H_CastPorf_I129_COUPLEX1.med \
+Old_H_CastPorf_Se79_COUPLEX1.med \
+Old_H_PorfCast_EFMH_I129_COUPLEX1.med \
+Old_H_PorfCast_EFMH_Se79_COUPLEX1.med \
+Old_H_PorfPorf_I129_COUPLEX1.med \
+Old_H_PorfPorf_Se79_COUPLEX1.med \
+Old_H_Traces_I129_COUPLEX1.med \
+Old_H_Traces_Se79_COUPLEX1.med \
+Old_maillage_chemvalIV_cas1_40elts.med \
Darcy3_3D_H_10x10x10.sauve \
dx200_dy1_avec_2couches.sauve \
elle_2D_QT_10x10.sauve \
_reverseDescendingConnectivity->setIJ(faceId,1,cell2);
_reverseDescendingConnectivity->setIJ(faceId,2,cell1);
// Updating _constituent->_nodal because of reversity
- MEDSKYLINEARRAY *currentNodal=(!polygonFace)?_constituent->_nodal:_constituent->_polygonsNodal;
- MEDSKYLINEARRAY *currentDescending=(!polygonFace)?_descending:_polygonsDescending;
const int *descendingNodalIndex=(!polygonFace)?_constituent->_nodal->getIndex():_constituent->_polygonsNodal->getIndex();
- const int *newDescendingIndex=(!polygonFace)?_descending->getIndex():_polygonsDescending->getIndex();
- for(int iarray=1;iarray<=(descendingNodalIndex[faceId]-descendingNodalIndex[faceId-1]);iarray++)
- currentNodal->setIJ(faceId,iarray,nodalConnForFace[iarray-1]);
+ MEDSKYLINEARRAY *currentNodal=(!polygonFace)?_constituent->_nodal:_constituent->_polygonsNodal;
+ int faceIdRelative=(!polygonFace)?faceId:faceId-getNumberOf(MED_FACE,MED_ALL_ELEMENTS);
+ for(int iarray=1;iarray<=(descendingNodalIndex[faceIdRelative]-descendingNodalIndex[faceIdRelative-1]);iarray++)
+ currentNodal->setIJ(faceIdRelative,iarray,nodalConnForFace[iarray-1]);
// Updating _descending for cell1 and cell2
- for(int iface=newDescendingIndex[cell1-1];iface<=newDescendingIndex[cell1];iface++)
- if (currentDescending->getIndexValue(iface)==faceId)
- currentDescending->setIndexValue(iface,-faceId);
- else if (currentDescending->getIndexValue(iface)==-faceId)
- currentDescending->setIndexValue(iface,faceId);
-
- for(int iface=newDescendingIndex[cell2-1];iface<newDescendingIndex[cell2];iface++)
- if (currentDescending->getIndexValue(iface)==faceId)
- currentDescending->setIndexValue(iface,-faceId);
- else if (_descending->getIndexValue(iface)==-faceId)
- currentDescending->setIndexValue(iface,faceId);
+ const int NB_OF_CELLS_SHARING_A_FACE=2;
+ int cellsToUpdate[NB_OF_CELLS_SHARING_A_FACE]; cellsToUpdate[0]=cell1; cellsToUpdate[1]=cell2;
+ for(int curCell=0;curCell<NB_OF_CELLS_SHARING_A_FACE;curCell++)
+ {
+ int cell=cellsToUpdate[curCell];
+ bool polyhCell=(getElementTypeWithPoly(MED_CELL,cell)==MED_POLYHEDRA);
+ if(polyhCell)
+ cell-=getNumberOf(MED_CELL,MED_ALL_ELEMENTS);
+ const int *newDescendingIndex=(!polyhCell)?_descending->getIndex():_polyhedronDescending->getIndex();
+ MEDSKYLINEARRAY *currentDescending=(!polyhCell)?_descending:_polyhedronDescending;
+ for(int iface=newDescendingIndex[cell-1];iface<newDescendingIndex[cell];iface++)
+ {
+ int curValue=currentDescending->getIndexValue(iface);
+ if (abs(curValue)==faceId)
+ currentDescending->setIndexValue(iface,-curValue);
+ }
+ }
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#include <stdlib.h>
+#include <string.h>
+#include <cassert>
+
+#include "MEDMEM_Utilities.hxx"
# ifdef MED_WITH_KERNEL
//#include "LocalTraceCollector.hxx"
# endif /* ifdef MED_WITH_KERNEL*/
#ifdef MED_WITH_KERNEL
// LocalTraceCollector::instance();
#endif /* ifdef MED_WITH_KERNEL*/
+
+// char* traceKind = getenv("SALOME_trace");
+
+// if (traceKind == NULL)
+// {
+// setenv("SALOME_trace","local",1);
+// traceKind = getenv("SALOME_trace");
+// assert(traceKind);
+// }
+
+// MESSAGE("Med Memory Initialization with $SALOME_trace = " << traceKind);
}
//EF : Gérer le meshName pour le driver 2.2
const char * LOC="MED_FIELD_DRIVER<T>::search_field(...)";
+ BEGIN_OF(LOC);
+
map<int, list<MED_EN::medGeometryElement> > CellAndNodeEntities;
map<int, list<MED_EN::medGeometryElement> >::iterator currentEntity;
CellAndNodeEntities[MED_EN::MED_CELL] = MED_EN::meshEntities[MED_EN::MED_CELL];
CellAndNodeEntities[MED_EN::MED_NODE] = MED_EN::meshEntities[MED_EN::MED_NODE];
list< MED_EN::medGeometryElement >::const_iterator currentGeometry;
+ MED_EN::medEntityMesh entityCurrent;
+ MED_EN::medGeometryElement geometryCurrent;
+
//med_2_1::med_entite_maillage
MED_EN::medEntityMesh entity;
bool alreadyFoundAnEntity=false, alreadyFoundPdtIt = false, anyGauss=false;
- int numberOfElements = 0;
+ int numberOfElements = 0, numberOfElements1 = 0,numberOfElements2 = 0;
int numberOfGeometricType = 0;
//med_2_1::med_geometrie_element..
MED_EN::medGeometryElement geometricType[MED_NBR_GEOMETRIE_MAILLE];
for (currentGeometry = (*currentEntity).second.begin();
currentGeometry != (*currentEntity).second.end(); currentGeometry++) {
- if ( (numberOfElements = med_2_1::MEDnVal(id, const_cast <char*> ( fieldName.c_str() ),
- (med_2_1::med_entite_maillage) (*currentEntity).first,
- (med_2_1::med_geometrie_element) *currentGeometry,
- ndt, od)) <= 0 )
+ entityCurrent = (*currentEntity).first ;
+ geometryCurrent = (*currentGeometry) ;
+
+ // That is a difference between Med File and Med Memory (NB)
+
+ if (geometryCurrent == MED_EN::MED_SEG2 || geometryCurrent == MED_EN::MED_SEG3)
+ entityCurrent = MED_EN::MED_EDGE;
+
+ if (geometryCurrent == MED_EN::MED_TRIA3 || geometryCurrent == MED_EN::MED_QUAD4 ||
+ geometryCurrent == MED_EN::MED_TRIA6 || geometryCurrent == MED_EN::MED_QUAD8)
+ entityCurrent = MED_EN::MED_FACE;
+
+ numberOfElements1 = med_2_1::MEDnVal(id, const_cast <char*> ( fieldName.c_str() ),
+ (med_2_1::med_entite_maillage) (*currentEntity).first,
+ (med_2_1::med_geometrie_element) *currentGeometry,
+ ndt, od);
+
+ numberOfElements2 = med_2_1::MEDnVal(id, const_cast <char*> ( fieldName.c_str() ),
+ (med_2_1::med_entite_maillage) entityCurrent,
+ (med_2_1::med_geometrie_element) *currentGeometry,
+ ndt, od);
+ if (numberOfElements2 < numberOfElements1) entityCurrent = (*currentEntity).first ;
+
+ numberOfElements = (numberOfElements1>numberOfElements2)?numberOfElements1:numberOfElements2;
+
+ SCRUTE(numberOfElements);
+
+ if ( numberOfElements <= 0 )
continue;
if ( alreadyFoundAnEntity ) {
- if (entity != (*currentEntity).first )
+ if (entity != entityCurrent)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName
<< "| with (ndt,or) = (" << ndt << ","
<< od << ") must not be defined on nodes and cells" ));
- } else { entity=(*currentEntity).first; alreadyFoundAnEntity = true; };
+ } else { entity=entityCurrent; alreadyFoundAnEntity = true; };
nbPdtIt = med_2_1::MEDnPasdetemps(id, const_cast <char*> ( fieldName.c_str() ),
- (med_2_1::med_entite_maillage) (*currentEntity).first,
+ (med_2_1::med_entite_maillage) entityCurrent,
(med_2_1::med_geometrie_element) *currentGeometry );
+
+ SCRUTE(nbPdtIt);
+ SCRUTE(numberOfElements);
+
if ( nbPdtIt < 0 )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName << "| with (ndt,or) = ("
<< ndt << "," << od << ") should be defined for (entityType,geometricType)=("
- << MED_EN::entNames[(*currentEntity).first] << ","
+ << MED_EN::entNames[entityCurrent] << ","
<< MED_EN::geoNames[*currentGeometry] << ")" ));
ret = 0; alreadyFoundPdtIt = false; ngauss =0;
// Search how many <ngauss> (<fieldName>,<ndt>,<ot>) has
ret = med_2_1::MEDpasdetempsInfo(id, const_cast <char*> ( fieldName.c_str() ),
- (med_2_1::med_entite_maillage) (*currentEntity).first,
+ (med_2_1::med_entite_maillage) entityCurrent,
(med_2_1::med_geometrie_element) *currentGeometry,
j,maa,&ngauss,&numdt,dtunit,&dt,&numo);
// }
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName << "| with (ndt,or) = ("
<< ndt << "," << od << ") for (entityType,geometricType)=("
- << MED_EN::entNames[(*currentEntity).first] << ","
+ << MED_EN::entNames[entityCurrent] << ","
<< MED_EN::geoNames[*currentGeometry] << ")"
<< "is defined on mesh |" << maa << "| not on mesh |" << meshName ));
}
}
}
+ MESSAGE(LOC << " a (dt,it) is found ?? " << alreadyFoundPdtIt);
+
if ( !alreadyFoundPdtIt )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName << "| with (ndt,or) = ("
<< ndt << "," << od << ") should be defined for (entityType,geometricType)=("
- << MED_EN::entNames[(*currentEntity).first] << ","
+ << MED_EN::entNames[entityCurrent] << ","
<< MED_EN::geoNames[*currentGeometry] << ")" ));
if ( (ret != 0) || (ngauss < 1 ) )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Error in MEDpasdetempsInfo for Field |" << fieldName
<< "| with (ndt,or) = ("
<< ndt << "," << od << ") for (entityType,geometricType)=("
- << MED_EN::entNames[(*currentEntity).first] << ","
+ << MED_EN::entNames[entityCurrent] << ","
<< MED_EN::geoNames[*currentGeometry] << ")" )); ;
//totalNumberOfElements+=numberOfElements;
support.setNumberOfElements(numberOfElementsOfType); //setNumberOfElements effectue une copie
support.setAll(true);
+ END_OF(LOC);
+
return alreadyFoundAnEntity;
} else
- return false;
+ {
+ END_OF(LOC);
+
+ return false;
+ }
}
template <class T> void
else
if (entity == MED_EN::MED_NODE) quoi=med_2_1::MED_COOR;
else
- throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Support Creation from Mesh |" << meshName
+ MESSAGE(LOC<<" Support Creation from Mesh |" << meshName
<< "| on entity " << MED_EN::entNames[entity]
- << "| is impossible, must be on MED_NODE or MED_CELL" ));
+ << "| is impossible, must be on MED_NODE or MED_CELL");
+
+// throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Support Creation from Mesh |" << meshName
+// << "| on entity " << MED_EN::entNames[entity]
+// << "| is impossible, must be on MED_NODE or MED_CELL" ));
list<MED_EN::medGeometryElement>::const_iterator currentGeometry;
bool alreadyFoundAnEntity = false;
MED_FIELD_DRIVER<T>::_fieldName=MED_FIELD_DRIVER<T>::_ptrField->_name;
if ( MED_FIELD_DRIVER<T>::_fieldName.size() > MED_TAILLE_NOM )
- throw MEDEXCEPTION(LOCALIZED(STRING(LOC)
- <<" <fieldName> size in object driver FIELD is > MED_TAILLE_NOM ."));
+ MESSAGE(LOC << "Warning <fieldName> size in object driver FIELD is > MED_TAILLE_NOM .");
+
+// throw MEDEXCEPTION(LOCALIZED(STRING(LOC)
+// <<" <fieldName> size in object driver FIELD is > MED_TAILLE_NOM ."));
MESSAGE("###### "<<LOC<<" fieldNameDRIVER : "<< MED_FIELD_DRIVER<T>::_fieldName <<
// l'ensemble des profils par type géométrique est lu
// Le nom du maillage associé est lu mais le pointeur SUPPORT-MESH non initialisé
- char * fieldName = new char[MED_TAILLE_NOM+1] ;
+ char fieldName[MED_TAILLE_NOM+1] ;
int err ;
int numberOfComponents = 0;
}
}
- delete[] fieldName ;
+ //delete[] fieldName ;
if (MED_FIELD_DRIVER<T>::_fieldNum==MED_INVALID)
throw MEDEXCEPTION(LOCALIZED( STRING(LOC) << ": Field "<<MED_FIELD_DRIVER<T>::_fieldName << " not found in file " << MED_FIELD_DRIVER<T>::_fileName ) );
med_2_2::MED_MAILLE,
(med_2_2::med_geometrie_element)types[i]);
if (err != MED_VALID)
- throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<<Connectivity->_entity<<" and geometric type "<<Connectivity->_geometricTypes[i]));
+ throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<<Connectivity->_entity<<" and geometric type "<<types[i]));
}
int ii ;
for ( ii = 0 ; ii < NumberOfCell ; ii++ )
med_2_2::MED_MAILLE,
(med_2_2::med_geometrie_element)types[i]);
if (err != MED_VALID)
- throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<<Connectivity->_entity<<" and geometric type "<<Connectivity->_geometricTypes[i]));
+ throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Family not found for entity "<<Connectivity->_entity<<" and geometric type "<<types[i]));
}
#endif
}
// SOLUTION TEMPORAIRE CAR _ptrMesh->_MEDArray____Family DOIT ETRE ENLEVER DE LA CLASSE MESH
if ( ( _ptrMesh->existConnectivity(MED_NODAL,entity) )|( _ptrMesh->existConnectivity(MED_DESCENDING,entity) ) ) {
- int numberOfTypes = _ptrMesh->getNumberOfTypes (entity) ;
- const medGeometryElement * types = _ptrMesh->getTypes (entity) ;
+ int numberOfTypes = _ptrMesh->getNumberOfTypesWithPoly(entity) ;
+ medGeometryElement * types = _ptrMesh->getTypesWithPoly(entity) ;
// We build the array from the families list objects :
int NumberOfElements = _ptrMesh->getNumberOfElements(entity, MED_ALL_ELEMENTS);
SCRUTE(MEDArrayFamily[i]);
-
- const int * typeCount = _ptrMesh->getGlobalNumberingIndex(entity) ;
+ int offset=0;
#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
int lgth=NumberOfElements;
med_2_2::med_int *temp=new med_2_2::med_int[lgth];
temp[i2]=(med_2_2::med_int) (MEDArrayFamily[i2]);
#endif
for (int i=0; i<numberOfTypes; i++) {
+ int typeNumberOfElements=_ptrMesh->getNumberOfElementsWithPoly(entity,types[i]);
#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
- (temp+(typeCount[i]-1)),(typeCount[i+1]-typeCount[i]),
+ (temp+offset),(typeCount[i+1]-typeCount[i]),
//CCRT med_2_2::MED_REMP ,
// (med_2_2::med_entite_maillage) entity, because Med Memory works only in Nodal connectivity
(med_2_2::med_entite_maillage) MED_CELL,
(med_2_2::med_geometrie_element) types[i]);
#else
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
- (MEDArrayFamily+(typeCount[i]-1)),
- (typeCount[i+1]-typeCount[i]),
+ (MEDArrayFamily+offset),
+ typeNumberOfElements,
// (med_2_2::med_entite_maillage) entity, because Med Memory works only in Nodal connectivity
(med_2_2::med_entite_maillage) MED_CELL,
(med_2_2::med_geometrie_element) types[i]);
//CCRT delete [] temp;
//CCRT#endif
delete[] MEDArrayFamily ;
+ delete[] types;
//if (true == ToDestroy) {
// int NumberOfFamilies = myFamilies->size();
// for (int i=0; i<NumberOfFamilies; i++)
{
TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
if(anIter == myGeom2NbGauss.end())
- EXCEPTION(runtime_error,"TTimeStampInfo::GetNbGauss - myGeom2NbGauss.find(theGeom) fails");
+ return 1;//EXCEPTION(runtime_error,"TTimeStampInfo::GetNbGauss - myGeom2NbGauss.find(theGeom) fails");
return anIter->second;
}
TMeshValue
::GetCompValueSliceArr(TInt theElemId)
{
- TValueSliceArr aValueSliceArr(myNbGauss);
if(GetModeSwitch() == eFULL_INTERLACE){
+ TValueSliceArr aValueSliceArr(myNbComp);
TInt anId = theElemId*myStep;
for(TInt aCompId = 0; aCompId < myNbComp; aCompId++){
aValueSliceArr[aCompId] =
TValueSlice(myValue,std::slice(anId,myNbGauss,myNbComp));
anId += 1;
}
+ return aValueSliceArr;
}
else{
+ TValueSliceArr aValueSliceArr(myNbGauss);
for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
aValueSliceArr[aGaussId] =
TValueSlice(myValue,std::slice(theElemId,myNbComp,myStep));
}
+ return aValueSliceArr;
}
- return aValueSliceArr;
}
EXPORT_SHAREDPYSCRIPTS=\
MED_shared_modules.py
-@CONCLUDE@
\ No newline at end of file
+@CONCLUDE@