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

Fix tests to use geometric_interpolation #46

Merged
merged 1 commit into from
Jul 2, 2024
Merged
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
19 changes: 9 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ else # v1.0
create_cell_values(ip; order=1) = CellValues(QuadratureRule{Ferrite.getrefshape(ip)}(order), ip, ip)
end

if !isdefined(Ferrite, :geometric_interpolation)
geometric_interpolation(c) = Ferrite.default_interpolation(c)
end

@testset "CheckVolumes" begin
unit_volume_files = ("2D_UnitArea_Linear", "2D_UnitArea_Quadratic",
"3D_UnitVolume_LinearHexahedron", "3D_UnitVolume_LinearTetrahedron",
Expand All @@ -41,16 +45,11 @@ end
grid = get_ferrite_grid(filename)
unique_celltypes = unique(typeof.(grid.cells))

#dh, cellsets = setup_dofhandler(grid, unique_celltypes)
cellsets = [findall(x->isa(x,type), grid.cells) for type in unique_celltypes]

cv_vec = Any[]
for type in unique_celltypes
ip = Ferrite.default_interpolation(type)
push!(cv_vec, create_cell_values(ip; order=1))
end
cellsets = [findall(x -> isa(x, cell_type), grid.cells) for cell_type in unique_celltypes]

for (cellset, cv, type) in zip(cellsets, cv_vec, unique_celltypes)
for (cellset, cell_type) in zip(cellsets, unique_celltypes)
ip = geometric_interpolation(cell_type)
cv = create_cell_values(ip; order=1)
for cellnr in cellset
reinit!(cv, getcoordinates(grid, cellnr))
V = getdetJdV(cv, 1)
Expand Down Expand Up @@ -157,4 +156,4 @@ end
grid = get_ferrite_grid(filename)
@test grid_cp == grid
rm(filename_cp)
end
end