Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

[WIP] (issue #237) Allow distinct type for grid vs. function value in BC constructor #260

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

AndiMD
Copy link

@AndiMD AndiMD commented Aug 9, 2020

Hi there,

This should allow RobinBC and GeneralBC to take different types between function values and grid spacing (#237).

  • The dot product a⋅b complex conjugates a, so I replaced it with a' ⋅b. Is there a better way?
  • RobinBC/NeumannBC/DirchletBC is tested with ComplexF64
  • I did equivalent changes for GeneralBC, but this looks untested/WIP at the moment, so this is untested

Suggestions welcome! I'm still new to the Github workflow, so please be gentle ;)

end
s0_l = S_l[:,1] ; Sl = S_l[:,2:end]
s0_r = S_r[:,end] ; Sr = S_r[:,(end-1):-1:1]

denoml = αl[2] .+ αl[3:end] ⋅ s0_l
denomr = αr[2] .+ αr[3:end] ⋅ s0_r
denoml = αl[2] .+ αl[3:end]' ⋅ s0_l
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why adjoint?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⋅(a,b) complex conjugates a. I believe this should not be complex conjugated.

Should probably have been conj. instead of adjoint (same result due to the dot).


# other acceptable argument signatures
#RobinBC(al::T, bl::T, cl::T, dx_l::T, ar::T, br::T, cr::T, dx_r::T, order = 1) where T = RobinBC([al,bl, cl], [ar, br, cr], dx_l, order)

Base.:*(Q::AffineBC, u::AbstractVector) = BoundaryPaddedVector(Q.a_l ⋅ u[1:length(Q.a_l)] + Q.b_l, Q.a_r ⋅ u[(end-length(Q.a_r)+1):end] + Q.b_r, u)
Base.:*(Q::AffineBC, u::AbstractVector) = BoundaryPaddedVector( Q.a_l'⋅ u[1:length(Q.a_l)] + Q.b_l, Q.a_r' ⋅ u[(end-length(Q.a_r)+1):end] + Q.b_r, u )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea that the dot-product should not complex conjugate came from this line. I figured it should be the same for GeneralBC

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants