(#513) Added a HEX8P element type to distinguish C3D8 and C3D8P

This commit is contained in:
Jacob Støren
2015-09-25 19:31:50 +02:00
parent aa36a3f5e6
commit 5097082f09
7 changed files with 14 additions and 8 deletions

View File

@@ -296,7 +296,7 @@ float RigFemPart::characteristicElementSize()
{ {
RigElementType eType = this->elementType(elmIdx); RigElementType eType = this->elementType(elmIdx);
if (eType == HEX8) if (eType == HEX8 || eType == HEX8P)
{ {
const int* elmentConn = this->connectivities(elmIdx); const int* elmentConn = this->connectivities(elmIdx);
cvf::Vec3f nodePos0 = this->nodes().coordinates[elmentConn[0]]; cvf::Vec3f nodePos0 = this->nodes().coordinates[elmentConn[0]];

View File

@@ -216,7 +216,7 @@ cvf::Vec3i RigFemPartGrid::findMainIJKFaces(int elementIndex) const
// Record three independent main direction vectors for the element, and what face they are created from // Record three independent main direction vectors for the element, and what face they are created from
cvf::Vec3f mainElmDirections[3]; cvf::Vec3f mainElmDirections[3];
int mainElmDirOriginFaces[3]; int mainElmDirOriginFaces[3];
if (eType == HEX8) if (eType == HEX8 || eType == HEX8P)
{ {
mainElmDirections[0] = normals[0] - normals[1]; // To get a better "average" direction vector mainElmDirections[0] = normals[0] - normals[1]; // To get a better "average" direction vector
mainElmDirections[1] = normals[2] - normals[3]; mainElmDirections[1] = normals[2] - normals[3];

View File

@@ -27,7 +27,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RigFemTypes::elmentNodeCount(RigElementType elmType) int RigFemTypes::elmentNodeCount(RigElementType elmType)
{ {
static int elementTypeCounts[2] ={ 8, 4 }; static int elementTypeCounts[3] ={ 8, 8, 4 };
return elementTypeCounts[elmType]; return elementTypeCounts[elmType];
} }
@@ -37,7 +37,7 @@ int RigFemTypes::elmentNodeCount(RigElementType elmType)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RigFemTypes::elmentFaceCount(RigElementType elmType) int RigFemTypes::elmentFaceCount(RigElementType elmType)
{ {
const static int elementFaceCounts[2] ={ 6, 1 }; const static int elementFaceCounts[3] ={ 6, 6, 1 };
return elementFaceCounts[elmType]; return elementFaceCounts[elmType];
} }
@@ -63,6 +63,7 @@ const int* RigFemTypes::localElmNodeIndicesForFace(RigElementType elmType, int f
switch (elmType) switch (elmType)
{ {
case HEX8: case HEX8:
case HEX8P:
(*faceNodeCount) = 4; (*faceNodeCount) = 4;
return HEX8_Faces[faceIdx]; return HEX8_Faces[faceIdx];
break; break;
@@ -85,6 +86,7 @@ int RigFemTypes::oppositeFace(RigElementType elmType, int faceIdx)
switch (elmType) switch (elmType)
{ {
case HEX8: case HEX8:
case HEX8P:
return HEX8_OppositeFaces[faceIdx]; return HEX8_OppositeFaces[faceIdx];
break; break;
case CAX4: case CAX4:

View File

@@ -23,6 +23,7 @@
enum RigElementType enum RigElementType
{ {
HEX8, HEX8,
HEX8P,
CAX4, CAX4,
UNKNOWN_ELM_TYPE UNKNOWN_ELM_TYPE
}; };

View File

@@ -104,7 +104,7 @@ std::map<std::string, RigElementType> initFemTypeMap()
std::map<std::string, RigElementType> typeMap; std::map<std::string, RigElementType> typeMap;
typeMap["C3D8R"] = HEX8; typeMap["C3D8R"] = HEX8;
typeMap["C3D8"] = HEX8; typeMap["C3D8"] = HEX8;
typeMap["C3D8P"] = HEX8; typeMap["C3D8P"] = HEX8P;
typeMap["CAX4"] = CAX4; typeMap["CAX4"] = CAX4;
return typeMap; return typeMap;
@@ -141,6 +141,7 @@ const int* localElmNodeToIntegrationPointMapping(RigElementType elmType)
switch (elmType) switch (elmType)
{ {
case HEX8: case HEX8:
case HEX8P:
return HEX8_Mapping; return HEX8_Mapping;
break; break;
case CAX4: case CAX4:

View File

@@ -366,7 +366,8 @@ int quadVxClosestToXYOfPoint( const cvf::Vec3d point, const cvf::Vec3d quad[4])
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool elementCorners(RigFemPart* femPart, int elmIdx, cvf::Vec3d elmCorners[8]) bool elementCorners(RigFemPart* femPart, int elmIdx, cvf::Vec3d elmCorners[8])
{ {
if (femPart->elementType(elmIdx) != HEX8) return false; RigElementType elmType = femPart->elementType(elmIdx);
if (!(elmType == HEX8 || elmType == HEX8P)) return false;
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates; const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
const int* cornerIndices = femPart->connectivities(elmIdx); const int* cornerIndices = femPart->connectivities(elmIdx);

View File

@@ -59,7 +59,7 @@ void RigGeoMechWellLogExtractor::curveData(const RigFemResultAddress& resAddr, i
size_t elmIdx = m_intersectedCells[cpIdx]; size_t elmIdx = m_intersectedCells[cpIdx];
RigElementType elmType = femPart->elementType(elmIdx); RigElementType elmType = femPart->elementType(elmIdx);
if (elmType != HEX8) continue; if (!(elmType == HEX8 || elmType == HEX8P)) continue;
cvf::StructGridInterface::FaceType cellFace = m_intersectedCellFaces[cpIdx]; cvf::StructGridInterface::FaceType cellFace = m_intersectedCellFaces[cpIdx];
@@ -134,7 +134,8 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
cvf::Vec3d hexCorners[8]; cvf::Vec3d hexCorners[8];
for (size_t ccIdx = 0; ccIdx < closeCells.size(); ++ccIdx) for (size_t ccIdx = 0; ccIdx < closeCells.size(); ++ccIdx)
{ {
if (femPart->elementType(closeCells[ccIdx]) != HEX8) continue; RigElementType elmType = femPart->elementType(closeCells[ccIdx]);
if (!(elmType == HEX8 || elmType == HEX8P)) continue;
const int* cornerIndices = femPart->connectivities(closeCells[ccIdx]); const int* cornerIndices = femPart->connectivities(closeCells[ccIdx]);