Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement EDFM loading from VTK (serial only) #3082

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from

Conversation

ouassimkh
Copy link

No description provided.

@ouassimkh ouassimkh requested review from TotoGaz and CusiniM April 16, 2024 15:04
@TotoGaz TotoGaz removed their request for review July 5, 2024 17:08
@ouassimkh ouassimkh force-pushed the Feature/ouassim/edfm_loader_new branch from 8dc1a32 to 041d290 Compare October 21, 2024 14:34
@ouassimkh ouassimkh changed the title Feature/ouassim/edfm loader new [Feat] Implement 2.5D EDFM loading from VTK (serial only) Oct 21, 2024
@ouassimkh ouassimkh changed the title [Feat] Implement 2.5D EDFM loading from VTK (serial only) feat: Implement 2.5D EDFM loading from VTK (serial only) Oct 21, 2024
@ouassimkh
Copy link
Author

ouassimkh commented Oct 21, 2024

Implement serial loading (fails on MPI) and tested it on a 2.5D EDFM case. Below is an input example containing 2 fracture elements:

  • fracture_ids_points: represent all the fracture patch point ids including shared points (no duplicates).
  • fracture_to_paren_matrix_cell_mapping: maps each edfm fracture element to matrix element.
  • permeability : fracture elements permeability (loaded but not used yet, we continue to use constant fracture props provided with CompressibleSolidParallelPlatesPermeability)
  • aperture: is fracture aperture
  • tangential_width_vectors, tangential_length_vectors and normal_vectors are the 3 principal vectors of a fracture patch plan.
  • connectivity: each patch is represented by a 4 points (quad).

image

<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <UnstructuredGrid>
    <Piece NumberOfPoints="6" NumberOfCells="2">
      <PointData>
        <DataArray type="Int32" Name="fracture_ids_points" NumberOfComponents="1" format="ascii">
         0
         1
         2
         3
         4
         5
        </DataArray>
      </PointData>
      <CellData>
        <DataArray type="Int32" Name="fracture_to_parent_matrix_cell_mapping" NumberOfComponents="2" format="ascii">
         0 4
         1 13
        </DataArray>
        <DataArray type="Float32" Name="permeability" NumberOfComponents="1" format="ascii" RangeMin="0.1" RangeMax="0.1">
          0.1
          0.1
        </DataArray>
        <DataArray type="Float32" Name="aperture" NumberOfComponents="1" format="ascii" RangeMin="0.0001" RangeMax="0.0001">
          0.0001
          0.0001
        </DataArray>
        <DataArray type="Float32" Name="tangential_width_vectors" NumberOfComponents="3" format="ascii">
          0 0 1
          0 0 1
        </DataArray>
        <DataArray type="Float32" Name="tangential_length_vectors" NumberOfComponents="3" format="ascii">
          0 1 0
          0 1 0
        </DataArray>
        <DataArray type="Float32" Name="normal_vectors" NumberOfComponents="3" format="ascii">
          1 0 0
          1 0 0
        </DataArray>
      </CellData>
      <Points>
        <DataArray type="Float32" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="0" RangeMax="1">
          0.5 0.3333 0
          0.5 0.6666 0
          0.5 0.3333 0.5
          0.5 0.6666 0.5
          0.5 0.3333 1
          0.5 0.6666 1
          <InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
            <Value index="0">
              0
            </Value>
            <Value index="1">
              1
            </Value>
          </InformationKey>
        </DataArray>
      </Points>
      <Cells>
        <DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="5">
        1 0 2 3
        3 2 4 5
        </DataArray>
        <DataArray type="Int64" Name="offsets" format="ascii" RangeMin="4" RangeMax="8">
          4
          8
        </DataArray>
        <DataArray type="UInt8" Name="types" format="ascii" RangeMin="9" RangeMax="9">
          9
          9
        </DataArray>
      </Cells>
    </Piece>
  </UnstructuredGrid>
</VTKFile>

@paveltomin
Copy link
Contributor

@CusiniM and @rrsettgast please have a look

@paveltomin paveltomin added flag: ready for review ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Dec 9, 2024
meshBody.deregisterCellBlockManager();
// Cell block manager is needed for EDFM loading from VTK
// Can't be deregistred here
//meshBody.deregisterCellBlockManager();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO restore that

Pavel Tomin added 2 commits December 9, 2024 17:52
@paveltomin
Copy link
Contributor

@CusiniM, @castelletto1, @corbett5, @jhuang2601, @rrsettgast, @untereiner, and/or @wrtobin please have a look

@paveltomin paveltomin removed the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Dec 12, 2024
@paveltomin paveltomin changed the title feat: Implement 2.5D EDFM loading from VTK (serial only) feat: Implement EDFM loading from VTK (serial only) Dec 12, 2024
@rrsettgast
Copy link
Member

@paveltomin @ouassimkh Please remember to post a copy of the error message you get in parallel. Thanks!

@paveltomin
Copy link
Contributor

@rrsettgast @CusiniM parallel run crash

Num ranks: 2
GEOS version: 1.1.0 (Feature/ouassim/edfm_loader_new, sha1: cec6ed26f)
  - c++ compiler: gcc 11.4.0
  - MPI version: Open MPI v4.1.2, package: Debian OpenMPI, ident: 4.1.2, repo rev: v4.1.2, Nov 24, 2021
  - HDF5 version: 1.12.1
  - Conduit version: 0.9.2
  - VTK version: 9.3.1
  - RAJA version: 2024.7.0
  - umpire version: 2024.07.0
  - chai version: 2024.7.0
  - METIS version: 5.1
  - PARAMETIS version: 4.0
  - scotch version: 7.0.3
  - superlu_dist version: 6.3.0
  - suitesparse version: 5.7.9
  - hypre version: 2.32.0
  - Python3 version: 3.10.12
Started at 2024-12-12 21:24:50.657031700
Opened XML file: /home/ptls/GEOS/GEOS/inputFiles/singlePhaseFlowFractures/fractureMatrixFlow_edfm_vtk_smoke.xml
Included additionnal XML file: /home/ptls/GEOS/GEOS/inputFiles/singlePhaseFlowFractures/fractureMatrixFlow_edfm_vtk.xml
Adding Mesh: VTKMesh, mesh1
Adding Geometric Object: Box, source
Adding Geometric Object: Box, sink
Adding Event: SoloEvent, preFracture
Adding Event: PeriodicEvent, solverApplications
Adding Event: PeriodicEvent, outputs
Adding Event: PeriodicEvent, restarts
Adding Output: VTK, vtkOutput
Adding Output: Restart, sidreRestart
Adding Solver of type SinglePhaseFVM, named SinglePhaseFlow
Adding Solver of type EmbeddedSurfaceGenerator, named SurfaceGenerator
Adding Object CellElementRegion named RockMatrix from ObjectManager::Catalog.
Adding Object SurfaceElementRegion named Fracture from ObjectManager::Catalog.
VTKMesh 'mesh1': reading mesh from /home/ptls/GEOS/GEOS/inputFiles/singlePhaseFlowFractures/main_edfm_vtk.vtm
Using global Ids defined in VTK mesh
VTKMesh 'mesh1': generating GEOSX mesh data structure
Received signal 11: Segmentation fault

** StackTrace of 11 frames **
Frame 0: /lib/x86_64-linux-gnu/libc.so.6 
Frame 1: geos::vtk::importEmbeddedFractureNetwork(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vtkSmartPointer<vtkDataSet>, vtkSmartPointer<vtkDataSet>, geos::CellBlockManager&) 
Frame 2: geos::VTKMeshGenerator::fillCellBlockManager(geos::CellBlockManager&, geos::SpatialPartition&) 
Frame 3: geos::MeshGeneratorBase::generateMesh(geos::dataRepository::Group&, geos::SpatialPartition&) 
Frame 4: geos::MeshManager::generateMeshes(geos::DomainPartition&) 
Frame 5: geos::ProblemManager::generateMesh() 
Frame 6: geos::ProblemManager::problemSetup() 
Frame 7: geos::GeosxState::initializeDataRepository() 
Frame 8: main 
Frame 9: /lib/x86_64-linux-gnu/libc.so.6 
Frame 10: __libc_start_main 
Frame 11: _start 
=====

--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
Received signal 15: Terminated

** StackTrace of 19 frames **
Frame 0: /lib/x86_64-linux-gnu/libc.so.6 
Frame 1: /lib/x86_64-linux-gnu/libopen-pal.so.40 
Frame 2: /lib/x86_64-linux-gnu/libopen-pal.so.40 
Frame 3: opal_progress 
Frame 4: ompi_request_default_wait 
Frame 5: ompi_coll_base_sendrecv_actual 
Frame 6: ompi_coll_base_allreduce_intra_recursivedoubling 
Frame 7: ompi_coll_tuned_allreduce_intra_dec_fixed 
Frame 8: PMPI_Allreduce 
Frame 9: geos::vtk::printMeshStatistics(vtkDataSet&, std::map<geos::ElementType, std::unordered_map<int, std::vector<long long, std::allocator<long long> >, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::vector<long long, std::allocator<long long> > > > >, std::less<geos::ElementType>, std::allocator<std::pair<geos::ElementType const, std::unordered_map<int, std::vector<long long, std::allocator<long long> >, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::vector<long long, std::allocator<long long> > > > > > > > const&, ompi_communicator_t*) 
Frame 10: geos::VTKMeshGenerator::fillCellBlockManager(geos::CellBlockManager&, geos::SpatialPartition&) 
Frame 11: geos::MeshGeneratorBase::generateMesh(geos::dataRepository::Group&, geos::SpatialPartition&) 
Frame 12: geos::MeshManager::generateMeshes(geos::DomainPartition&) 
Frame 13: geos::ProblemManager::generateMesh() 
Frame 14: geos::ProblemManager::problemSetup() 
Frame 15: geos::GeosxState::initializeDataRepository() 
Frame 16: main 
Frame 17: /lib/x86_64-linux-gnu/libc.so.6 
Frame 18: __libc_start_main 
Frame 19: _start 
=====

//1.Get EDFM vertices
vtkUnstructuredGrid * grid = vtkUnstructuredGrid::SafeDownCast( embeddedSurfaceMesh );
vtkPoints * const nodes = grid->GetPoints();
vtkIdType numNodes = nodes->GetNumberOfPoints();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parallel crash seems to happen here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason GetPoints is null for one of the two ranks

Rank 1:  grid->GetPoints() = 0x7fffca3fb8f0
Rank 0:  grid->GetPoints() = 0

@MelReyCG MelReyCG closed this Dec 16, 2024
@MelReyCG MelReyCG deleted the Feature/ouassim/edfm_loader_new branch December 16, 2024 14:22
@ouassimkh ouassimkh restored the Feature/ouassim/edfm_loader_new branch December 16, 2024 14:30
@ouassimkh
Copy link
Author

Just wondering why was the branch closed? is it merged ?

@paveltomin paveltomin reopened this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants