#3807 Initial implementation of GeoMech contour maps.

This commit is contained in:
Gaute Lindkvist
2019-01-16 10:51:43 +01:00
parent aed0de8a2b
commit 1f754f2b63
34 changed files with 2108 additions and 525 deletions

View File

@@ -342,10 +342,28 @@ cvf::BoundingBox RigFemPart::boundingBox() const
//--------------------------------------------------------------------------------------------------
void RigFemPart::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices) const
{
ensureIntersectionSearchTreeIsBuilt();
findIntersectingCellsWithExistingSearchTree(inputBB, elementIndices);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFemPart::findIntersectingCellsWithExistingSearchTree(const cvf::BoundingBox& inputBB,
std::vector<size_t>* elementIndices) const
{
CVF_ASSERT(m_elementSearchTree.notNull());
m_elementSearchTree->findIntersections(inputBB, elementIndices);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFemPart::ensureIntersectionSearchTreeIsBuilt() const
{
// build tree
if (m_elementSearchTree.isNull())
{
// build tree
size_t elmCount = elementCount();
std::vector<cvf::BoundingBox> cellBoundingBoxes;
@@ -353,7 +371,7 @@ void RigFemPart::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vec
for (size_t elmIdx = 0; elmIdx < elmCount; ++elmIdx)
{
const int* cellIndices = connectivities(elmIdx);
const int* cellIndices = connectivities(elmIdx);
cvf::BoundingBox& cellBB = cellBoundingBoxes[elmIdx];
cellBB.add(m_nodes.coordinates[cellIndices[0]]);
cellBB.add(m_nodes.coordinates[cellIndices[1]]);
@@ -368,8 +386,6 @@ void RigFemPart::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vec
m_elementSearchTree = new cvf::BoundingBoxTree;
m_elementSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, nullptr);
}
m_elementSearchTree->findIntersections(inputBB, elementIndices);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -82,6 +82,9 @@ public:
float characteristicElementSize() const;
const std::vector<int>& possibleGridCornerElements() const { return m_possibleGridCornerElements; }
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices) const;
void findIntersectingCellsWithExistingSearchTree(const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices) const;
void ensureIntersectionSearchTreeIsBuilt() const;
cvf::Vec3f faceNormal(int elmentIndex, int faceIndex) const;

View File

@@ -1499,6 +1499,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateCompactionValues
RigFemScalarResultFrames* compactionFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
const RigFemPart* part = m_femParts->part(partIndex);
part->ensureIntersectionSearchTreeIsBuilt();
for (int t = 0; t < u3Frames->frameCount(); t++)
{
std::vector<float>& compactionFrame = compactionFrames->frameData(t);