Skip to content

feat: Adding a fault stability analysis workflow#232

Open
paloma-martinez wants to merge 13 commits intomainfrom
pmartinez/feature/faultStabilityVisu
Open

feat: Adding a fault stability analysis workflow#232
paloma-martinez wants to merge 13 commits intomainfrom
pmartinez/feature/faultStabilityVisu

Conversation

@paloma-martinez
Copy link
Collaborator

This PR will add a post-processing workflow to analyze the fault stability and plot various results.

@paloma-martinez paloma-martinez marked this pull request as ready for review March 5, 2026 10:56
@paloma-martinez paloma-martinez added the test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI label Mar 5, 2026
Copy link
Contributor

@RomainBaville RomainBaville left a comment

Choose a reason for hiding this comment

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

Thanks for the job.
I made some suggestion but I have two additionnal global comment:
There is some caracter in the code that can lead to issues (greek letters, emoticon, arrows). To avoid that, you may change them.
In your code, some warning can be convert to error and the error managment can be updated (raise and not log error, use the CountVerbosityHandler ...)

outputDir (str): Output directory
outputFiles (list[tuple[int, str]]): List containing all the filenames of the PVD files
"""
pvdPath = os.path.join( outputDir, 'fault_analysis.pvd' )
Copy link
Contributor

Choose a reason for hiding this comment

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

You may add as an argument the new file name path

dict[str, Any]: Dictionary containing local stress, normal stress, shear stress and strike and shear dip.
"""
# Verify orthonormality
assert np.abs( np.linalg.norm( tangent1 ) - 1.0 ) < 1e-10, f"T1 - {np.abs( np.linalg.norm( tangent1 ) - 1.0 )}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of using assert, you may raise error if the condition is not verified


These methods include:
- filling partial VTK arrays with values (useful for block merge)
- creation of new VTK array, empty or with a given data array
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- creation of new VTK array, empty or with a given data array
- modification of the value of a VTK array


def computeNormals(
surface: vtkPolyData,
pointNormals: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have you add pointNormals arguments ? It is not used in the function.

"""Extract surface from an input mesh.

Args:
mesh: Input mesh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mesh: Input mesh
mesh (vtkUnstructuredGrid): Input mesh

# COMPUTE SCU ANALYTICALLY (Mohr-Coulomb)
# ===================================================================
mu = np.tan( np.radians( frictionAngle ) )

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for the greek letters

nUnstable = np.sum( SCUAnalyticalArr >= 1.0 )

if nValid > 0:
self.logger.info(
Copy link
Contributor

Choose a reason for hiding this comment

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

The message needs to be updated to add \n at the end of the line and remove greek letters

# Generate filename
vtuFilename = f"principal_stresses_{timestep:05d}.vtu"
vtuPath = self.vtuOutputDir / vtuFilename

Copy link
Contributor

Choose a reason for hiding this comment

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

self.vtuOutpuDir already contains 'principal_stress'


pvdPath = self.vtuOutputDir / filename

self.logger.info( f"\n💾 Creating PVD collection: {pvdPath}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.logger.info( f"\n💾 Creating PVD collection: {pvdPath}"
self.logger.info( f"💾 Creating PVD collection: {pvdPath}\n"

tree = ElementTree( root )
tree.write( str( pvdPath ), encoding='utf-8', xml_declaration=True )

self.logger.info( " ✅ PVD file created successfully"
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the message with the '\n' at the end of the line 713, 714 and 715

Copy link
Contributor

@RomainBaville RomainBaville left a comment

Choose a reason for hiding this comment

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

Thanks for the job.
I made some suggestion but I have two additionnal global comment:
There is some caracter in the code that can lead to issues (greek letters, emoticon, arrows). To avoid that, you may change them.
In your code, some warning can be convert to error and the error managment can be updated (raise and not log error, use the CountVerbosityHandler ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants