From 4b47572e3116638275913248af8d9ac5c6a5b16c Mon Sep 17 00:00:00 2001 From: amartin Date: Wed, 16 Sep 2020 19:51:27 +1000 Subject: [PATCH 1/3] - Added missing get_constant_approach() getter to FESpaceWithConstantFixed --- NEWS.md | 1 + src/FESpaces/FESpacesWithConstantFixed.jl | 2 ++ test/FESpacesTests/FESpacesWithConstantFixedTests.jl | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 236857e8e..4f4cfe26c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added VectorWithEntryInserted and VectorWithEntryRemoved. Since PR [#401](https://github.com/gridap/Gridap.jl/pull/401/). + - Added missing get_constant_approach() getter to FESpaceWithConstantFixed. Since PR [XXX](https://github.com/gridap/Gridap.jl/pull/xxx). ### Deprecated - The name FESpaceWithLastDofRemoved has been deprecated in favor of its generalization FESpaceWithConstantFixed. Since PR [#396](https://github.com/gridap/Gridap.jl/pull/396) and PR [#404](https://github.com/gridap/Gridap.jl/pull/404). diff --git a/src/FESpaces/FESpacesWithConstantFixed.jl b/src/FESpaces/FESpacesWithConstantFixed.jl index cf0c0d779..efe42b435 100644 --- a/src/FESpaces/FESpacesWithConstantFixed.jl +++ b/src/FESpaces/FESpacesWithConstantFixed.jl @@ -37,6 +37,8 @@ const FESpaceWithLastDofRemoved{CS} = FESpaceWithConstantFixed{CS,FixConstant} FESpaceWithConstantFixed(space,true)) +get_constant_approach(::FESpaceWithConstantFixed{CS,CA}) where {CS,CA}=CA + # Genuine functions function num_free_dofs(f::FESpaceWithConstantFixed{CS,FixConstant}) where {CS} num_free_dofs(f.space)-1 diff --git a/test/FESpacesTests/FESpacesWithConstantFixedTests.jl b/test/FESpacesTests/FESpacesWithConstantFixedTests.jl index a1f5b7ced..90891e764 100644 --- a/test/FESpacesTests/FESpacesWithConstantFixedTests.jl +++ b/test/FESpacesTests/FESpacesWithConstantFixedTests.jl @@ -1,7 +1,8 @@ module FESpaceWithConstantFixedTests - +using Gridap using Gridap.Geometry using Gridap.FESpaces +using Test domain = (0,1,0,1) partition = (4,4) @@ -21,6 +22,8 @@ V = TestFESpace( V0 = FESpaceWithConstantFixed(V,true,rand(1:num_free_dofs(V))) test_single_field_fe_space(V0) +@test Gridap.FESpaces.get_constant_approach(V0) == Gridap.FESpaces.FixConstant + uh0 = interpolate(V0) do x sin(4*pi*(x[1]+x[2]^2)) + 3 end From 033e1b2d639defa08c5d692b2a7b47497871941b Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" <38347633+amartinhuertas@users.noreply.github.com> Date: Wed, 16 Sep 2020 19:52:55 +1000 Subject: [PATCH 2/3] Update NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 4f4cfe26c..3bdedd8b1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added VectorWithEntryInserted and VectorWithEntryRemoved. Since PR [#401](https://github.com/gridap/Gridap.jl/pull/401/). - - Added missing get_constant_approach() getter to FESpaceWithConstantFixed. Since PR [XXX](https://github.com/gridap/Gridap.jl/pull/xxx). + - Added missing get_constant_approach() getter to FESpaceWithConstantFixed. Since PR [#409](https://github.com/gridap/Gridap.jl/pull/409). ### Deprecated - The name FESpaceWithLastDofRemoved has been deprecated in favor of its generalization FESpaceWithConstantFixed. Since PR [#396](https://github.com/gridap/Gridap.jl/pull/396) and PR [#404](https://github.com/gridap/Gridap.jl/pull/404). From 1f8e9d96861c6c8b51c481c400aa092c0301c370 Mon Sep 17 00:00:00 2001 From: amartin Date: Thu, 17 Sep 2020 11:14:15 +1000 Subject: [PATCH 3/3] get_constant_approach() now returns an instance, instead of the type itself --- src/FESpaces/FESpacesWithConstantFixed.jl | 2 +- test/FESpacesTests/FESpacesWithConstantFixedTests.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FESpaces/FESpacesWithConstantFixed.jl b/src/FESpaces/FESpacesWithConstantFixed.jl index efe42b435..7dadc3439 100644 --- a/src/FESpaces/FESpacesWithConstantFixed.jl +++ b/src/FESpaces/FESpacesWithConstantFixed.jl @@ -37,7 +37,7 @@ const FESpaceWithLastDofRemoved{CS} = FESpaceWithConstantFixed{CS,FixConstant} FESpaceWithConstantFixed(space,true)) -get_constant_approach(::FESpaceWithConstantFixed{CS,CA}) where {CS,CA}=CA +get_constant_approach(::FESpaceWithConstantFixed{CS,CA}) where {CS,CA}=CA() # Genuine functions function num_free_dofs(f::FESpaceWithConstantFixed{CS,FixConstant}) where {CS} diff --git a/test/FESpacesTests/FESpacesWithConstantFixedTests.jl b/test/FESpacesTests/FESpacesWithConstantFixedTests.jl index 90891e764..f4dcf6e85 100644 --- a/test/FESpacesTests/FESpacesWithConstantFixedTests.jl +++ b/test/FESpacesTests/FESpacesWithConstantFixedTests.jl @@ -22,7 +22,7 @@ V = TestFESpace( V0 = FESpaceWithConstantFixed(V,true,rand(1:num_free_dofs(V))) test_single_field_fe_space(V0) -@test Gridap.FESpaces.get_constant_approach(V0) == Gridap.FESpaces.FixConstant +@test Gridap.FESpaces.get_constant_approach(V0) == Gridap.FESpaces.FixConstant() uh0 = interpolate(V0) do x sin(4*pi*(x[1]+x[2]^2)) + 3