@@ -7,29 +7,29 @@ struct CompositeVolumetricElementCache{CacheTupleType <: Tuple} <: AbstractVolum
77 inner_caches:: CacheTupleType
88end
99# Main entry point for bilinear operators
10- assemble_element! (Kₑ:: AbstractMatrix , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_element ! (Kₑ, cell, element_cache. inner_caches, time)
11- @unroll function assemble_element ! (Kₑ:: AbstractMatrix , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
10+ assemble_element! (Kₑ:: AbstractMatrix , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_composite_element ! (Kₑ, cell, element_cache. inner_caches, time)
11+ @unroll function assemble_composite_element ! (Kₑ:: AbstractMatrix , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
1212 @unroll for inner_cache ∈ inner_caches
1313 assemble_element! (Kₑ, cell, inner_cache, time)
1414 end
1515end
1616# Update element matrix in nonlinear operators
17- assemble_element! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_element ! (Kₑ, uₑ, cell, element_cache. inner_caches, time)
18- @unroll function assemble_element ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
17+ assemble_element! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_composite_element ! (Kₑ, uₑ, cell, element_cache. inner_caches, time)
18+ @unroll function assemble_composite_element ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
1919 @unroll for inner_cache ∈ inner_caches
2020 assemble_element! (Kₑ, uₑ, cell, inner_cache, time)
2121 end
2222end
2323# Update element matrix and residual in nonlinear operators
24- assemble_element! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_element ! (Kₑ, residualₑ, uₑ, cell, element_cache. inner_caches, time)
25- @unroll function assemble_element ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
24+ assemble_element! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_composite_element ! (Kₑ, residualₑ, uₑ, cell, element_cache. inner_caches, time)
25+ @unroll function assemble_composite_element ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
2626 @unroll for inner_cache ∈ inner_caches
2727 assemble_element! (Kₑ, residualₑ, uₑ, cell, inner_cache, time)
2828 end
2929end
3030# Update residual in nonlinear operators
31- assemble_element! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_element ! (residualₑ, uₑ, cell, element_cache. inner_caches, time)
32- @unroll function assemble_element ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
31+ assemble_element! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , element_cache:: CompositeVolumetricElementCache , time) = assemble_composite_element ! (residualₑ, uₑ, cell, element_cache. inner_caches, time)
32+ @unroll function assemble_composite_element ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
3333 @unroll for inner_cache ∈ inner_caches
3434 assemble_element! (residualₑ, uₑ, cell, inner_cache, time)
3535 end
@@ -67,34 +67,41 @@ struct CompositeSurfaceElementCache{CacheTupleType <: Tuple} <: AbstractSurfaceE
6767 inner_caches:: CacheTupleType
6868end
6969# Main entry point for bilinear operators
70- assemble_face! (Kₑ:: AbstractMatrix , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_face ! (Kₑ, cell, surface_cache. inner_caches, local_facet_index, time)
71- @unroll function assemble_face ! (Kₑ:: AbstractMatrix , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
70+ assemble_face! (Kₑ:: AbstractMatrix , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_face ! (Kₑ, cell, surface_cache. inner_caches, local_facet_index, time)
71+ @unroll function assemble_composite_face ! (Kₑ:: AbstractMatrix , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
7272 @unroll for inner_cache ∈ inner_caches
7373 assemble_face! (Kₑ, cell, local_facet_index, inner_cache, time)
7474 end
7575end
7676# Update element matrix in nonlinear operators
77- assemble_face! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_face ! (Kₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
78- @unroll function assemble_face ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
77+ assemble_face! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_face ! (Kₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
78+ @unroll function assemble_composite_face ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
7979 @unroll for inner_cache ∈ inner_caches
8080 assemble_face! (Kₑ, uₑ, cell, local_facet_index, inner_cache, time)
8181 end
8282end
8383# Update element matrix and residual in nonlinear operators
84- assemble_face! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_face ! (Kₑ, residualₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
85- @unroll function assemble_face ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
84+ assemble_face! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_face ! (Kₑ, residualₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
85+ @unroll function assemble_composite_face ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
8686 @unroll for inner_cache ∈ inner_caches
8787 assemble_face! (Kₑ, residualₑ, uₑ, cell, local_facet_index, inner_cache, time)
8888 end
8989end
9090# Update residual in nonlinear operators
91- assemble_face! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_face ! (residualₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
92- @unroll function assemble_face ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
91+ assemble_face! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_face ! (residualₑ, uₑ, cell, local_facet_index, surface_cache. inner_caches, time)
92+ @unroll function assemble_composite_face ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , local_facet_index:: Int , inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
9393 @unroll for inner_cache ∈ inner_caches
9494 assemble_face! (residualₑ, uₑ, cell, local_facet_index, inner_cache, time)
9595 end
9696end
9797
98+ # If we compose a face cache into an element cache, then we loop over the faces of the elements and try to assemble
99+ # Update element matrix in nonlinear operators
100+ assemble_element! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , cell:: CellCache , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_element! (Kₑ, uₑ, cell, surface_cache. inner_caches, time)
101+ # Update element matrix and residual in nonlinear operators
102+ assemble_element! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_element! (Kₑ, residualₑ, uₑ, cell, surface_cache. inner_caches, time)
103+ # Update residual in nonlinear operators
104+ assemble_element! (residualₑ:: AbstractVector , uₑ:: AbstractVector , cell:: CellCache , surface_cache:: CompositeSurfaceElementCache , time) = assemble_composite_element! (residualₑ, uₑ, cell, surface_cache. inner_caches, time)
98105
99106
100107"""
@@ -104,30 +111,30 @@ struct CompositeInterfaceElementCache{CacheTupleType <: Tuple} <: AbstractInterf
104111 inner_caches:: CacheTupleType
105112end
106113# Main entry point for bilinear operators
107- assemble_interface! (Kₑ:: AbstractMatrix , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_interface ! (Kₑ, interface, interface_cache. inner_caches, time)
108- @unroll function assemble_interface ! (Kₑ:: AbstractMatrix , interface, inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
114+ assemble_interface! (Kₑ:: AbstractMatrix , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_composite_interface ! (Kₑ, interface, interface_cache. inner_caches, time)
115+ @unroll function assemble_composite_interface ! (Kₑ:: AbstractMatrix , interface, inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
109116 @unroll for inner_cache ∈ inner_caches
110117 assemble_interface! (Kₑ, interface, inner_cache, time)
111118 end
112119end
113120# Update element matrix in nonlinear operators
114- assemble_interface! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_interface ! (Kₑ, uₑ, interface, interface_cache. inner_caches, time)
115- @unroll function assemble_interface ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , local_facet_index :: Int , time) where CacheTupleType <: Tuple
121+ assemble_interface! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_composite_interface ! (Kₑ, uₑ, interface, interface_cache. inner_caches, time)
122+ @unroll function assemble_composite_interface ! (Kₑ:: AbstractMatrix , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
116123 @unroll for inner_cache ∈ inner_caches
117- assemble_interface! (Kₑ, uₑ, interface, inner_cache, local_facet_index, time)
124+ assemble_interface! (Kₑ, uₑ, interface, inner_cache, time)
118125 end
119126end
120127# Update element matrix and residual in nonlinear operators
121- assemble_interface! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_interface ! (Kₑ, residualₑ, uₑ, interface, interface_cache. inner_caches, time)
122- @unroll function assemble_interface ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , local_facet_index :: Int , time) where CacheTupleType <: Tuple
128+ assemble_interface! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_composite_interface ! (Kₑ, residualₑ, uₑ, interface, interface_cache. inner_caches, time)
129+ @unroll function assemble_composite_interface ! (Kₑ:: AbstractMatrix , residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
123130 @unroll for inner_cache ∈ inner_caches
124- assemble_interface! (Kₑ, residualₑ, uₑ, interface, inner_cache, local_facet_index, time)
131+ assemble_interface! (Kₑ, residualₑ, uₑ, interface, inner_cache, time)
125132 end
126133end
127134# Update residual in nonlinear operators
128- assemble_interface! (residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_interface ! (Kₑ, interface, interface_cache. inner_caches, time)
129- @unroll function assemble_interface ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , local_facet_index :: Int , time) where CacheTupleType <: Tuple
135+ assemble_interface! (residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, interface_cache:: CompositeInterfaceElementCache , time) = assemble_composite_interface ! (Kₑ, interface, interface_cache. inner_caches, time)
136+ @unroll function assemble_composite_interface ! (residualₑ:: AbstractVector , uₑ:: AbstractVector , interface, inner_caches:: CacheTupleType , time) where CacheTupleType <: Tuple
130137 @unroll for inner_cache ∈ inner_caches
131- assemble_interface! (residualₑ, uₑ, interface, inner_cache, local_facet_index, time)
138+ assemble_interface! (residualₑ, uₑ, interface, inner_cache, time)
132139 end
133140end
0 commit comments