Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gridap/Gridap.jl into facet_integ…
Browse files Browse the repository at this point in the history
…ration_non_conforming_meshes
  • Loading branch information
amartinhuertas committed May 3, 2024
2 parents 1c50aaa + 34faf27 commit 8640ae0
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info



token: ${{ secrets.CODECOV_TOKEN }}

drivers:
name: Drivers ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.18.2] - 2024-05-02

### Fixed

- Bugfix in `get_face_dofs` for Nedelec GenericRefFE. Since PR[#1005](https://github.com/gridap/Gridap.jl/pull/1005).
- Ensure deterministic behavior for matrix assembly involving multiple domains. Since PR[#1004](https://github.com/gridap/Gridap.jl/pull/1004).

## [0.18.1] - 2024-04-12

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Gridap"
uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
authors = ["Santiago Badia <santiago.badia@monash.edu>", "Francesc Verdugo <f.verdugo.rojano@vu.nl>", "Alberto F. Martin <alberto.f.martin@anu.edu.au>"]
version = "0.18.1"
version = "0.18.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
7 changes: 4 additions & 3 deletions src/CellData/DomainContributions.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using DataStructures

"""
"""
struct DomainContribution <: GridapType
dict::IdDict{Triangulation,AbstractArray}
dict::OrderedDict{Triangulation,AbstractArray} # ordered so that iteration is deterministic (#1002)
end

DomainContribution() = DomainContribution(IdDict{Triangulation,AbstractArray}())
DomainContribution() = DomainContribution(OrderedDict{Triangulation,AbstractArray}())

num_domains(a::DomainContribution) = length(a.dict)

Expand Down Expand Up @@ -186,4 +187,4 @@ function integrate(f,b::CompositeMeasure)
tc = move_contributions(ic,b.itrian,b.ttrian)
add_contribution!(cont,b.ttrian,tc)
return cont
end
end
6 changes: 6 additions & 0 deletions src/Fields/AffineMaps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ function lazy_map(::typeof(∇),a::LazyArray{<:Fill{typeof(affine_map)}})
gradients = a.args[1]
lazy_map(constant_field,gradients)
end

function Base.zero(::Type{<:AffineMap{D1,D2,T}}) where {D1,D2,T}
gradient = TensorValue{D1,D2}(tfill(zero(T),Val{D1*D2}()))
origin = Point{D2,T}(tfill(zero(T),Val{D2}()))
AffineMap(gradient,origin)
end
1 change: 1 addition & 0 deletions src/Fields/Fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Gridap.Arrays: testitem

using Gridap.Helpers: @abstractmethod, @notimplemented
using Gridap.Helpers: @notimplementedif, @unreachable, @check
using Gridap.Helpers: tfill

using Gridap.Algebra: mul!

Expand Down
35 changes: 34 additions & 1 deletion src/ReferenceFEs/NedelecRefFEs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,42 @@ function Conformity(reffe::GenericRefFE{Nedelec},sym::Symbol)
end

function get_face_own_dofs(reffe::GenericRefFE{Nedelec}, conf::CurlConformity)
get_face_dofs(reffe)
reffe.face_dofs # For Nedelec, this member variable holds the face owned dofs
end

function get_face_own_dofs(reffe::GenericRefFE{Nedelec}, conf::L2Conformity)
face_own_dofs=[Int[] for i in 1:num_faces(reffe)]
face_own_dofs[end]=collect(1:num_dofs(reffe))
face_own_dofs
end

function get_face_dofs(reffe::GenericRefFE{Nedelec,Dc}) where Dc
face_dofs=[Int[] for i in 1:num_faces(reffe)]
face_own_dofs=get_face_own_dofs(reffe)
p = get_polytope(reffe)
for d=1:Dc # Starting from edges, vertices do not own DoFs for Nedelec
first_face = get_offset(p,d)
nfaces = num_faces(reffe,d)
for face=first_face+1:first_face+nfaces
for df=1:d-1
face_faces = get_faces(p,d,df)
first_cface = get_offset(p,df)
for cface in face_faces[face-first_face]
cface_own_dofs = face_own_dofs[first_cface+cface]
for dof in cface_own_dofs
push!(face_dofs[face],dof)
end
end
end
for dof in face_own_dofs[face]
push!(face_dofs[face],dof)
end
end
end
face_dofs
end


function _Nedelec_nodes_and_moments(::Type{et}, p::Polytope, order::Integer) where et

@notimplementedif !( is_n_cube(p) || (is_simplex(p) ) )
Expand Down
3 changes: 3 additions & 0 deletions test/FieldsTests/AffineMapsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ cell_to_∇hx = lazy_map(evaluate,cell_to_∇h,cell_to_x)
test_array(cell_to_hx,fill(hx,ncells))
test_array(cell_to_∇hx,fill(∇hx,ncells))

T = AffineMap{3,3,Int}
@test isa(zero(T),T)

#display(cell_to_hx)
#display(cell_to_∇hx)
#print_op_tree(cell_to_hx)
Expand Down
20 changes: 19 additions & 1 deletion test/ReferenceFEsTests/NedelecRefFEsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,25 @@ test_reference_fe(reffe)
@test Conformity(reffe) == CurlConformity()
dof_basis = get_dof_basis(reffe)

face_odofs = get_face_own_dofs(reffe)
face_odofs_L2 = get_face_own_dofs(reffe,L2Conformity())

@test face_odofs_L2 == [Int64[], Int64[], Int64[], Int64[],
Int64[], Int64[], Int64[], Int64[], Int64[], Int64[], Int64[], Int64[], Int64[], Int64[],
collect(1:20)]

face_odofs = get_face_own_dofs(reffe)
face_cdofs = get_face_dofs(reffe)

@test face_odofs == [Int64[], Int64[], Int64[], Int64[],
[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16], [17, 18], [19, 20],
Int64[]]

@test face_cdofs == [Int64[], Int64[], Int64[], Int64[],
[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12],
[1, 2, 3, 4, 5, 6, 13, 14], [1, 2, 7, 8, 9, 10, 15, 16], [3, 4, 7, 8, 11, 12, 17, 18], [5, 6, 9, 10, 11, 12, 19, 20],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]]


#display(face_odofs)

using Gridap.Geometry
Expand Down

0 comments on commit 8640ae0

Please sign in to comment.