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

Vectorial constant fe space #888

Merged
merged 5 commits into from
May 19, 2023
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
was using default, it's now using the spetialized implementation for the underlying triangulation type.
Since PR [#884](https://github.com/gridap/Gridap.jl/pull/884).

- Fixed `cell_dof_ids` for the case of vectorial `ConstantFESpace`. Since PR [#888](https://github.com/gridap/Gridap.jl/pull/888)

## [0.17.17] - 2023-02-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/FESpaces/ConstantFESpaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cell_basis=SingleFieldFEBasis(
cell_dof_basis_array=lazy_map(get_dof_basis,cell_reffe)
cell_dof_basis=CellDof(cell_dof_basis_array,Triangulation(model),ReferenceDomain())

cell_dof_ids=Fill(Int32[1],num_cells(model))
cell_dof_ids=Fill(Int32(1):Int32(num_components(field_type)),num_cells(model))
A=typeof(cell_basis)
B=typeof(cell_dof_basis)
C=typeof(cell_dof_ids)
Expand Down
10 changes: 9 additions & 1 deletion test/FESpacesTests/ConstantFESpaceTests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module ConstantFESpacesTests

using Gridap
Expand Down Expand Up @@ -30,4 +29,13 @@ uh = solve(op)
@assert sum(∫((uh[1]-u)*(uh[1]-u))dΩ) < 1.0e-14
abs(sum(∫(uh[2])dΩ)) < 1.0e-12

Λ2=ConstantFESpace(model,field_type=VectorValue{2,Float64})
Gridap.FESpaces.test_fe_space(Λ2)
M2=TrialFESpace(Λ2)
a2(μ,λ) = ∫(λ⋅μ)dΩ
l2(λ) = ∫(VectorValue(0.0,0.0)⋅λ)dΩ
op2 = AffineFEOperator(a2,l2,M2,Λ2)
μ2h = solve(op2)
@assert sum(∫(μ2h⋅μ2h)dΩ) < 1.0e-12

end # module