mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#513) Added a HEX8P element type to distinguish C3D8 and C3D8P
This commit is contained in:
@@ -296,7 +296,7 @@ float RigFemPart::characteristicElementSize()
|
||||
{
|
||||
RigElementType eType = this->elementType(elmIdx);
|
||||
|
||||
if (eType == HEX8)
|
||||
if (eType == HEX8 || eType == HEX8P)
|
||||
{
|
||||
const int* elmentConn = this->connectivities(elmIdx);
|
||||
cvf::Vec3f nodePos0 = this->nodes().coordinates[elmentConn[0]];
|
||||
|
||||
@@ -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
|
||||
cvf::Vec3f mainElmDirections[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[1] = normals[2] - normals[3];
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RigFemTypes::elmentNodeCount(RigElementType elmType)
|
||||
{
|
||||
static int elementTypeCounts[2] ={ 8, 4 };
|
||||
static int elementTypeCounts[3] ={ 8, 8, 4 };
|
||||
|
||||
return elementTypeCounts[elmType];
|
||||
}
|
||||
@@ -37,7 +37,7 @@ int RigFemTypes::elmentNodeCount(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];
|
||||
}
|
||||
@@ -63,6 +63,7 @@ const int* RigFemTypes::localElmNodeIndicesForFace(RigElementType elmType, int f
|
||||
switch (elmType)
|
||||
{
|
||||
case HEX8:
|
||||
case HEX8P:
|
||||
(*faceNodeCount) = 4;
|
||||
return HEX8_Faces[faceIdx];
|
||||
break;
|
||||
@@ -85,6 +86,7 @@ int RigFemTypes::oppositeFace(RigElementType elmType, int faceIdx)
|
||||
switch (elmType)
|
||||
{
|
||||
case HEX8:
|
||||
case HEX8P:
|
||||
return HEX8_OppositeFaces[faceIdx];
|
||||
break;
|
||||
case CAX4:
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
enum RigElementType
|
||||
{
|
||||
HEX8,
|
||||
HEX8P,
|
||||
CAX4,
|
||||
UNKNOWN_ELM_TYPE
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ std::map<std::string, RigElementType> initFemTypeMap()
|
||||
std::map<std::string, RigElementType> typeMap;
|
||||
typeMap["C3D8R"] = HEX8;
|
||||
typeMap["C3D8"] = HEX8;
|
||||
typeMap["C3D8P"] = HEX8;
|
||||
typeMap["C3D8P"] = HEX8P;
|
||||
typeMap["CAX4"] = CAX4;
|
||||
|
||||
return typeMap;
|
||||
@@ -141,6 +141,7 @@ const int* localElmNodeToIntegrationPointMapping(RigElementType elmType)
|
||||
switch (elmType)
|
||||
{
|
||||
case HEX8:
|
||||
case HEX8P:
|
||||
return HEX8_Mapping;
|
||||
break;
|
||||
case CAX4:
|
||||
|
||||
@@ -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])
|
||||
{
|
||||
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 int* cornerIndices = femPart->connectivities(elmIdx);
|
||||
|
||||
@@ -59,7 +59,7 @@ void RigGeoMechWellLogExtractor::curveData(const RigFemResultAddress& resAddr, i
|
||||
size_t elmIdx = m_intersectedCells[cpIdx];
|
||||
RigElementType elmType = femPart->elementType(elmIdx);
|
||||
|
||||
if (elmType != HEX8) continue;
|
||||
if (!(elmType == HEX8 || elmType == HEX8P)) continue;
|
||||
|
||||
cvf::StructGridInterface::FaceType cellFace = m_intersectedCellFaces[cpIdx];
|
||||
|
||||
@@ -134,7 +134,8 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
|
||||
cvf::Vec3d hexCorners[8];
|
||||
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user