-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement segmented ridges with flexible positioning #153
base: main
Are you sure you want to change the base?
Conversation
…d Contribution_2 with another script
thanks for your contribution - can you make the title of this PR a bit clearer so it reflects what this is about? Also, if it is not yet ready to be reviewed you can mark it as draft (upper right corner) |
Contribution_1/Polygon3D.jl
Outdated
# This script creates 3D polygons from "x" and "y" coordinates, and allows you to define a depth range for the polygon. | ||
# It assigns phase and temperature values to the grid within the polygon. | ||
|
||
using GeophysicalModelGenerator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want this routine to be accessible in the GMG package, this file needs two be loaded in one of the other files with include("Polygon3D.jl")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to review this.
Note that we have a function add_polygon! already with test defined in test/test_setup_geometry.jl. Which functionality does this PR add that is not yet possible with the existing routine? |
I am going to try to extend the existing routine to add the new functionality |
Ok, thank you. I changed the title. |
I added a new feature to the compute_thermal_structure function by creating an additional function that allows for the creation of segmented ridges. Previously, only a single ridge segment could be placed at the boundary of the box. Now, it is possible to position the ridge at any location within the domain, and the ridge can consist of multiple segments. Each segment has its own thermal profile.
The new functionality works as follows: First, the coordinates of the ridge segments are used, where each segment has two parts: the start and end coordinates. Using these coordinates, delimiters are created, where the end of one segment aligns with the start of the next. These delimiters divide the domain into distinct regions, with each region corresponding to a specific ridge segment. To assign coordinates to these regions, the function determines which side of each delimiter a given point lies on, considering the direction of the delimiter. Once the domain is divided, the perpendicular distance from each point to the corresponding ridge segment is calculated, which in turn generates the thermal profile for that region. Each region is influenced by only one ridge segment.
This new functionality was implemented using multiple dispatch. Depending on the parameters provided by the user, either the original or the new version of the function is executed. This allows the function to handle both single ridge segment configurations and multiple segment configurations, providing greater flexibility in modeling ridge structures.
Additionally, I modified the add_box function to integrate this new feature, enabling the inclusion of segmented ridges within the box configuration.