Skip to content

Commit

Permalink
ideas sketch for fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed May 26, 2021
1 parent 4a480ea commit 90d07aa
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions src/mesh/column_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ struct CenterFiniteDifferenceMesh{T,C} <: AbstractMesh
end
=#

# TODO:
# - add interval domain
# - move order out of Mesh?
# -
#

"""
ColumnMesh
Expand All @@ -255,6 +261,7 @@ struct ColumnMesh{S, F, C, ICF, ∇CF, ∇FC, ∇FF, O} <: AbstractMesh
order::O
end


function ColumnMesh{S}(
face::F,
cent::C,
Expand Down Expand Up @@ -539,6 +546,15 @@ function ∇_cent_to_face_operator(
return SparseMatrix{n_rows, n_cols}(sparse_mat)
end


struct Gradient{From,To} <: Operator{From,To}
end

function full_stencil(Gradient{Cent,Face}, mesh)

end


"""
∇_face_to_cent_operator(::OrderOfAccuracy{2}, Δh_face::AbstractVector)
Expand Down Expand Up @@ -603,6 +619,60 @@ function ∇_face_to_face_operator(
return SparseMatrix{n_rows,n_rows}(sparse_mat)
end

#=
TODO: start sketching out ideas for fusing operations
# A is on a center mesh with halo 1
# v is on a face mesh with halo 0
Face(A) # interpolate to face mesh with halo 0
v*Face(A) # elementwise multiplication (face mesh halo 0)
Gradient(v*Face(A)) # center mesh with halo 0
map(Gradient(v*Face(A)), column) # gradient on to CenterColumnMesh
# center face
# ---- -2
# -1
# ---- -1
# Halo 0
# ==== 0
# 1
# ----
# 2
# ....
# n
# ==== n
# Halo n+1
# ---- n+1
# center face
# ---- 1
# 1
# ---- h
# Halo h
# ==== h+1
# h+1
# ----
# 4
# ....
# n+h
# ==== n+h+1
# Halo n+h+1
# ---- n+h+2
for i = 1:n
face_a1 = (A[i-1] + A[i]) / 2
face_a2 = (A[i] + A[i+1]) / 2
va1 = v*face_a1
va2 = v*face_a2
(va2 - va1) / Δh
end
diff(field)[i] = (field[i] - field[i-1]) / deltaH
=#

#####
##### 2nd Dderivative operators
Expand Down

0 comments on commit 90d07aa

Please sign in to comment.