case VTK_HEXAHEDRON: return 8;
case VTK_WEDGE: return 6;
case VTK_PYRAMID: return 5;
+
+ case QUADRATIC_EDGE: return 3;
+ case QUADRATIC_TRIANGLE: return 6;
+ case QUADRATIC_QUAD: return 8;
+ case QUADRATIC_TETRA: return 10;
+ case QUADRATIC_HEXAHEDRON: return 20;
+ case QUADRATIC_WEDGE: return 15;
+ case QUADRATIC_PYRAMID: return 13;
}
return -1;
}
+
+ vtkIdType
+ VTKGeom2VISU(vtkIdType theGeom)
+ {
+ switch(theGeom){
+ case QUADRATIC_EDGE: return VTK_POLY_LINE;
+ case QUADRATIC_TRIANGLE: return VTK_POLYGON;
+ case QUADRATIC_QUAD: return VTK_POLYGON;
+ case QUADRATIC_TETRA: return VTK_CONVEX_POINT_SET;
+ case QUADRATIC_HEXAHEDRON: return VTK_CONVEX_POINT_SET;
+ case QUADRATIC_WEDGE: return VTK_CONVEX_POINT_SET;
+ case QUADRATIC_PYRAMID: return VTK_CONVEX_POINT_SET;
+ }
+ return theGeom;
+ }
}
{
vtkIdType aNbCells = theSubProfile->myNbCells;
vtkIdType aCellsSize = theSubProfile->myCellsSize;
- vtkIdType aGeom = theSubProfile->myGeom;
- vtkIdType aNbNodes = VTKGeom2NbNodes(aGeom);
-
+ vtkIdType aVGeom = theSubProfile->myGeom;
+ vtkIdType aNbNodes = VTKGeom2NbNodes(aVGeom);
+ vtkIdType aGeom = VTKGeom2VISU(aVGeom);
+
const TSubMeshID& aSubMeshID = theSubProfile->mySubMeshID;
const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
- VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.find(aGeom);
+ VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.find(aVGeom);
if(anIter == aGeom2SubMesh.end())
- EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<<aGeom<<")");
+ EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<<aVGeom<<")");
const VISU::TSubMeshImpl& aSubMesh = anIter->second;
const TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect;
const PProfileImpl& theProfile,
const PSubProfileImpl& theSubProfile)
{
- INITMSG(MYDEBUG,"GetMeshOnSubProfile - aGeom = "<<theSubProfile->myGeom<<endl);
+ INITMSG(MYDEBUG,"GetMeshOnSubProfile - aVGeom = "<<theSubProfile->myGeom<<endl);
const TVTKSource& aSource = theSubProfile->GetSource();
if(theSubProfile->myIsVTKDone)
TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
TVector<float> aDataValues(aNbComp);
for(int aTupleId = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){
- vtkIdType aGeom = anIter->first;
+ vtkIdType aVGeom = anIter->first;
PGaussSubMeshImpl aGaussSubMesh = anIter->second;
if(!aGaussSubMesh->myIsDone)
continue;
- TGeom2Value::const_iterator anIter2 = aGeom2Value.find(aGeom);
+ TGeom2Value::const_iterator anIter2 = aGeom2Value.find(aVGeom);
if(anIter2 == aGeom2Value.end()){
EXCEPTION(runtime_error,
"GetTimeStampOnGaussMesh >> Can't find values for corresponding Gauss Points SubMesh");
if(aNbGauss < 1)
continue;
- INITMSG(MYDEBUG,"- aGeom = "<<aGeom<<
+ INITMSG(MYDEBUG,"- aVGeom = "<<aVGeom<<
"; aNbElem = "<<aNbElem<<
"; aNbComp = "<<aNbComp<<
"; aNbGauss = "<<aNbGauss<<
const PGaussSubMeshImpl& theGaussSubMesh)
{
PGaussImpl aGauss = theGaussSubMesh->myGauss;
- INITMSG(MYDEBUG,"GetGaussSubMesh - aGeom = "<<aGauss->myGeom<<endl);
+ INITMSG(MYDEBUG,"GetGaussSubMesh - aVGeom = "<<aGauss->myGeom<<endl);
if(!theGaussSubMesh->myIsDone)
return;
aSubMeshArr.resize(aGeom2SubMesh.size());
for(vtkIdType anID = 0, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
- const vtkIdType& aGeom = anIter->first;
+ const vtkIdType& aVGeom = anIter->first;
PSubMeshImpl aSubMesh = anIter->second;
const TVTKSource& aSource = aSubMesh->GetSource();
aSource->SetPoints(GetPoints(aMesh));
- GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aGeom);
+ GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aVGeom);
anAppendFilter->AddInput(aSource.GetPointer());
aSubMesh->myStartID = aCellID;
namespace
{
//---------------------------------------------------------------
- int
+ vtkIdType
MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
{
return theMEDGeomType % 100;
//---------------------------------------------------------------
- int
+ vtkIdType
MEDGeomToVTK(MED::EGeometrieElement theMEDGeomType)
{
switch(theMEDGeomType){
case MED::ePOINT1: return VTK_VERTEX;
case MED::eSEG2: return VTK_LINE;
- case MED::eSEG3: return VTK_LINE;
case MED::eTRIA3: return VTK_TRIANGLE;
- case MED::eTRIA6: return VTK_TRIANGLE;
case MED::eQUAD4: return VTK_QUAD;
- case MED::eQUAD8: return VTK_QUAD;
case MED::eTETRA4: return VTK_TETRA;
- case MED::eTETRA10: return VTK_TETRA;
case MED::eHEXA8: return VTK_HEXAHEDRON;
- case MED::eHEXA20: return VTK_HEXAHEDRON;
case MED::ePENTA6: return VTK_WEDGE;
- case MED::ePENTA15: return VTK_WEDGE;
case MED::ePYRA5: return VTK_PYRAMID;
- case MED::ePYRA13: return VTK_PYRAMID;
+
+ case MED::eSEG3: return VISU::QUADRATIC_EDGE;
+ case MED::eTRIA6: return VISU::QUADRATIC_TRIANGLE;
+ case MED::eQUAD8: return VISU::QUADRATIC_QUAD;
+ case MED::eTETRA10: return VISU::QUADRATIC_TETRA;
+ case MED::eHEXA20: return VISU::QUADRATIC_HEXAHEDRON;
+ case MED::ePENTA15: return VISU::QUADRATIC_WEDGE;
+ case MED::ePYRA13: return VISU::QUADRATIC_PYRAMID;
+
case MED::ePOLYGONE: return VTK_POLYGON;
case MED::ePOLYEDRE: return VTK_CONVEX_POINT_SET;
}
case VTK_HEXAHEDRON: return MED::eHEXA8;
case VTK_WEDGE: return MED::ePENTA6;
case VTK_PYRAMID: return MED::ePYRA5;
+
+ case VISU::QUADRATIC_EDGE: return MED::eSEG3;
+ case VISU::QUADRATIC_TRIANGLE: return MED::eTRIA6;
+ case VISU::QUADRATIC_QUAD: return MED::eQUAD8;
+ case VISU::QUADRATIC_TETRA: return MED::eTETRA10;
+ case VISU::QUADRATIC_HEXAHEDRON: return MED::eHEXA20;
+ case VISU::QUADRATIC_WEDGE: return MED::ePENTA15;
+ case VISU::QUADRATIC_PYRAMID: return MED::ePYRA13;
+
case VTK_POLYGON: return MED::ePOLYGONE;
case VTK_CONVEX_POINT_SET: return MED::ePOLYEDRE;
}
//---------------------------------------------------------------
PMEDSubProfile
- CrSubProfile(MED::EGeometrieElement theMGeom,
+ CrSubProfile(const MED::PWrapper& theMEDWrapper,
+ const MED::PMeshInfo& theMeshInfo,
+ MED::EEntiteMaillage theMEntity,
+ MED::EGeometrieElement theMGeom,
const MED::TGeom2Size& theGeom2Size,
const MED::TGeom2Profile& theGeom2Profile)
{
vtkIdType aVGeom = MEDGeomToVTK(theMGeom);
- vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
+ vtkIdType aVNbNodes = VTKGeom2NbNodes(theMGeom);
PMEDSubProfile aSubProfile(new TMEDSubProfile());
aSubProfile->myGeom = aVGeom;
if(aTimeStampIter == theGeom2Size.end())
aSubProfile->myStatus = eRemoveAll;
else{
- aSubProfile->myNbCells = aTimeStampIter->second;
MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
if(aProfileIter != theGeom2Profile.end()){
MED::PProfileInfo aProfileInfo = aProfileIter->second;
- aSubProfile->myNbCells = aProfileInfo->myElemNum.size();
aSubProfile->myName = aProfileInfo->GetName();
aSubProfile->myStatus = eAddPart;
+
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ TInt aNbElem = anElemNum.size();
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemNum[anElemId]);
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr(anElemNum[anElemId]);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
+ }else{
+ TInt aNbElem = aTimeStampIter->second;
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr(anElemId);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
}
}
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
-
INITMSG(MYDEBUG,
"- aVGeom = "<<aVGeom<<
"; aName = '"<<aSubProfile->myName<<"'"<<
//---------------------------------------------------------------
TProfileKey
- GetProfileKey(const MED::TTimeStampVal& theTimeStampVal,
+ GetProfileKey(const MED::PWrapper& theMEDWrapper,
+ const MED::PMeshInfo& theMeshInfo,
+ const MED::TTimeStampVal& theTimeStampVal,
const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
const MED::TGeom2Size& theGeom2Size)
{
INITMSG(MYDEBUG,"GetProfileKey"<<endl);
MED::TGeom2Size::const_iterator anIter = aGeom2Size.begin();
for(; anIter != aGeom2Size.end(); anIter++){
MED::EGeometrieElement aMGeom = anIter->first;
- PSubProfile aSubProfile = CrSubProfile(aMGeom,theGeom2Size,aGeom2Profile);
+ PSubProfile aSubProfile = CrSubProfile(theMEDWrapper,
+ theMeshInfo,
+ theMEntity,
+ aMGeom,
+ theGeom2Size,
+ aGeom2Profile);
aProfileKey.insert(aSubProfile);
}
//---------------------------------------------------------------
void
- InitProfile(MED::TTimeStampVal& theTimeStampVal,
+ InitProfile(const MED::PWrapper& theMEDWrapper,
+ const MED::PMeshInfo& theMeshInfo,
+ MED::TTimeStampVal& theTimeStampVal,
VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
const MED::TGeom2Size& theGeom2Size,
VISU::TMEDValForTime& theValForTime)
{
TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
- TProfileKey aProfileKey = GetProfileKey(theTimeStampVal,
+ TProfileKey aProfileKey = GetProfileKey(theMEDWrapper,
+ theMeshInfo,
+ theTimeStampVal,
theMeshOnEntity,
+ theMEntity,
theGeom2Size);
TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
//---------------------------------------------------------------
void
- InitGaussProfile(MED::TTimeStampVal& theTimeStampVal,
+ InitGaussProfile(const MED::PWrapper& theMEDWrapper,
+ const MED::PMeshInfo& theMeshInfo,
+ MED::TTimeStampVal& theTimeStampVal,
VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
const MED::TGeom2Size& theGeom2Size,
VISU::TMEDValForTime& theValForTime)
{
INITMSG(MYDEBUG,"InitGaussProfile"<<endl);
+
// The order of the function calls is important
- InitProfile(theTimeStampVal,theMeshOnEntity,theGeom2Size,theValForTime);
- InitGaussMesh(theTimeStampVal,theMeshOnEntity,theGeom2Size,theValForTime);
+ InitProfile(theMEDWrapper,
+ theMeshInfo,
+ theTimeStampVal,
+ theMeshOnEntity,
+ theMEntity,
+ theGeom2Size,
+ theValForTime);
+
+ InitGaussMesh(theTimeStampVal,
+ theMeshOnEntity,
+ theGeom2Size,
+ theValForTime);
}
}
default: {
vtkIdType aVGeom = MEDGeomToVTK(aMGeom);
- int aVNbNodes = VTKGeom2NbNodes(aVGeom);
+ vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aCellInfo->GetNbElem();
aMeshOnEntity->myNbCells += aNbElem;
aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
- InitGaussProfile(aTimeStampVal,
+ InitGaussProfile(theMEDWrapper,
+ aMeshInfo,
+ aTimeStampVal,
aMeshOnEntity,
+ aMEntity,
aGeom2Size,
aValForTime);
}
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- int aVGeom = MEDGeomToVTK(aMGeom);
+ vtkIdType aVGeom = MEDGeomToVTK(aMGeom);
INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
switch(aMGeom){
case MED::ePOLYGONE: {
break;
}
default: {
- TInt aVNbNodes = VTKGeom2NbNodes(aVGeom);
+ vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aCellInfo->GetNbElem();
}
switch(aMGeom){
- case MED::eTETRA4:
case MED::eTETRA10:
+ anArray[4] = aConnect[4];
+ anArray[5] = aConnect[5];
+ anArray[6] = aConnect[7];
+ anArray[7] = aConnect[6];
+ anArray[8] = aConnect[8];
+ anArray[9] = aConnect[9];
+ case MED::eTETRA4:
anArray[0] = aConnect[0];
anArray[1] = aConnect[1];
anArray[2] = aConnect[3];
anArray[3] = aConnect[2];
break;
- case MED::ePYRA5:
case MED::ePYRA13:
+ anArray[5] = aConnect[5];
+ anArray[6] = aConnect[8];
+ anArray[7] = aConnect[7];
+ anArray[8] = aConnect[6];
+ anArray[9] = aConnect[9];
+ anArray[10] = aConnect[10];
+ anArray[11] = aConnect[11];
+ anArray[12] = aConnect[12];
+ case MED::ePYRA5:
anArray[0] = aConnect[0];
anArray[1] = aConnect[3];
anArray[2] = aConnect[2];