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

Multifield refactoring #374

Merged
merged 107 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
11132fe
Starting draft [skip ci]
fverdugo Jul 31, 2020
1fca846
Saving changes
fverdugo Aug 3, 2020
bb6fc5a
More binary ops
fverdugo Aug 3, 2020
1d30679
Minor
fverdugo Aug 3, 2020
b78aa8a
Deleted apply_field_op
fverdugo Aug 3, 2020
6d2123f
Starting to optimize IntKernel
fverdugo Aug 3, 2020
1cb27ed
Saving changes
fverdugo Aug 4, 2020
33349f6
Merge branch 'master' of github.com:gridap/Gridap.jl into multifield_…
fverdugo Aug 4, 2020
615aaea
Added degenerated cases for array_caches and getitems!
fverdugo Aug 4, 2020
32ea2f5
Moved BlockArrayCoo to the library
fverdugo Aug 4, 2020
b2e1b03
Implementing mul!, Transpose and fill! for BlockArrayCoo
fverdugo Aug 4, 2020
88d3015
Moving code from tests to library
fverdugo Aug 4, 2020
075a6f7
Added setaxes!
fverdugo Aug 4, 2020
edc19e4
Added MulKernel
fverdugo Aug 4, 2020
2bf8b52
Saving changes [skip ci]
fverdugo Aug 4, 2020
41867a5
Fixing some bugs
fverdugo Aug 5, 2020
4eecb85
Fixing printing of BlockVectorCoo
fverdugo Aug 5, 2020
363ee01
Added VectorOfBlockArray
fverdugo Aug 5, 2020
e7e4b2d
saving temporary changes [skip ci]
fverdugo Aug 5, 2020
2a9b661
iSeveral fixes to work with blocks of blocks
fverdugo Aug 6, 2020
c909cb7
Stressing VectorsOfBlockArrayCoo for heterogeneous case
fverdugo Aug 6, 2020
8b6662a
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 7, 2020
611a5c2
Added TwoLevelBlockedRange to better support blocks of blocks
fverdugo Aug 7, 2020
c4c19f6
More improvements for supporting blocks of blocks
fverdugo Aug 7, 2020
182fdff
Fixing VectorsOfBlockArrayCoo for block of blocks
fverdugo Aug 10, 2020
7b2082f
Saving changes
fverdugo Aug 10, 2020
6da2d79
Moved some code to the library
fverdugo Aug 10, 2020
526d2e8
More optimizations for Block of Blocks
fverdugo Aug 10, 2020
17ef105
Finishing to polish block of block case
fverdugo Aug 11, 2020
7c6d8d7
Added operate_fields and operate_arrays_of_fields
fverdugo Aug 11, 2020
b038c7a
Saving changes
fverdugo Aug 11, 2020
157f980
Starting to add VectorsOfBlockBasisCoo
fverdugo Aug 11, 2020
2107561
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 12, 2020
db3897b
Implemented Gradient rules for fields at local level
fverdugo Aug 12, 2020
6642554
Implemented gradient rules at global level
fverdugo Aug 12, 2020
b26e391
Gradient of VectorOfBlockBasisCoo
fverdugo Aug 12, 2020
9f4b103
Moving VectorOfBlockBasisCoo to the library
fverdugo Aug 12, 2020
9d79612
Some clean up
fverdugo Aug 12, 2020
e90d466
Deactivating code down stream and using the new field operations
fverdugo Aug 12, 2020
2f5458b
Some changes in VectorOfBlockBasisCoo
fverdugo Aug 12, 2020
24dd836
Some changes in diff ops for arrays of fields
fverdugo Aug 12, 2020
71c06b1
reactivating Polynomials, Integration, ReferenceFEs
fverdugo Aug 13, 2020
a279d0d
Refactored CellFields
fverdugo Aug 13, 2020
053e08c
More work in VectorOfBlockBasisCoo
fverdugo Aug 13, 2020
9ee3399
added insert_array_of_bases_in_block
fverdugo Aug 13, 2020
f87b036
Added UnimplementedFields
fverdugo Aug 13, 2020
189da09
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 13, 2020
65376f6
add cell_axes metadata to cell fields
fverdugo Aug 14, 2020
0c43a67
Added some functions to merge on the skeleton
fverdugo Aug 14, 2020
a359cd0
Re implemented restrict for CellField
fverdugo Aug 14, 2020
44ef1c4
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 14, 2020
9ab494b
Added the concept of metasize for CellField objects
fverdugo Aug 14, 2020
8988bf0
Add forgotten file
fverdugo Aug 16, 2020
40776a0
Starting to equip GenericCellField with memoization
fverdugo Aug 16, 2020
c17c771
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 17, 2020
407a0a9
Fixing some tests
fverdugo Aug 17, 2020
d5cc652
Reactivating FESpaces
fverdugo Aug 17, 2020
5d0e60f
Revert "Reactivating FESpaces"
fverdugo Aug 17, 2020
8c220a6
Revert "Revert "Reactivating FESpaces""
fverdugo Aug 17, 2020
fa9ae3b
Revert "Revert "Revert "Reactivating FESpaces"""
fverdugo Aug 17, 2020
a28850c
Starting to add CellData module
fverdugo Aug 17, 2020
31f89bc
Some renamings
fverdugo Aug 17, 2020
9dafe33
Added CellData.CellQuadrature and tests
fverdugo Aug 17, 2020
48ed74b
Added CellData.QPointCellField
fverdugo Aug 17, 2020
784d118
Refactred CellData + Geometry
fverdugo Aug 17, 2020
694f8e5
Fixed AppendedTriangulationsTests
fverdugo Aug 17, 2020
11cf1d8
Added CellData.CellDofBasis
fverdugo Aug 17, 2020
a6415ca
Added attach_dirichlet and attach_constraints_rows and _cols
fverdugo Aug 17, 2020
ceaece9
Resolving constraints at skeleton
fverdugo Aug 17, 2020
9ecbc07
Adding BlockArrays to compat section
fverdugo Aug 17, 2020
048f6c6
Moving from Julia 1.0 to Julia 1.3
fverdugo Aug 17, 2020
9c42ea6
Fixing some test for Julia 1.3
fverdugo Aug 17, 2020
7101eff
Moved @law and update_state_variables! to CellData module
fverdugo Aug 18, 2020
dd42e7d
Added identity_constraints
fverdugo Aug 18, 2020
c2c2003
Starting the refactoring in Gridap.FESpaces [skip ci]
fverdugo Aug 18, 2020
97c6435
Testing FESpaceInterfaces
fverdugo Aug 19, 2020
c62a732
Some test restructuring
fverdugo Aug 19, 2020
d950fb2
Advancing with the FESpaces module refactoring
fverdugo Aug 19, 2020
66bd050
Refactored Assember (broken tests at the skeleton)
fverdugo Aug 19, 2020
3f715f6
Assembler working on skeleton
fverdugo Aug 20, 2020
4e36193
ttaching dirichlet bcs without a vector
fverdugo Aug 20, 2020
24c76e6
Refactored FETerms
fverdugo Aug 20, 2020
8be8351
Re-activated FEOperators and Co and removed CellKernels
fverdugo Aug 20, 2020
d477051
Reactivating other part of FESpaces module
fverdugo Aug 20, 2020
5f06b7b
ExtendedFESpaces worning again
fverdugo Aug 20, 2020
8c179d9
FESpacesWithLinearConstraints working
fverdugo Aug 20, 2020
cf6453d
Activated FEAutodiff
fverdugo Aug 20, 2020
e654324
Finishing clean-up in FESpaces
fverdugo Aug 20, 2020
770cb8d
some code relocation
fverdugo Aug 20, 2020
50ac68a
Saving incomplete changes [skip ci]
fverdugo Aug 20, 2020
a0223b8
Merge branch 'release-0.14' of github.com:gridap/Gridap.jl into multi…
fverdugo Aug 21, 2020
dc1f3af
Refactored the code part of MultiField
fverdugo Aug 21, 2020
f809d2b
Deleting some files not needed any more in MultiField
fverdugo Aug 21, 2020
71266ef
Assembler working for multi-field
fverdugo Aug 21, 2020
d726ed1
Testing FEOperator in multi-field
fverdugo Aug 21, 2020
ce0305e
more tests
fverdugo Aug 21, 2020
8050411
Splitting FESpaces tests in two tests sets to avoid problems in travis
fverdugo Aug 21, 2020
f69bc72
Reactivated Visualization module
fverdugo Aug 21, 2020
c71015f
Reactivating Gridap completelly
fverdugo Aug 21, 2020
bbb97b5
Bugfix in setaxes!
fverdugo Aug 21, 2020
e46640c
Updating IsotropicDamageTests
fverdugo Aug 21, 2020
7da3999
issue_349 is fixed working
fverdugo Aug 21, 2020
d9068ea
Revert "Bugfix in setaxes!"
fverdugo Aug 21, 2020
ec0fbb5
Revert "Revert "Bugfix in setaxes!""
fverdugo Aug 21, 2020
bddb162
Fixing benchmarks
fverdugo Aug 21, 2020
ee5bf7e
Fixing docs/make.jl
fverdugo Aug 21, 2020
ed8d3bf
Fixed un-initialization related bug in mul! for block matrices
fverdugo Aug 21, 2020
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ language: julia
os:
- linux
julia:
- 1.0
- 1.4
- 1.3
- 1.5
notifications:
email:
on_success: never
Expand Down
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.14.0"
[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
Expand All @@ -26,6 +27,7 @@ WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
[compat]
AbstractTrees = "0.3.3"
BSON = "0.2.5"
BlockArrays = "0.12.12"
Combinatorics = "1.0.0"
DocStringExtensions = "0.8.1"
FastGaussQuadrature = "0.4.2"
Expand All @@ -39,7 +41,7 @@ NLsolve = "4.3.0"
QuadGK = "2.3.1"
StaticArrays = "0.12.1"
WriteVTK = "1.7"
julia = "1.0"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
4 changes: 2 additions & 2 deletions bench/FieldsBenchs/FieldApplyBenchs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ function bench1(n)
v = 3.0
d = 2
f = MockField{d}(v)
g = apply_kernel_to_field(bcast(+),f,v)
g = operate_fields(+,f,v)
cg = field_cache(g,x)
@time repeat(n,evaluate!,cg,g,x)
∇g = gradient(g)
∇cg = field_cache(∇g,x)
@time repeat(n,evaluate!,∇cg,∇g,x)
h = apply_kernel_to_field(bcast(+),f,f)
h = operate_fields(+,f,f)
ch = field_cache(h,x)
@time repeat(n,evaluate!,ch,h,x)
end
Expand Down
8 changes: 4 additions & 4 deletions bench/FieldsBenchs/FieldArraysBenchs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function bench1(n)
afx = evaluate(af,ax)
cafx = array_cache(afx)
@time loop(afx,cafx)
ag = apply_to_field_array(bcast(+),af,af)
ag = operate_arrays_of_fields(+,af,af)
cag = array_cache(ag)
@time loop(ag,cag)
agx = evaluate(ag,ax)
Expand All @@ -58,7 +58,7 @@ function bench2(n)
afx = evaluate(af,ax)
cafx = array_cache(afx)
@time loop(afx,cafx)
_ag = apply_to_field_array(bcast(+),af,af)
_ag = operate_arrays_of_fields(+,af,af)
ag = gradient(_ag)
cag = array_cache(ag)
@time loop(ag,cag)
Expand All @@ -85,7 +85,7 @@ function bench2a(n)
afx = evaluate(af,ax)
cafx = array_cache(afx)
@time loop(afx,cafx)
_ag = apply_to_field_array(bcast(+),af,av)
_ag = operate_arrays_of_fields(+,af,av)
ag = gradient(_ag)
cag = array_cache(ag)
@time loop(ag,cag)
Expand Down Expand Up @@ -115,7 +115,7 @@ function bench3(n)
afx = evaluate(af,ax)
cafx = array_cache(afx)
@time loop(afx,cafx)
ag = apply_to_field_array(bcast(+),af,aw)
ag = operate_arrays_of_fields(+,af,aw)
cag = array_cache(ag)
@time loop(ag,cag)
agx = evaluate(ag,ax)
Expand Down
12 changes: 6 additions & 6 deletions bench/FieldsBenchs/FieldOperationsBenchs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ function bench1(n)
aba = Fill(ba,l)
abb = Fill(bb,l)

ag_ff = field_array_operation(inner,afa,afb)
ag_ff = operate_arrays_of_fields(inner,afa,afb)
agx_ff = evaluate(ag_ff,ax)
cagx_ff = array_cache(agx_ff)
@time loop(agx_ff,cagx_ff)

ag_bf = field_array_operation(inner,aba,afb)
ag_bf = operate_arrays_of_fields(inner,aba,afb)
agx_bf = evaluate(ag_bf,ax)
cagx_bf = array_cache(agx_bf)
@time loop(agx_bf,cagx_bf)

ag_bb = field_array_operation(inner,aba,abb)
agx_bb = evaluate(ag_bb,ax)
cagx_bb = array_cache(agx_bb)
@time loop(agx_bb,cagx_bb)
#ag_bb = operate_arrays_of_fields(inner,aba,abb)
#agx_bb = evaluate(ag_bb,ax)
#cagx_bb = array_cache(agx_bb)
#@time loop(agx_bb,cagx_bb)

end

Expand Down
4 changes: 2 additions & 2 deletions bench/FieldsBenchs/IntegrateBenchs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ function bench3(n)
ar = Fill(r,l)
ab = attachmap(ar,aϕ)

fmass = field_array_operation(inner,ab,ab)
fmass = operate_arrays_of_fields(inner,ab,ab)
mmass = integrate(fmass,ax,aw,aj)

cmmass = array_cache(mmass)
@time loop(mmass,cmmass)

fstif = field_array_operation(inner,(ab),(ab))
fstif = operate_arrays_of_fields(inner,(ab),(ab))
mstif = integrate(fstif,ax,aw,aj)

cmstif = array_cache(mstif)
Expand Down
13 changes: 0 additions & 13 deletions docs/src/Geometry.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,6 @@ RestrictedDiscreteModel

## CellFields

### CellFieldLike interface
```@docs
CellFieldLike
get_array(cf::CellFieldLike)
get_cell_map(cf::CellFieldLike)
similar_object(cf::CellFieldLike,array::AbstractArray)
similar_object(cf1::CellFieldLike,cf2::CellFieldLike,array::AbstractArray)
gradient(cf::CellFieldLike)
grad2curl(cf::CellFieldLike)
test_cell_field_like
evaluate(cf::CellFieldLike,x)
length(cf::CellFieldLike)
```
### CellField interface

```@docs
Expand Down
24 changes: 24 additions & 0 deletions src/Arrays/Arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,28 @@ module Arrays

using Gridap.Helpers
using Gridap.Inference
using Gridap.Algebra

using DocStringExtensions
using Test
using FillArrays
using Base: @propagate_inbounds
using LinearAlgebra
using ForwardDiff
using BlockArrays

export BlockArrayCoo
export BlockVectorCoo
export BlockMatrixCoo
export is_zero_block
export is_nonzero_block
export enumerateblocks
export eachblockindex
export VectorOfBlockArrayCoo
export VectorOfBlockVectorCoo
export VectorOfBlockMatrixCoo
export zeros_like
export TwoLevelBlockedUnitRange

export array_cache
export getindex!
Expand All @@ -37,6 +52,7 @@ export CachedArray
export CachedMatrix
export CachedVector
export setsize!
export setaxes!

export CompressedArray
export LocalToGlobalArray
Expand All @@ -52,6 +68,8 @@ export test_kernel
export bcast
export elem
export contract
export MulKernel
export MulAddKernel
export kernel_return_type
export kernel_return_types
export kernel_testitem
Expand Down Expand Up @@ -103,8 +121,12 @@ import Base: IndexStyle
import Gridap.Io: to_dict
import Gridap.Io: from_dict

import Gridap.Algebra: scale_entries!

include("Interface.jl")

include("BlockArraysCoo.jl")

include("CachedArrays.jl")

include("Kernels.jl")
Expand All @@ -131,6 +153,8 @@ include("ArrayPairs.jl")

include("AppendedArrays.jl")

include("VectorsOfBlockArrayCoo.jl")

include("Autodiff.jl")

end # module
Loading