-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lxmota:main' into inclined_support_BC_clean
- Loading branch information
Showing
4 changed files
with
149 additions
and
11 deletions.
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,47 @@ | ||
name: Norma CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Run on pushes to the main branch | ||
pull_request: # Run on pull requests | ||
schedule: | ||
- cron: '0 8 * * *' # Midnight PST (8:00 UTC) | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] # Platforms to test | ||
julia-version: ["1.10", "1.11"] # Julia versions to test | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
# Step 1: Check out the code | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Julia | ||
- name: Set up Julia | ||
uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
|
||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
julia --project=. -e 'using Pkg; Pkg.instantiate()' | ||
# Step 4: Run the tests | ||
- name: Run tests | ||
run: | | ||
julia --project=. -e 'using Pkg; Pkg.test()' | ||
# Step 5: Upload test results (optional) | ||
- name: Upload test results | ||
if: always() # Run this even if the test step fails | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: test-results.log | ||
|
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
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,89 @@ | ||
@testset "schwarz-nonoverlap-static-cuboid-hex8-same-step" begin | ||
cp("../examples/nonoverlap/static-same-time-step/cuboids.yaml", "cuboids.yaml", force=true) | ||
cp("../examples/nonoverlap/static-same-time-step/cuboid-1.yaml", "cuboid-1.yaml", force=true) | ||
cp("../examples/nonoverlap/static-same-time-step/cuboid-2.yaml", "cuboid-2.yaml", force=true) | ||
cp("../examples/nonoverlap/static-same-time-step/cuboid-1.g", "cuboid-1.g", force=true) | ||
cp("../examples/nonoverlap/static-same-time-step/cuboid-2.g", "cuboid-2.g", force=true) | ||
sim = Norma.run("cuboids.yaml") | ||
subsims = sim.subsims | ||
model_fine = subsims[1].model | ||
model_coarse = subsims[2].model | ||
rm("cuboids.yaml") | ||
rm("cuboid-1.yaml") | ||
rm("cuboid-2.yaml") | ||
rm("cuboid-1.g") | ||
rm("cuboid-2.g") | ||
rm("cuboid-1.e") | ||
rm("cuboid-2.e") | ||
min_disp_x_fine = minimum(model_fine.current[1,:] - model_fine.reference[1,:]) | ||
min_disp_y_fine = minimum(model_fine.current[2,:] - model_fine.reference[2,:]) | ||
max_disp_z_fine = maximum(model_fine.current[3,:] - model_fine.reference[3,:]) | ||
min_disp_x_coarse = minimum(model_coarse.current[1,:] - model_coarse.reference[1,:]) | ||
min_disp_y_coarse = minimum(model_coarse.current[2,:] - model_coarse.reference[2,:]) | ||
min_disp_z_coarse = minimum(model_coarse.current[3,:] - model_coarse.reference[3,:]) | ||
avg_stress_fine = average_components(model_fine.stress) | ||
avg_stress_coarse = average_components(model_coarse.stress) | ||
@test min_disp_x_fine ≈ -0.125 rtol = 1.0e-06 | ||
@test min_disp_y_fine ≈ -0.125 rtol = 1.0e-06 | ||
@test max_disp_z_fine ≈ 0.5 rtol = 1.0e-06 | ||
@test min_disp_x_coarse ≈ -0.125 rtol = 1.0e-06 | ||
@test min_disp_y_coarse ≈ -0.125 rtol = 1.0e-06 | ||
@test min_disp_z_coarse ≈ 0.5 rtol = 1.0e-01 | ||
@test avg_stress_fine[1] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_fine[2] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_fine[3] ≈ 5.0e+08 rtol = 1.0e-06 | ||
@test avg_stress_fine[4] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_fine[5] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_fine[6] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_coarse[1] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_coarse[2] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_coarse[3] ≈ 5.0e+08 rtol = 1.0e-06 | ||
@test avg_stress_coarse[4] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_coarse[5] ≈ 0.0 atol = 1.0e-01 | ||
@test avg_stress_coarse[6] ≈ 0.0 atol = 1.0e-01 | ||
end | ||
|
||
# @testset "schwarz-nonoverlap-static-cuboid-hex8-different-steps" begin | ||
# cp("../examples/nonoverlap/static-different-steps/cuboids.yaml", "cuboids.yaml", force=true) | ||
# cp("../examples/nonoverlap/static-different-steps/cuboid-1.yaml", "cuboid-1.yaml", force=true) | ||
# cp("../examples/nonoverlap/static-different-steps/cuboid-2.yaml", "cuboid-2.yaml", force=true) | ||
# cp("../examples/nonoverlap/static-different-steps/cuboid-1.g", "cuboid-1.g", force=true) | ||
# cp("../examples/nonoverlap/static-different-steps/cuboid-2.g", "cuboid-2.g", force=true) | ||
# sim = Norma.run("cuboids.yaml") | ||
# subsims = sim.subsims | ||
# model_fine = subsims[1].model | ||
# model_coarse = subsims[2].model | ||
# rm("cuboids.yaml") | ||
# rm("cuboid-1.yaml") | ||
# rm("cuboid-2.yaml") | ||
# rm("cuboid-1.g") | ||
# rm("cuboid-2.g") | ||
# rm("cuboid-1.e") | ||
# rm("cuboid-2.e") | ||
# min_disp_x_fine = minimum(model_fine.current[1,:] - model_fine.reference[1,:]) | ||
# min_disp_y_fine = minimum(model_fine.current[2,:] - model_fine.reference[2,:]) | ||
# max_disp_z_fine = maximum(model_fine.current[3,:] - model_fine.reference[3,:]) | ||
# min_disp_x_coarse = minimum(model_coarse.current[1,:] - model_coarse.reference[1,:]) | ||
# min_disp_y_coarse = minimum(model_coarse.current[2,:] - model_coarse.reference[2,:]) | ||
# min_disp_z_coarse = minimum(model_coarse.current[3,:] - model_coarse.reference[3,:]) | ||
# avg_stress_fine = average_components(model_fine.stress) | ||
# avg_stress_coarse = average_components(model_coarse.stress) | ||
# @test min_disp_x_fine ≈ -0.125 rtol = 1.0e-06 | ||
# @test min_disp_y_fine ≈ -0.125 rtol = 1.0e-06 | ||
# @test max_disp_z_fine ≈ 0.75 rtol = 1.0e-06 | ||
# @test min_disp_x_coarse ≈ -0.125 rtol = 1.0e-06 | ||
# @test min_disp_y_coarse ≈ -0.125 rtol = 1.0e-06 | ||
# @test min_disp_z_coarse ≈ 0.25 rtol = 1.0e-01 | ||
# @test avg_stress_fine[1] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_fine[2] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_fine[3] ≈ 5.0e+08 rtol = 1.0e-06 | ||
# @test avg_stress_fine[4] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_fine[5] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_fine[6] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_coarse[1] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_coarse[2] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_coarse[3] ≈ 5.0e+08 rtol = 1.0e-06 | ||
# @test avg_stress_coarse[4] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_coarse[5] ≈ 0.0 atol = 1.0e-01 | ||
# @test avg_stress_coarse[6] ≈ 0.0 atol = 1.0e-01 | ||
# end |