Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing get_constant_approach() getter to FESpaceWithConstantFixed #409

Merged
merged 4 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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