Skip to content

Commit

Permalink
Merge branch 'lxmota:main' into inclined_support_BC_clean
Browse files Browse the repository at this point in the history
  • Loading branch information
brianphung authored Dec 5, 2024
2 parents 7126e41 + 273464d commit 6f4a01b
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 11 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yaml
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

22 changes: 11 additions & 11 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "f55e1f8e1c7c4f7c99f16471c7ef542033806470"
project_hash = "14fd343061075337027aa3e7f7163ebe51fc2336"

[[deps.ADTypes]]
git-tree-sha1 = "72af59f5b8f09faee36b4ec48e014a79210f2f4f"
Expand All @@ -26,9 +26,9 @@ version = "0.4.5"

[[deps.Accessors]]
deps = ["CompositionsBase", "ConstructionBase", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown"]
git-tree-sha1 = "b392ede862e506d451fc1616e79aa6f4c673dab8"
git-tree-sha1 = "96bed9b1b57cf750cca50c311a197e306816a1cc"
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
version = "0.1.38"
version = "0.1.39"

[deps.Accessors.extensions]
AccessorsAxisKeysExt = "AxisKeys"
Expand Down Expand Up @@ -283,9 +283,9 @@ version = "1.0.4"

[[deps.Exodus]]
deps = ["DocStringExtensions", "Exodus_jll"]
git-tree-sha1 = "e9f02dc8b512c99306c11c195d43e6ee5b32727b"
git-tree-sha1 = "741450c12697a46ba63cb8de6ba2690e1b989534"
uuid = "f57ae99e-f805-4780-bdca-96e224be1e5a"
version = "0.13.6"
version = "0.13.7"

[deps.Exodus.extensions]
ExodusAdaptExt = "Adapt"
Expand Down Expand Up @@ -764,9 +764,9 @@ version = "0.7.0"

[[deps.SciMLBase]]
deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"]
git-tree-sha1 = "f48e0239fbb7799e8d81133ea71a726ec510c9ef"
git-tree-sha1 = "899468ac3c2fa6b87151cb3fa29367329017d365"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
version = "2.65.1"
version = "2.66.0"

[deps.SciMLBase.extensions]
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
Expand Down Expand Up @@ -898,9 +898,9 @@ version = "7.2.1+1"

[[deps.SymbolicIndexingInterface]]
deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"]
git-tree-sha1 = "6c6761e08bf5a270905cdd065be633abfa1b155b"
git-tree-sha1 = "8db233b54917e474165d582bef2244fa040e0a56"
uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
version = "0.3.35"
version = "0.3.36"

[[deps.SymbolicLimits]]
deps = ["SymbolicUtils"]
Expand Down Expand Up @@ -977,9 +977,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.TimerOutputs]]
deps = ["ExprTools", "Printf"]
git-tree-sha1 = "3a6f063d690135f5c1ba351412c82bae4d1402bf"
git-tree-sha1 = "d7298ebdfa1654583468a487e8e83fae9d72dac3"
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
version = "0.5.25"
version = "0.5.26"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ Einsum = "b7d42ee7-0b51-5a75-98ca-779d3107e4c0"
Exodus = "f57ae99e-f805-4780-bdca-96e224be1e5a"
Format = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
89 changes: 89 additions & 0 deletions test/schwarz-nonoverlap-static-cuboid-hex8.jl
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

0 comments on commit 6f4a01b

Please sign in to comment.