Skip to content

Commit

Permalink
Merge pull request #409 from gridap/missing_getter_in_fe_space_with_c…
Browse files Browse the repository at this point in the history
…onstant_fixed

Added missing get_constant_approach() getter to FESpaceWithConstantFixed
  • Loading branch information
fverdugo authored Sep 17, 2020
2 parents c1e0e6a + 75509ba commit 1dfc662
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [#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).
Expand Down
2 changes: 2 additions & 0 deletions src/FESpaces/FESpacesWithConstantFixed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion test/FESpacesTests/FESpacesWithConstantFixedTests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module FESpaceWithConstantFixedTests

using Gridap
using Gridap.Geometry
using Gridap.FESpaces
using Test

domain = (0,1,0,1)
partition = (4,4)
Expand All @@ -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
Expand Down

0 comments on commit 1dfc662

Please sign in to comment.