mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Performance: Use OpenMP for fault calculations
This commit is contained in:
parent
366c3cd2e8
commit
d3456ffcc9
@ -227,7 +227,8 @@ void RigMainGrid::calculateFaults()
|
|||||||
RigFault * unNamedFault = new RigFault;
|
RigFault * unNamedFault = new RigFault;
|
||||||
int unNamedFaultIdx = static_cast<int>(m_faults.size());
|
int unNamedFaultIdx = static_cast<int>(m_faults.size());
|
||||||
|
|
||||||
for (size_t gcIdx = 0 ; gcIdx < m_cells.size(); ++gcIdx)
|
#pragma omp parallel for
|
||||||
|
for (int gcIdx = 0 ; gcIdx < static_cast<int>(m_cells.size()); ++gcIdx)
|
||||||
{
|
{
|
||||||
if ( m_cells[gcIdx].isInvalid())
|
if ( m_cells[gcIdx].isInvalid())
|
||||||
{
|
{
|
||||||
@ -297,10 +298,14 @@ void RigMainGrid::calculateFaults()
|
|||||||
// Add as fault face only if the grid index is less than the neighbors
|
// Add as fault face only if the grid index is less than the neighbors
|
||||||
|
|
||||||
if (gcIdx < neighborGlobalCellIdx)
|
if (gcIdx < neighborGlobalCellIdx)
|
||||||
|
{
|
||||||
|
#pragma omp critical
|
||||||
{
|
{
|
||||||
RigFault::FaultFace ff(gcIdx, cvf::StructGridInterface::FaceType(faceIdx), neighborGlobalCellIdx);
|
RigFault::FaultFace ff(gcIdx, cvf::StructGridInterface::FaceType(faceIdx), neighborGlobalCellIdx);
|
||||||
unNamedFault->faultFaces().push_back(ff);
|
unNamedFault->faultFaces().push_back(ff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CVF_FAIL_MSG("Found fault with global neighbor index less than the native index. "); // Should never occur. because we flag the opposite face in the faultsPrCellAcc
|
CVF_FAIL_MSG("Found fault with global neighbor index less than the native index. "); // Should never occur. because we flag the opposite face in the faultsPrCellAcc
|
||||||
|
Loading…
Reference in New Issue
Block a user