From f1555ab019050e41080992f0cff8409a76bcfc74 Mon Sep 17 00:00:00 2001 From: Matteo Cusini Date: Wed, 15 Jan 2025 17:36:10 -0800 Subject: [PATCH] Fixed CI computation. --- .../TwoPointFluxApproximation.cpp | 6 ++--- ...mbeddedSurfacesParallelSynchronization.cpp | 3 ++- ...mbeddedSurfacesParallelSynchronization.hpp | 1 + .../mesh/generators/VTKUtilities.cpp | 8 +++---- .../mesh/utilities/CIcomputationKernel.hpp | 24 +++++++++---------- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/coreComponents/finiteVolume/TwoPointFluxApproximation.cpp b/src/coreComponents/finiteVolume/TwoPointFluxApproximation.cpp index 20d6f74f612..ef0ca8e5fc3 100644 --- a/src/coreComponents/finiteVolume/TwoPointFluxApproximation.cpp +++ b/src/coreComponents/finiteVolume/TwoPointFluxApproximation.cpp @@ -92,7 +92,7 @@ void TwoPointFluxApproximation::computeFractureStencil( MeshLevel & mesh ) const string const & regionName = region.getName(); addFractureFractureConnectionsDFM( mesh, regionName ); addFractureMatrixConnectionsDFM( mesh, regionName ); - } else if ( region.subRegionType() == SurfaceElementRegion::SurfaceSubRegionType::embeddedSurfaceElement ) + } else if ( region.subRegionType() == SurfaceElementRegion::SurfaceSubRegionType::embeddedElement ) { string const & regionName = region.getName(); addFractureFractureConnectionsEDFM( mesh, regionName ); @@ -553,7 +553,7 @@ void TwoPointFluxApproximation::addFractureMatrixConnectionsEDFM( MeshLevel & me EmbeddedSurfaceSubRegion & fractureSubRegion = fractureRegion.getUniqueSubRegion< EmbeddedSurfaceSubRegion >(); - computeConnectivityIndex( elemManager, mesh.getNodeManager();, embeddedSurfaceSubRegion ); + computeConnectivityIndex( elemManager, mesh.getNodeManager(), fractureSubRegion ); ElementRegionManager::ElementViewAccessor< arrayView1d< real64 const > > hydraulicAperture = elemManager.constructViewAccessor< array1d< real64 >, arrayView1d< real64 const > >( fields::flow::hydraulicAperture::key() ); @@ -623,7 +623,7 @@ void TwoPointFluxApproximation::computeConnectivityIndex( ElementRegionManager & { auto kernelVariant = createKernel( subRegion.getElementType(), nodeManager, subRegion, embeddedSurfaceSubRegion ); - std::visit( [&] ( auto & kernel ) + std::visit( [&] ( auto kernel ) { using KERNEL_TYPE = decltype( kernel ); KERNEL_TYPE::template launchCIComputationKernel< parallelDevicePolicy< >, KERNEL_TYPE >( kernel ); diff --git a/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.cpp b/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.cpp index 26d1c5fe380..8d75728d8e6 100644 --- a/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.cpp +++ b/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.cpp @@ -25,7 +25,8 @@ #include "mesh/MeshFields.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" #include "mesh/mpiCommunications/MPI_iCommData.hpp" - +#include "mesh/mpiCommunications/NeighborCommunicator.hpp" +#include "mesh/MeshLevel.hpp" namespace geos { diff --git a/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.hpp b/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.hpp index b69403705b1..1740e7f2c08 100644 --- a/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.hpp +++ b/src/coreComponents/mesh/EmbeddedSurfacesParallelSynchronization.hpp @@ -21,6 +21,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SURFACEGENERATION_EMBEDDEDSURFACESPARALLELSYNCHRONIZATION_HPP_ #define GEOS_PHYSICSSOLVERS_SURFACEGENERATION_EMBEDDEDSURFACESPARALLELSYNCHRONIZATION_HPP_ +#include "common/DataTypes.hpp" namespace geos { diff --git a/src/coreComponents/mesh/generators/VTKUtilities.cpp b/src/coreComponents/mesh/generators/VTKUtilities.cpp index 9487838b13c..bb7b588c52f 100644 --- a/src/coreComponents/mesh/generators/VTKUtilities.cpp +++ b/src/coreComponents/mesh/generators/VTKUtilities.cpp @@ -696,11 +696,11 @@ AllMeshes redistributeByCellGraph( AllMeshes & input, finalFractures[fractureName] = finalFracMesh; } + // Matteo: Create edfmMeshPartitions using newPartitions and the map between the global cell ids and the global edfm fracture cell ids + // vtkSmartPointer< vtkPartitionedDataSet > const edfmSplitMesh = splitMeshByPartition( input.getEmbeddedSurfaceBlocks(), numRanks, edfmMeshPartitions.toViewConst() ); + // vtkSmartPointer< vtkUnstructuredGrid > finalEDFMMesh = vtk::redistribute( *edfmSplitMesh, MPI_COMM_GEOS ); // Ouassim: just add the edfm mesh at the moment and see. - // Create edfmMeshPartitions using newPartitions and the map between the global cell ids and the global edfm fracture cell ids - vtkSmartPointer< vtkPartitionedDataSet > const edfmSplitMesh = splitMeshByPartition( input.getEmbeddedSurfaceBlocks(), numRanks, edfmMeshPartitions.toViewConst() ); - vtkSmartPointer< vtkUnstructuredGrid > finalEDFMMesh = vtk::redistribute( *edfmSplitMesh, MPI_COMM_GEOS ); - // auto edfmMesh = input.getEmbeddedSurfaceBlocks(); + auto finalEDFMMesh = input.getEmbeddedSurfaceBlocks(); return AllMeshes( finalMesh, finalFractures, finalEDFMMesh ); } diff --git a/src/coreComponents/mesh/utilities/CIcomputationKernel.hpp b/src/coreComponents/mesh/utilities/CIcomputationKernel.hpp index 58d63f577ca..42eb0850fdc 100644 --- a/src/coreComponents/mesh/utilities/CIcomputationKernel.hpp +++ b/src/coreComponents/mesh/utilities/CIcomputationKernel.hpp @@ -232,10 +232,11 @@ class CIcomputationKernel arrayView1d< real64 > const m_connectivityIndex; }; -using KernelVariant = std::variant< CIcomputationKernel< H1_Hexahedron_Lagrange1_GaussLegendre2 >, - CIcomputationKernel< H1_Wedge_Lagrange1_Gauss6 >, - CIcomputationKernel< H1_Tetrahedron_Lagrange1_Gauss1 >, - CIcomputationKernel< H1_Pyramid_Lagrange1_Gauss5 > >; +using KernelVariant = std::variant< CIcomputationKernel< finiteElement::H1_Hexahedron_Lagrange1_GaussLegendre2 >, + CIcomputationKernel< finiteElement::H1_Wedge_Lagrange1_Gauss6 >, + CIcomputationKernel< finiteElement::H1_Tetrahedron_Lagrange1_Gauss1 >, + CIcomputationKernel< finiteElement::H1_Pyramid_Lagrange1_Gauss5 > >; + KernelVariant createKernel( ElementType elemType, NodeManager const & nodeManager, @@ -245,16 +246,15 @@ KernelVariant createKernel( ElementType elemType, switch ( elemType ) { case ElementType::Tetrahedron: - return CIcomputationKernel( nodeManager, subRegion, esr ); + return CIcomputationKernel( nodeManager, subRegion, esr ); case ElementType::Hexahedron: - return CIcomputationKernel( nodeManager, subRegion, esr ); - case ElementType::Pyramid - return CIcomputationKernel( nodeManager, subRegion, esr ); - case ElementType::Wedge - return CIcomputationKernel( nodeManager, subRegion, esr ); + return CIcomputationKernel( nodeManager, subRegion, esr ); + case ElementType::Pyramid: + return CIcomputationKernel( nodeManager, subRegion, esr ); + case ElementType::Wedge: + return CIcomputationKernel( nodeManager, subRegion, esr ); default: - GEOS_ERROR( "Unknown element type" ); - return {}; + GEOS_THROW( "Element type not supported", std::runtime_error ); } }