Skip to content

Commit fab4abc

Browse files
committed
Addresses tolerance issues in boundary condition tests
Updates tests in BoundaryConditions.jl to use `isapprox` with a specified tolerance (rtol=1e-14) instead of direct equality checks. This resolves potential issues caused by floating-point precision variations.
1 parent 0a41d98 commit fab4abc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ src="https://github.com/MultiSimOLab/HyperFEM/blob/main/docs/imgs/sims_.png?raw=
144144

145145
In order to give credit to the HyperFEM contributors, we ask that you please reference the paper:
146146

147-
> In process
147+
C. Perez‐Garcia, R. Ortigosa, J. Martínez‐Frutos, and D. Garcia‐Gonzalez, **Topology and material optimization in ultra-soft magnetoactive structures: making advantage of residual anisotropies.** Adv. Mater. (2025): e18489. https://https://doi.org/10.1002/adma.202518489
148+
148149

149150
along with the required citations for [Gridap](https://github.com/gridap/Gridap.jl).
150151

test/SimulationsTests/BoundaryConditions.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ using Gridap.FESpaces
3030
Vu = TestFESpace(Ω, reffeu, Du, conformity=:H1)
3131
Uu = TrialFESpace(Vu, Du, 1.0)
3232

33-
@test norm(Uu.dirichlet_values) == 0.30990321069650995
34-
33+
@test isapprox(norm(Uu.dirichlet_values) , 0.30990321069650995,rtol=1e-14)
3534
TrialFESpace!(Uu, Du, 0.4)
36-
@test norm(Uu.dirichlet_values) == 0.12396128427860398
35+
@test isapprox(norm(Uu.dirichlet_values) , 0.12396128427860398,rtol=1e-14)
3736
TrialFESpace!(Uu, Du, 1.0)
38-
@test norm(Uu.dirichlet_values) == 0.30990321069650995
37+
@test isapprox(norm(Uu.dirichlet_values) , 0.30990321069650995,rtol=1e-14)
3938

39+
4040
end
4141

4242

@@ -138,6 +138,7 @@ end
138138
interpolate_everywhere!(x -> Mapping(x, Δβ * (t)), get_free_dof_values(uh⁻), uh⁻.dirichlet_values, Vu_⁻)
139139
solve!(comp_model_vacmech; args_vacmech...)
140140
end
141-
@test norm(xh.free_values) == 2.8132015601158087
141+
@test isapprox( norm(xh.free_values) , 2.8132015601158087,rtol=1e-14)
142+
142143

143144
end

0 commit comments

Comments
 (0)