GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
210 stars 84 forks source link

refactor: Move particle generators to their own folder #3068

Open TotoGaz opened 6 months ago

TotoGaz commented 6 months ago

Remove the dependency (and the transitive dependencies) to SpatialPartition in the mesh/generators "package".

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 71.49758% with 59 lines in your changes missing coverage. Please review.

Project coverage is 55.74%. Comparing base (949a758) to head (a0b4a29). Report is 26 commits behind head on develop.

Files Patch % Lines
...Components/mesh/generators/PartitionDescriptor.cpp 78.26% 20 Missing :warning:
...h/particleGenerators/ParticleMeshGeneratorBase.cpp 15.78% 16 Missing :warning:
src/coreComponents/mesh/MeshManager.cpp 59.37% 13 Missing :warning:
...onents/mesh/mpiCommunications/SpatialPartition.cpp 20.00% 4 Missing :warning:
...ents/mesh/generators/InternalWellboreGenerator.cpp 0.00% 3 Missing :warning:
...Components/mesh/generators/PartitionDescriptor.hpp 77.77% 2 Missing :warning:
.../mesh/particleGenerators/ParticleMeshGenerator.cpp 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3068 +/- ## =========================================== + Coverage 55.71% 55.74% +0.03% =========================================== Files 1031 1034 +3 Lines 87698 87820 +122 =========================================== + Hits 48863 48959 +96 - Misses 38835 38861 +26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TotoGaz commented 5 months ago

Hello @cmcrook5 @homel1

I've tried to split the Particle mesh specials from the standard ones. To do so I've move all the Particle* classes to the particleGenerators folder (plus some other tweaks). The architecture is kind of clearer also: what's dedicated to particles is clearly located.

Still remains this question of SpatialPartition which embeds some specific elements for particles. I've tried to separate by adding a PartitionDescriptor (which also duplicates a little bit of code, which can be acceptable as a temporary solution) It's working for serial mpm simulations, but for parallel, in some cases yes, in other cases no. It's more random. My guess is that in the MeshManager::generateMeshes we transfer the result from the new PartitionDescriptor to the SpatialPartition, but something's wrong in there. Other than that, the failing tests (on the CI) are

FAILED:  3 python3(impermeableFault_smoke_01_2_restartcheck), python3(permeableFault_smoke_01_2_restartcheck), python3(mpm_singleParticle_01_2_restartcheck)
TIMEOUT:  3 geosx(pennyShapedToughnessDominated_smoke_01_1_geos), geosx(pennyShapedViscosityDominated_smoke_01_1_geos), geosx(pknViscosityDominated_smoke_01_1_geos)

which tend to indicate that it's not so bad since currently

FAILED:  2 python3(impermeableFault_smoke_01_2_restartcheck), python3(permeableFault_smoke_01_2_restartcheck)
TIMEOUT:  3 geosx(pennyShapedToughnessDominated_smoke_01_1_geos), geosx(pennyShapedViscosityDominated_smoke_01_1_geos), geosx(pknViscosityDominated_smoke_01_1_geos)

are known to fail.

Is there any chance that you can handle this refactoring? Maybe you can find what needs to be updated. Or if necessary handle some inheritance to deal with your partitioning? We can discuss it when you're ready.

cmcrook5 commented 5 months ago

@TotoGaz I pulled your branch and I'm trying to take a look at why the single particle test is failing. However, I'm having some trouble building your branch. I get the follolwing error:

In file included from /usr/WS1/crook5/GEOS_PR/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.cpp:34:
/usr/WS1/crook5/GEOS_PR/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsEmbeddedFractures.hpp:117:27: error: use of undeclared
      identifier 'HYPRE_MGRSetFSolverAtLevel'
    GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetFSolverAtLevel( 1, precond.ptr, mgrData.mechSolver.ptr ) );
                          ^
In file included from /usr/WS1/crook5/GEOS_PR/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.cpp:35:
/usr/WS1/crook5/GEOS_PR/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/SinglePhasePoromechanicsConformingFractures.hpp:124:27: error: use of undeclared
      identifier 'HYPRE_MGRSetFSolverAtLevel'
    GEOS_LAI_CHECK_ERROR( HYPRE_MGRSetFSolverAtLevel( 1, precond.ptr, mgrData.mechSolver.ptr ) );
                          ^
TotoGaz commented 5 months ago

Hi @cmcrook5 thanks you for your actions! Are you using the latest version of the TPLs?

TotoGaz commented 5 months ago

Hello @cmcrook5 did you manage to compile the branch?

cmcrook5 commented 5 months ago

@TotoGaz yes, I was able to after updating the TPLs, thanks.

TotoGaz commented 3 months ago

@ryar9534 So I was not able to get this merged before I leave and I'm afraid I'll have to tell you what the incentive was... 😢

@herve-gross

ryar9534 commented 3 months ago

@ryar9534 So I was not able to get this merged before I leave and I'm afraid I'll have to tell you what the incentive was... 😢

@herve-gross

hehe thats fine, Ill take it over - We can discuss this tomorrow as well (if its convenient for you)

ryar9534 commented 3 months ago

@cmcrook5 @homel1 To confirm - does this PR still work on your end? I am taking over much of Thomas' work, and so I will begin to go through this in detail and set of the PR for review, etc.

cmcrook5 commented 2 months ago

@cmcrook5 @homel1 To confirm - does this PR still work on your end? I am taking over much of Thomas' work, and so I will begin to go through this in detail and set of the PR for review, etc.

Yes, I have another branch which I will create a PR for that depends on this one and includes periodic boundaries for our solver.