#define USER_INTERLACE MED_FULL_INTERLACE
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
aFamily->myNbCells = aNbCells;
aFamily->myCellsSize = aCellsSize;
aFamily->myId = aMEDFamily->getIdentifier();
+ aFamily->myName = aSupportName.in();
aFamily->myFamily = aMEDFamily;
}
}
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName.in();
aMeshOnEntity->mySupport = aMEDSupport;
+
+ PCMeshOnEntity aMeshOnEntity2;
if(aVEntity == NODE_ENTITY){
- PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
- *aMeshOnEntity2 = *aMeshOnEntity;
- aMeshOnEntity->myEntity = CELL_ENTITY;
- GetCellsSize(aMesh,aMEDMesh,CELL_ENTITY);
+ aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
+ aMeshOnEntity2->myEntity = CELL_ENTITY;
}else{
- PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[NODE_ENTITY](new TCMeshOnEntity());
- *aMeshOnEntity2 = *aMeshOnEntity;
- aMeshOnEntity->myEntity = NODE_ENTITY;
- GetCellsSize(aMesh,aMEDMesh,NODE_ENTITY);
+ aMeshOnEntity2 = aMeshOnEntityMap[NODE_ENTITY](new TCMeshOnEntity());
+ aMeshOnEntity2->myEntity = NODE_ENTITY;
}
+
+ aMeshOnEntity2->myMeshName = aMeshName.in();
+ aMeshOnEntity2->mySupport = aMEDSupport;
+ GetCellsSize(aMesh,aMEDMesh,aMeshOnEntity2->myEntity);
+
GetCellsSize(aMesh,aMEDMesh,aVEntity);
TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
if(MYDEBUG) MESSAGE("LoadPoints - Filling aMeshOnEntity with type NODE_ENTITY");
TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
- PSubMeshImpl aSubMesh = aGeom2SubMesh[VISU::ePOINT1];
+ PSubMeshImpl aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TCSubMesh());
+
+ aSubMesh->myNbCells = theMesh->myNbPoints;
+ aSubMesh->myCellsSize = 2*theMesh->myNbPoints;
+
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for(int iElem = 0; iElem < aNbElem; iElem++)
for(int iGeom = 0, aCounter = 0; iGeom < iGeomEnd; iGeom++){
SALOME_MED::medGeometryElement aMGeom = aGeomElems[iGeom];
int aMNbNodes = MEDGeom2NbNodes(aMGeom);
- VISU::EGeometry aEGeom = MEDGeom2VISU(aEGeom);
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
int aVNbNodes = VISUGeom2NbNodes(aEGeom);
- int iNumElemEnd = aMedMesh->getNumberOfElements(aMEntity,aMGeom);
- if (iNumElemEnd > 0) {
+ int aNbElem = aMedMesh->getNumberOfElements(aMEntity,aMGeom);
+ if (aNbElem > 0) {
using namespace SALOME_MED;
SALOME_MED::long_array_var conn =
aMedMesh->getConnectivity(MED_FULL_INTERLACE,MED_NODAL,aMEntity,aMGeom);
- PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom];
+ PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new TCSubMesh());
+
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
std::vector<int> aConnect(aMNbNodes);
- int aNbConnForElem = conn->length()/iNumElemEnd;
+ int aNbConnForElem = conn->length()/aNbElem;
if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aMGeom = "<<aMGeom<<
- "; iNumElemEnd = "<<iNumElemEnd<<
+ "; aNbElem = "<<aNbElem<<
+ "; aMNbNodes = "<<aMNbNodes<<
+ "; aVNbNodes = "<<aVNbNodes<<
"; aNbConnForElem = "<<aNbConnForElem);
- for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++){
+ for(int iElem = 0; iElem < aNbElem; iElem++){
VISU::TConnect anArray(aVNbNodes);
- for(int k = 0, kj = iNumElem*aNbConnForElem; k < aMNbNodes; k++)
+ for(int k = 0, kj = iElem*aNbConnForElem; k < aMNbNodes; k++)
aConnect[k] = conn[kj+k] - 1;
switch(aMGeom){
for (int k = 0; k < aVNbNodes; k++)
if(anArray[k] < 0 || aNbPoints <= anArray[k]){
static QString aString;
- aString.sprintf("ImportCells >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iNumElem,k,anArray[k]);
+ aString.sprintf("ImportCells >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iElem,k,anArray[k]);
throw std::runtime_error(aString.latin1());
}
aCell2Connect.push_back(anArray);
}
int
-VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PField theField,
- VISU::PCValForTime theValForTime)
+VISU_MEDConvertor
+::LoadField(VISU::PCMesh theMesh,
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PField theField,
+ VISU::PCValForTime theValForTime)
{
//Check on loading already done
- PProfileImpl aProfile = theValForTime->myProfile;
- TSource& aMeshSource = aProfile->mySource;
- if(aMeshSource.myIsDone)
+ PIDMapperFilter anIDMapperFilter = theValForTime->myIDMapperFilter;
+ if(anIDMapperFilter->myIsVTKDone)
return 0;
+ PCProfile aProfile(new TCProfile());
+ aProfile->myIsAll = true;
+ theValForTime->myProfile = aProfile;
+
SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
if(!aFieldDouble->_is_nil()){
::ImportField(anArray,theMesh,theField,theValForTime,theMeshOnEntity);
}
- aMeshSource.myIsDone = true;
+ anIDMapperFilter->myIsVTKDone = true;
return 1;
}