-
-
Notifications
You must be signed in to change notification settings - Fork 127
ASTE Turbine Tutorial #244
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
36f4a19
Add turbine blade tutorials for ASTE
kursatyurt 8824886
Add clean script
kursatyurt e4c3ace
Add permalink
kursatyurt 0aed83a
Rename folder
kursatyurt a5e10b4
Fix markdown
kursatyurt dc09b0a
Update language
kursatyurt eb1d7f8
Remove verbosity from extraction
kursatyurt d89d961
Use more compact script
kursatyurt fe43e4c
Add line to end for GitHub
kursatyurt a566003
Rmove config xml file comments
kursatyurt 1d92bb4
Merge branch 'aste_tutorial' of github.com:kursatyurt/tutorials into …
kursatyurt 90cec2e
Update readme
kursatyurt 6a01ee2
Remove ./ from scripts since they are in the path
kursatyurt d4d27fa
Expand cleaning script
kursatyurt d37981e
Update run.sh for new CLI
kursatyurt 422c5a5
Fix MDLint
kursatyurt 9cadd82
Update aste-turbine/precice.xml
kursatyurt 84202e3
Change filename
kursatyurt cf024a1
Add recovery data
kursatyurt b766360
Merge branch 'precice:master' into aste_tutorial
kursatyurt 0cde7d0
Update aste-turbine/README.md
kursatyurt a3dd5cf
Update aste-turbine/README.md
kursatyurt 06e9587
Change to eggholder function
kursatyurt 8c9552c
Fix for cleaning
kursatyurt 83b9c95
test meshes exist
kursatyurt ec2aeb5
Update README
kursatyurt 2874b70
Merge branches 'aste_tutorial' and 'aste_tutorial' of github.com:kurs…
kursatyurt 8a773c4
Adapt naming convention
kursatyurt e61e05c
Fix typo
kursatyurt 56e15e9
Config typo fix
kursatyurt 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 hidden or 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,29 @@ | ||
--- | ||
title: ASTE (Artificial Solver Testing Environment) Turbine Tutorial | ||
permalink: tutorials-aste-turbine.html | ||
keywords: ASTE, Testing, Turbine | ||
summary: This tutorial is an example case for ASTE, showcasing basic features and usage of ASTE. | ||
--- | ||
|
||
{% include note.html content="Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/aste-turbine). Read how in the [tutorials introduction](https://precice.org/tutorials.html)." %} | ||
|
||
## Setup | ||
|
||
This case is a simple usage scenario for ASTE. Some features demonstrated by this tutorial: | ||
|
||
* Mapping from a fine grid (`0.009.vtk`) to a coarse grid (`0.01.vtk`). | ||
* Usage of ASTE partitioner. | ||
* Usage of ASTE mesh joiner. | ||
* Usage of ASTE calculator for calculating a function on a given mesh. | ||
* Usage of ASTE. | ||
|
||
## Running ASTE | ||
|
||
Run the `run.sh` script. It performs the following steps: | ||
|
||
* Downloads the meshes from preCICE repository. | ||
* Using `vtk_calculator.py` script, calculates function `eggholder` on a finer grid. | ||
* Using `partition_mesh.py` script, partitions the coarse and fine mesh into 2 domains. | ||
* Using `preciceMap` executable, maps the data from the fine grid to the coarse grid. | ||
* Using `join_mesh.py`script, joins the result meshes into a final mesh. | ||
* Using ``vtk_calculator.py` script, calculates difference between mapped and original function on coarse grid. |
This file contains hidden or 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 @@ | ||
../tools/clean-tutorial-base.sh |
This file contains hidden or 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,53 @@ | ||
<?xml version="1.0"?> | ||
|
||
<precice-configuration> | ||
|
||
<log> | ||
<sink | ||
filter="%Severity% > debug and %Rank% = 0" | ||
format="---[precice] %ColorizedSeverity% %Message%" | ||
enabled="true" /> | ||
</log> | ||
|
||
<solver-interface dimensions="3"> | ||
|
||
<data:scalar name="Data" /> | ||
|
||
<mesh name="A-Mesh"> | ||
<use-data name="Data" /> | ||
</mesh> | ||
|
||
<mesh name="B-Mesh"> | ||
<use-data name="Data" /> | ||
</mesh> | ||
|
||
<m2n:sockets from="A" to="B" exchange-directory="." /> | ||
|
||
<participant name="A"> | ||
<use-mesh name="A-Mesh" provide="yes" /> | ||
<write-data name="Data" mesh="A-Mesh" /> | ||
</participant> | ||
|
||
<participant name="B"> | ||
<use-mesh name="A-Mesh" provide="no" from="A" /> | ||
<use-mesh name="B-Mesh" provide="yes" /> | ||
<read-data name="Data" mesh="B-Mesh" /> | ||
|
||
<mapping:nearest-neighbor constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> | ||
<!-- <mapping:nearest-projection constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> --> | ||
<!-- <mapping:rbf-gaussian shape-parameter="4" constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" x-dead="false" y-dead="false" z-dead="false" /> --> | ||
<!-- <mapping:rbf-gaussian shape-parameter="5600" solver-rtol="1e-9" constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" x-dead="true" y-dead="false" z-dead="false" polynomial="separate" preallocation="tree"/> --> | ||
<!-- <mapping:rbf-volume-splines solver-rtol="1e-9" constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" x-dead="false" y-dead="false" z-dead="false" /> --> | ||
<!-- <export:vtk every-n-time-windows="1" directory="vtkB/" normals="0"/> --> | ||
</participant> | ||
|
||
<coupling-scheme:parallel-explicit> | ||
<participants first="A" second="B" /> | ||
<max-time value="1.0" /> | ||
<time-window-size value="1" /> | ||
<exchange data="Data" mesh="A-Mesh" from="A" to="B" /> | ||
</coupling-scheme:parallel-explicit> | ||
|
||
</solver-interface> | ||
|
||
</precice-configuration> |
This file contains hidden or 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,34 @@ | ||
#!/usr/bin/env bash | ||
set -e -x | ||
|
||
# This script assumes the ASTE binaries and python scripts are in $PATH or ASTE installed on your system | ||
|
||
# Download the meshes | ||
test -f meshes.tar.gz || wget https://gitlab.lrz.de/precice/precice2-ref-paper-setup/-/raw/main/meshes/meshes.tar.gz | ||
MakisH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Extract the meshes | ||
test -f 0.009.vtk -a 0.01.vtk ||tar -xf meshes.tar.gz | ||
|
||
# Calculate on fine mesh | ||
vtk_calculator.py -m 0.009.vtk -f "eggholder3d" -d "EggHolder" | ||
|
||
# Decompose both meshes to two procesors | ||
# Choose resolution 0.009 mesh as fine mesh | ||
partition_mesh.py -m 0.009.vtk -n 2 -o fine_mesh --dir fine_mesh --algorithm topology | ||
# Choose resolution 0.01 mesh as coarse mesh | ||
partition_mesh.py -m 0.01.vtk -n 2 -o coarse_mesh --dir coarse_mesh --algorithm topology | ||
|
||
# The result directory of preciceMap needs to exist beforehand | ||
mkdir -p mapped | ||
|
||
# Map from the finer mesh to coarser mesh | ||
mpirun -n 2 preciceMap -v -p A --mesh fine_mesh/fine_mesh --data "EggHolder" & | ||
mpirun -n 2 preciceMap -v -p B --mesh coarse_mesh/coarse_mesh --output mapped/mapped --data "InterpolatedData" | ||
|
||
# Join the output files together to result.vtk, | ||
# Recovery cannot be used since GlobalID's are not exist in mapped mesh | ||
join_mesh.py -m mapped/mapped -o result.vtk --recovery coarse_mesh/coarse_mesh_recovery.json | ||
|
||
# Measure the difference between the original function and the mapped values | ||
# Save into data array called difference | ||
vtk_calculator.py -m result.vtk -f "eggholder3d" -d difference --diffdata "InterpolatedData" --diff --stats |
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.