Skip to content

Commit 0bc8b3b

Browse files
authored
Merge pull request #49 from MultiSimOLab/sims-tests
Added more simulations tests
2 parents d2bb3ce + 50a9945 commit 0bc8b3b

17 files changed

Lines changed: 232 additions & 20 deletions

benchmark/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
44
GridapGmsh = "3025c34a-b394-11e9-2a55-3fee550c04c8"
55
GridapSolvers = "6d3209ee-5e3c-4db7-a716-942eb12ed534"
6+
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
filename = projdir("test/data/StaticMechanicalDirichletSimulation.jl")
3+
include(filename)
4+
5+
SUITE["Simulations"]["StaticMechanicalDirichlet"] = @benchmarkable static_mechanical_dirichlet_simulation(writevtk=false, verbose=false)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
filename = projdir("test/data/StaticMechanicalNeumannSimulation.jl")
3+
include(filename)
4+
5+
SUITE["Simulations"]["StaticMechanicalNeumann"] = @benchmarkable static_mechanical_neumann_simulation(writevtk=false, verbose=false)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
BASE_FOLDER = dirname(dirname(pathof(HyperFEM)))
3-
filename = joinpath(BASE_FOLDER, "test/data/ViscoElasticSimulation.jl")
2+
filename = projdir("test/data/ViscoElasticSimulation.jl")
43
include(filename)
54

6-
SUITE["Simulations"]["ViscoElastic"] = @benchmarkable visco_elastic_simulation(write_vtk=false)
5+
SUITE["Simulations"]["ViscoElastic"] = @benchmarkable visco_elastic_simulation(writevtk=false, verbose=false)

benchmark/SimulationsBenchmarks/benchmarks.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
SUITE["Simulations"] = BenchmarkGroup()
33

44
include("ViscoElasticSimulationBenchmark.jl")
5+
6+
include("StaticMechanicalDirichletBenchmark.jl")
7+
8+
include("StaticMechanicalNeumannBenchmark.jl")

src/Exports.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ end
136136
@publish Solvers Roman_LS
137137
@publish Solvers update_cellstate!
138138

139-
140-
141-
142-
# @publish LinearSolvers solve
143-
# @publish LinearSolvers solve!
139+
export setupfolder
140+
export projdir
141+
export filedir

src/HyperFEM.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
module HyperFEM
22

3-
using TimerOutputs
4-
5-
63
include("TensorAlgebra/TensorAlgebra.jl")
74
include("PhysicalModels/PhysicalModels.jl")
85
include("WeakForms/WeakForms.jl")
96
include("Solvers/Solvers.jl")
107
include("ComputationalModels/ComputationalModels.jl")
118

129
include("Io.jl")
13-
export setupfolder
14-
1510
include("Exports.jl")
11+
1612
end

src/Io.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ end
3131

3232
function cleandir(::String, ::Nothing)
3333
end
34+
35+
"""
36+
Return the path to the specified folders relative to the HyperFEM path.
37+
38+
# Examples
39+
folder = projdir("data", "sims")
40+
folder = projdir("test/data/mesh.msh")
41+
"""
42+
function projdir(folders::String...)
43+
base_folder = dirname(dirname(pathof(HyperFEM)))
44+
joinpath(base_folder, folders...)
45+
end

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ GridapSolvers = "6d3209ee-5e3c-4db7-a716-942eb12ed534"
55
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
66
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
77
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8+
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
filename = projdir("test/data/StaticMechanicalDirichletSimulation.jl")
3+
include(filename)
4+
5+
x = static_mechanical_dirichlet_simulation(writevtk=false, verbose=false)
6+
7+
@test norm(x) 0.27148722276

0 commit comments

Comments
 (0)