Skip to content

Commit

Permalink
Merge pull request #888 from gridap/vectorial_ConstantFESpace
Browse files Browse the repository at this point in the history
Vectorial constant fe space
  • Loading branch information
santiagobadia authored May 19, 2023
2 parents 122da8b + a44bf8d commit 6a0dfdd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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

0 comments on commit 6a0dfdd

Please sign in to comment.