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

Implement segmented ridges with flexible positioning #153

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

adbayonao
Copy link

@adbayonao adbayonao commented Dec 11, 2024

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.

Screenshot from 2025-01-08 07-11-10
Screenshot from 2025-01-08 07-10-44

@adbayonao adbayonao closed this Dec 11, 2024
@adbayonao adbayonao reopened this Dec 11, 2024
@boriskaus
Copy link
Member

boriskaus commented Dec 11, 2024

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)

# 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
Copy link
Member

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")

Copy link
Author

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.

@adbayonao adbayonao changed the title Contribution_1 Add 3D Polygon for Defining Phase and Temperature Based on Coordinates Dec 11, 2024
@boriskaus
Copy link
Member

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?
And is it perhaps possible to extend the existing routine (and test file)?

@adbayonao
Copy link
Author

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? And is it perhaps possible to extend the existing routine (and test file)?

I am going to try to extend the existing routine to add the new functionality

@adbayonao
Copy link
Author

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)

Ok, thank you. I changed the title.

@adbayonao adbayonao marked this pull request as draft December 12, 2024 13:38
@adbayonao adbayonao changed the title Add 3D Polygon for Defining Phase and Temperature Based on Coordinates Implement segmented ridges with thermal profile and flexible positioning Jan 8, 2025
@adbayonao adbayonao changed the title Implement segmented ridges with thermal profile and flexible positioning Implement segmented ridges and flexible positioning Jan 8, 2025
@adbayonao adbayonao changed the title Implement segmented ridges and flexible positioning Implement segmented ridges with flexible positioning Jan 8, 2025
@adbayonao adbayonao marked this pull request as ready for review January 8, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants