-
Notifications
You must be signed in to change notification settings - Fork 239
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
Create an original.wb when running ASPECT with the World Builder #6137
Merged
tjhei
merged 3 commits into
geodynamics:main
from
danieldouglas92:add_original_worldbuilder_file
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Added: When using the Geodynamic World Builder, ASPECT will create a file | ||
called 'original.wb' in the output directory which contains the exact | ||
worldbuilder file used to run the ASPECT model. | ||
<br> | ||
(Daniel Douglas, 2024/11/06) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# test that output/original.wb is written correctly | ||
|
||
# based on world_builder_simple.prm: | ||
include $ASPECT_SOURCE_DIR/tests/world_builder_simple.prm | ||
set World builder file = $ASPECT_SOURCE_DIR/tests/world_builder_simple.wb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"version":"1.0", | ||
"cross section":[[0,0],[100,0]], | ||
"features": | ||
[ | ||
{"model":"oceanic plate", "name":"oceanic plate", "coordinates":[[-1e3,-1e3],[1150e3,-1e3],[1150e3,1e3],[-1e3,1e3]], | ||
"temperature models":[{"model":"plate model", "max depth":95e3, "bottom temperature":1600, "spreading velocity":0.005, "ridge coordinates":[[[100e3,-1e3],[100e3,1e3]]]}], | ||
"composition models":[{"model":"uniform", "compositions":[0], "max depth":10e3}, | ||
{"model":"uniform", "compositions":[1], "min depth":10e3, "max depth":95e3}]}, | ||
|
||
{"model":"continental plate", "name":"continental plate", "coordinates":[[1150e3,-1e3],[2001e3,-1e3],[2001e3,1e3],[1150e3,1e3]], | ||
"temperature models":[{"model":"linear", "max depth":95e3, "bottom temperature":1600}], | ||
"composition models":[{"model":"uniform", "compositions":[2], "max depth":30e3}, | ||
{"model":"uniform", "compositions":[3], "min depth":30e3, "max depth":65e3}]}, | ||
|
||
{"model":"mantle layer", "name":"upper mantle", "min depth":95e3, "max depth":660e3, "coordinates":[[-1e3,-1e3],[2001e3,-1e3],[2001e3,1e3],[-1e3,1e3]], | ||
"temperature models":[{"model":"linear", "min depth":95e3, "max depth":660e3, "top temperature":1600, "bottom temperature":1820}], | ||
"composition models":[{"model":"uniform", "compositions":[4]}]}, | ||
|
||
{"model":"mantle layer", "name":"lower mantle", "min depth":660e3, "max depth":1160e3, "coordinates":[[-1e3,-1e3],[2001e3,-1e3],[2001e3,1e3],[-1e3,1e3]], | ||
"temperature models":[{"model":"linear", "min depth":660e3, "max depth":1160e3, "top temperature":1820, "bottom temperature":2000}], | ||
"composition models":[{"model":"uniform", "compositions":[5]}]}, | ||
|
||
{"model":"subducting plate", "name":"Subducting plate", "coordinates":[[1150e3,-1e3],[1150e3,1e3]], "dip point":[2000e3,0], | ||
"segments":[{"length":200e3, "thickness":[95e3], "angle":[0,45]}, {"length":200e3, "thickness":[95e3], "angle":[45]}, | ||
{"length":200e3, "thickness":[95e3], "angle":[45,0]}, {"length":100e3, "thickness":[95e3], "angle":[0]}], | ||
"temperature models":[{"model":"plate model", "density":3300, "plate velocity":0.01, "adiabatic heating":false}], | ||
"composition models":[{"model":"uniform", "compositions":[0], "max distance slab top":10e3}, | ||
{"model":"uniform", "compositions":[1], "min distance slab top":10e3, "max distance slab top":95e3 }]} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 1: Time step number | ||
# 2: Time (seconds) | ||
# 3: Time step size (seconds) | ||
# 4: Number of mesh cells | ||
# 5: Number of Stokes degrees of freedom | ||
# 6: Number of temperature degrees of freedom | ||
# 7: Number of degrees of freedom for all compositions | ||
# 8: Iterations for temperature solver | ||
# 9: Iterations for composition solver 1 | ||
# 10: Iterations for Stokes solver | ||
# 11: Velocity iterations in Stokes preconditioner | ||
# 12: Schur complement iterations in Stokes preconditioner | ||
# 13: Visualization file name | ||
0 0.000000000000e+00 0.000000000000e+00 1024 9539 4225 4225 0 0 36 38 38 output-original_wb/solution/solution-00000 |
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.
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.
why binary? these files are text files or not?
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 don't think it really matters. My rational was (besides that was what an exampled I find used) that since we need to read it into a stream and directly out into another stream, we don't need it to be converted to text mode by the stream and it can just copy the bites. But am not sure if this is how it really works internally and I don't really think it matters.
From https://en.cppreference.com/w/cpp/io/c/FILE#Binary_and_text_modes:
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.
This was @MFraters suggested edits so he can correct me if I'm wrong, but to my understanding setting
std::ios::binary
doesn't define the file format, but that you want to copy theworld_builder_file
as it exists in memory to the output file without modifying the contents ofworld_builder_file
.This code does work as expected and outputs the contents of the input worldbuilder file exactly as it was input into ASPECT.
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.
Oh I didn't see that you had already replied Menno 😄
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 agree that there is no harm in doing it as binary (unmodified) data.