Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Aki and Richard's convention test currently compares the upper and lower left and right-hand edges of a complex fault. Though this works well in most cases, there are some instances in which a fault source will fail the check even when it is correctly specified, as shown in the example figure.
![image](https://private-user-images.githubusercontent.com/37081055/322466562-1564b0fa-5d8c-4aa7-8b5a-82c0732ea425.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzNzY4NTksIm5iZiI6MTcyMjM3NjU1OSwicGF0aCI6Ii8zNzA4MTA1NS8zMjI0NjY1NjItMTU2NGIwZmEtNWQ4Yy00YWE3LThiNWEtODJjMDczMmVhNDI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMwVDIxNTU1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmZTQ1MDQxYTI3MmZkNDdmZjM2MjY0NDExZTljMThmYzgwNDM1ZDc1Zjg0NzlkYzJmNjRjZjNkNmFjMmYzMDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aBt4lIij9GsXb3itWUTzmVI0Lz-Gb9-65AZZ869wrc4)
In the example, the fault surface is created in the mbtk sub function, which also checks that the edges are correctly specified while constructing the fault surface. If we have a lot of curvature in the complex fault surface, taking the corners of the surface for calculating the cross-products gives a sort of averaged normal to the surface which is greater than 90 and therefore fails the check.
As an alternative, we can check that two adjacent edges follow the Aki and Richard's convention instead of checking the entire fault surface. If we want to be really certain, we could check the first two and last two edges, but I think it's unlikely that a fault surface will have flipped half way through.
Related to GEMScienceTools/oq-mbtk#395