mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3807 Initial implementation of GeoMech contour maps.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user