Skip to content

Commit 4113ec1

Browse files
Removed those functions in GridapFixes.jl that were moved to Gridap
in PR: gridap/Gridap.jl#886
1 parent 526f0a3 commit 4113ec1

File tree

2 files changed

+16
-87
lines changed

2 files changed

+16
-87
lines changed

Manifest.toml

+16-14
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ project_hash = "bd637f6127db7bac11a859a057c5bf2cd71551c3"
66

77
[[deps.AbstractFFTs]]
88
deps = ["LinearAlgebra"]
9-
git-tree-sha1 = "cad4c758c0038eea30394b1b671526921ca85b21"
9+
git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef"
1010
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
11-
version = "1.4.0"
11+
version = "1.5.0"
1212

1313
[deps.AbstractFFTs.extensions]
1414
AbstractFFTsChainRulesCoreExt = "ChainRulesCore"
15+
AbstractFFTsTestExt = "Test"
1516

1617
[deps.AbstractFFTs.weakdeps]
1718
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
19+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1820

1921
[[deps.AbstractTrees]]
2022
git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c"
@@ -126,9 +128,9 @@ version = "0.3.0"
126128

127129
[[deps.Compat]]
128130
deps = ["UUIDs"]
129-
git-tree-sha1 = "4e88377ae7ebeaf29a047aa1ee40826e0b708a5d"
131+
git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7"
130132
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
131-
version = "4.7.0"
133+
version = "4.9.0"
132134
weakdeps = ["Dates", "LinearAlgebra"]
133135

134136
[deps.Compat.extensions]
@@ -265,7 +267,7 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
265267

266268
[[deps.Gridap]]
267269
deps = ["AbstractTrees", "BSON", "BlockArrays", "Combinatorics", "DataStructures", "DocStringExtensions", "FastGaussQuadrature", "FileIO", "FillArrays", "ForwardDiff", "JLD2", "JSON", "LineSearches", "LinearAlgebra", "NLsolve", "NearestNeighbors", "PolynomialBases", "QuadGK", "Random", "SparseArrays", "SparseMatricesCSR", "StaticArrays", "Test", "WriteVTK"]
268-
git-tree-sha1 = "df4eba8c0773892fd0ddb09f50921db65a38a612"
270+
git-tree-sha1 = "f36746aee60568b8f67f3f1cb12d1b50e06a88d7"
269271
repo-rev = "refinement-rule-subface-glue"
270272
repo-url = "https://github.com/gridap/Gridap.jl"
271273
uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
@@ -302,9 +304,9 @@ version = "0.9.2"
302304

303305
[[deps.JLD2]]
304306
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "Printf", "Reexport", "Requires", "TranscodingStreams", "UUIDs"]
305-
git-tree-sha1 = "5df8278ad24772c0c6dbbeb97b162ccf29ced2a9"
307+
git-tree-sha1 = "aa6ffef1fd85657f4999030c52eaeec22a279738"
306308
uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
307-
version = "0.4.32"
309+
version = "0.4.33"
308310

309311
[[deps.JLLWrappers]]
310312
deps = ["Preferences"]
@@ -393,9 +395,9 @@ version = "2023.1.0+0"
393395

394396
[[deps.MPI]]
395397
deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"]
396-
git-tree-sha1 = "98fc280a56d3b5cc218435f82df60e05771fefa6"
398+
git-tree-sha1 = "49579593ac2c5f9213c61eead3e39606d22a2a04"
397399
uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195"
398-
version = "0.20.12"
400+
version = "0.20.13"
399401

400402
[deps.MPI.extensions]
401403
AMDGPUExt = "AMDGPU"
@@ -413,9 +415,9 @@ version = "4.1.2+0"
413415

414416
[[deps.MPIPreferences]]
415417
deps = ["Libdl", "Preferences"]
416-
git-tree-sha1 = "d86a788b336e8ae96429c0c42740ccd60ac0dfcc"
418+
git-tree-sha1 = "781916a2ebf2841467cda03b6f1af43e23839d85"
417419
uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
418-
version = "0.1.8"
420+
version = "0.1.9"
419421

420422
[[deps.MPItrampoline_jll]]
421423
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"]
@@ -532,13 +534,13 @@ version = "0.12.3"
532534

533535
[[deps.Parsers]]
534536
deps = ["Dates", "PrecompileTools", "UUIDs"]
535-
git-tree-sha1 = "4b2e829ee66d4218e0cef22c0a64ee37cf258c29"
537+
git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851"
536538
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
537-
version = "2.7.1"
539+
version = "2.7.2"
538540

539541
[[deps.PartitionedArrays]]
540542
deps = ["CircularArrays", "Distances", "FillArrays", "IterativeSolvers", "LinearAlgebra", "MPI", "Printf", "Random", "SparseArrays", "SparseMatricesCSR"]
541-
git-tree-sha1 = "0fa8c755744baab5f11a649b02fd0beba05fe8bc"
543+
git-tree-sha1 = "f10702da1fda04d93e8e9918afa9d6173b9777eb"
542544
repo-rev = "master"
543545
repo-url = "https://github.com/fverdugo/PartitionedArrays.jl"
544546
uuid = "5a9dfac6-5c52-46f7-8278-5e2210713be9"

src/GridapFixes.jl

-73
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
function Gridap.CellData.change_domain(a::CellField,target_trian::Triangulation,target_domain::DomainStyle)
2-
strian=get_triangulation(a)
3-
if (strian===target_trian)
4-
change_domain(a,DomainStyle(a),target_domain)
5-
else
6-
change_domain(a,get_triangulation(a),DomainStyle(a),target_trian,target_domain)
7-
end
8-
end
9-
10-
# I copied this fix as-is from GridapSolvers.jl !!! We should decide where to put it.
11-
function Gridap.Adaptivity.change_domain_n2o(f_fine,ftrian::Gridap.Adaptivity.AdaptedTriangulation{Dc},ctrian::Gridap.Geometry.Triangulation,glue::Gridap.Adaptivity.AdaptivityGlue{<:Gridap.Adaptivity.RefinementGlue}) where Dc
12-
fglue = Gridap.Geometry.get_glue(ftrian,Val(Dc))
13-
cglue = Gridap.Geometry.get_glue(ctrian,Val(Dc))
14-
15-
Gridap.Helpers.@notimplementedif Gridap.Geometry.num_point_dims(ftrian) != Dc
16-
Gridap.Helpers.@notimplementedif isa(cglue,Nothing)
17-
18-
if (num_cells(ctrian) != 0)
19-
### New Triangulation -> New Model
20-
fine_tface_to_field = Gridap.CellData.get_data(f_fine)
21-
fine_mface_to_field = Gridap.Geometry.extend(fine_tface_to_field,fglue.mface_to_tface)
22-
23-
### New Model -> Old Model
24-
# f_c2f[i_coarse] = [f_fine[i_fine_1], ..., f_fine[i_fine_nChildren]]
25-
f_c2f = Gridap.Adaptivity.f2c_reindex(fine_mface_to_field,glue)
26-
27-
child_ids = Gridap.Adaptivity.f2c_reindex(glue.n2o_cell_to_child_id,glue)
28-
rrules = Gridap.Adaptivity.get_old_cell_refinement_rules(glue)
29-
coarse_mface_to_field = lazy_map(Gridap.Adaptivity.FineToCoarseField,f_c2f,rrules,child_ids)
30-
31-
### Old Model -> Old Triangulation
32-
coarse_tface_to_field = lazy_map(Reindex(coarse_mface_to_field),cglue.tface_to_mface)
33-
f_coarse = lazy_map(Broadcasting(),coarse_tface_to_field,cglue.tface_to_mface_map)
34-
35-
return Gridap.CellData.similar_cell_field(f_fine,f_coarse,ctrian,ReferenceDomain())
36-
else
37-
f_coarse = Fill(Gridap.Fields.ConstantField(0.0),num_cells(fcoarse))
38-
return Gridap.CellData.similar_cell_field(f_fine,f_coarse,ctrian,ReferenceDomain())
39-
end
40-
end
41-
421
function Base.map(::typeof(Gridap.Arrays.testitem),
432
a::Tuple{<:AbstractVector{<:AbstractVector{<:VectorValue}},<:AbstractVector{<:Gridap.Fields.LinearCombinationFieldVector}})
443
a2=Gridap.Arrays.testitem(a[2])
@@ -47,38 +6,6 @@ function Base.map(::typeof(Gridap.Arrays.testitem),
476
(a1,a2)
487
end
498

50-
51-
"""
52-
Given a map from new cells to old cells, computes the inverse map.
53-
In the general case (refinement+coarsening), the n2o map is a Table,
54-
but the algorithm is optimized for Vectors (refinement only).
55-
56-
IMPORTANT NOTE: This can go to Gridap.Adaptivity as far proper tests are written.
57-
58-
"""
59-
function Gridap.Adaptivity.get_o2n_faces_map(ncell_to_ocell::Gridap.Arrays.Table{T}) where {T<:Integer}
60-
println(ncell_to_ocell.data)
61-
nC = maximum(ncell_to_ocell.data)
62-
ptrs = fill(0,nC+1)
63-
for ccell in ncell_to_ocell.data
64-
ptrs[ccell+1] += 1
65-
end
66-
Gridap.Arrays.length_to_ptrs!(ptrs)
67-
data = Vector{Int}(undef,ptrs[end]-1)
68-
for fcell=1:length(ncell_to_ocell.ptrs)-1
69-
for j=ncell_to_ocell.ptrs[fcell]:ncell_to_ocell.ptrs[fcell+1]-1
70-
ccell=ncell_to_ocell.data[j]
71-
data[ptrs[ccell]]=fcell
72-
ptrs[ccell]+=1
73-
end
74-
end
75-
Gridap.Arrays.rewind_ptrs!(ptrs)
76-
ocell_to_ncell=Gridap.Arrays.Table(data,ptrs)
77-
println(ocell_to_ncell.ptrs)
78-
println(ocell_to_ncell.data)
79-
ocell_to_ncell
80-
end
81-
829
"""
8310
Given a AdaptivityGlue and a CellField defined on the parent(old) mesh,
8411
returns an equivalent CellField on the child(new) mesh.

0 commit comments

Comments
 (0)