aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- const VISU::TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
- VISU::TGeom2Cell2Connect::const_iterator aGeom2Cell2ConnectIter = aGeom2Cell2Connect.begin();
- for(vtkIdType i = 0, j = 0; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
- const VISU::TCell2Connect& anArray = aGeom2Cell2ConnectIter->second;
- vtkIdType aGeom = aGeom2Cell2ConnectIter->first;
+ const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
+ VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
+ for(vtkIdType i = 0, j = 0; anIter != aGeom2SubMesh.end(); anIter++){
+ const vtkIdType& aGeom = anIter->first;
+ const VISU::TSubMeshImpl& aSubMesh = anIter->second;
+ const VISU::TCell2Connect& anArray = aSubMesh.myCell2Connect;
INITMSG(MYDEBUG,"aGeom = "<<aGeom<<
"; anArray.size() = "<<anArray.size()<<
endl);
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- const VISU::TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
- VISU::TGeom2Cell2Connect::const_iterator aGeom2Cell2ConnectIter = aGeom2Cell2Connect.begin();
- for(vtkIdType i = 0, j = 0; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
- const VISU::TCell2Connect& anArray = aGeom2Cell2ConnectIter->second;
- vtkIdType aGeom = aGeom2Cell2ConnectIter->first;
+ const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
+ VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
+ for(vtkIdType i = 0, j = 0; anIter != aGeom2SubMesh.end(); anIter++){
+ const vtkIdType& aGeom = anIter->first;
+ const VISU::TSubMeshImpl& aSubMesh = anIter->second;
+ const VISU::TCell2Connect& anArray = aSubMesh.myCell2Connect;
+
const VISU::TGeom2SubMeshID& aGeom2SubMeshID = theFamily->myGeom2SubMeshID;
if(aGeom2SubMeshID.empty())
EXCEPTION(runtime_error,"GetCells >> There is no elements on the family !!!");
vtkIdType aNbNodes = VTKGeom2NbNodes(aGeom);
const TSubMeshID& aSubMeshID = theSubProfile->mySubMeshID;
- const TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
- TGeom2Cell2Connect::const_iterator aConnectIter = aGeom2Cell2Connect.find(aGeom);
- if(aConnectIter == aGeom2Cell2Connect.end())
+
+ const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
+ VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.find(aGeom);
+ if(anIter == aGeom2SubMesh.end())
EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<<aGeom<<")");
- const TCell2Connect& aCell2Connect = aConnectIter->second;
+ const VISU::TSubMeshImpl& aSubMesh = anIter->second;
+ const TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect;
vtkCellArray* aConnectivity = vtkCellArray::New();
aConnectivity->Allocate(aCellsSize,0);
aVCoordSlice[iDim] = aMCoordSlice[iDim];
}
- TCell2Connect& aConnForCellType = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
+ TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
+ TSubMeshImpl& aSubMesh = aGeom2SubMesh[VTK_VERTEX];
+ TCell2Connect& aConnForCellType = aSubMesh.myCell2Connect;
aConnForCellType.resize(aNbElem);
for (int iElem = 0; iElem < aNbElem; iElem++)
aConnForCellType[iElem] = VISU::TConnect(1,iElem);
const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
+ TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
case MED::ePOLYGONE: {
MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aPolygoneInfo->GetNbElem();
-
- TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
- TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
- TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aNbConn);
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- anArray[iConn] = aConnSlice[iConn] - 1;
+ if(aNbElem > 0){
+ TSubMeshImpl& aSubMesh = aGeom2SubMesh[aVGeom];
+ TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+ TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aNbConn);
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ anArray[iConn] = aConnSlice[iConn] - 1;
+ }
}
-
break;
}
case MED::ePOLYEDRE: {
MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aPolyedreInfo->GetNbElem();
- TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
- aCell2Connect.resize(aNbElem);
+ if(aNbElem > 0){
+ TSubMeshImpl& aSubMesh = aGeom2SubMesh[aVGeom];
+ TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect;
+ aCell2Connect.resize(aNbElem);
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
- TConnect& anArray = aCell2Connect[iElem];
- typedef set<TInt> TConnectSet;
- TConnectSet aConnectSet;
- TInt aNbFaces = aConnSliceArr.size();
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- for(TInt iConn = 0; iConn < aNbConn; iConn++){
- aConnectSet.insert(aConnSlice[iConn]);
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+ TConnect& anArray = aCell2Connect[iElem];
+ typedef std::set<TInt> TConnectSet;
+ TConnectSet aConnectSet;
+ TInt aNbFaces = aConnSliceArr.size();
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ for(TInt iConn = 0; iConn < aNbConn; iConn++){
+ aConnectSet.insert(aConnSlice[iConn]);
+ }
}
- }
- int aNbConn = aConnectSet.size();
- anArray.resize(aNbConn);
- TConnectSet::iterator anIter = aConnectSet.begin();
- for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
- TInt anId = *anIter;
- anArray[i] = anId - 1;
+ int aNbConn = aConnectSet.size();
+ anArray.resize(aNbConn);
+ TConnectSet::iterator anIter = aConnectSet.begin();
+ for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
+ TInt anId = *anIter;
+ anArray[i] = anId - 1;
+ }
}
}
MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aCellInfo->GetNbElem();
- TCell2Connect& aConnForCellType = aGeom2Cell2Connect[aVGeom];
- aConnForCellType.resize(aNbElem);
+ if(aNbElem > 0){
+ TSubMeshImpl& aSubMesh = aGeom2SubMesh[aVGeom];
+ TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect;
+ aCell2Connect.resize(aNbElem);
- int aMNbNodes = MEDGeom2NbNodes(aMGeom);
- vector<TInt> aConnect(aMNbNodes);
+ TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ TVector<TInt> aConnect(aMNbNodes);
- for (int iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
- TConnect& anArray = aConnForCellType[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
+ TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aVNbNodes);
+
+ if(anIsNodeNum){
+ for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
+ }
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aConnSlice[iConn] - 1;
+ }
}
- }else{
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aConnSlice[iConn] - 1;
+
+ switch(aMGeom){
+ case MED::eTETRA4:
+ case MED::eTETRA10:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[1];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[2];
+ break;
+ case MED::ePYRA5:
+ case MED::ePYRA13:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ break;
+ default:
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ anArray[iNode] = aConnect[iNode];
}
- }
-
- switch(aMGeom){
- case MED::eTETRA4:
- case MED::eTETRA10:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[1];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[2];
- break;
- case MED::ePYRA5:
- case MED::ePYRA13:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- break;
- default:
for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
}
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
}
}}
}
const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
MED::PElemInfo anElemInfo;