-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allow for any smooth particle #11
Comments
This would be an amazing feature, and thanks for the notes. The Zn that creates the T-matrix is independent of the position of the particle, if this is the case for all T-matrices (which it looks like it is), we may want to make this structure obvious. On a side not, we've missed a pretty obvious optimisation in the current code, given that the Zns are recalculated for each particle It's also kinda odd that We could also use a structure a little like this type Particle{T,S} where T <: AbstractFloat, S <: Shape{T}
x::Vector{T} #position of the centre
shape::S
c::Complex{T} # phase wave speed inside the particle
ρ::T # the particles density
end I think it would then be possible to implement the function tmatrix{T}(p::Particle{T,Circle{T}}, k::T, hankel_order::Int, exciting_hankel_order::Int=hankel_order)
if hankel_order == exciting_hankel_order
Zn{T}(p, k, hankel_order)
else 0
end
end the dispatch would then be on the parametric type. Not sure what's best, will continue to think about it. |
The dispatch based on parametric type does look simpler! One issue is that the particle might not have a constant Yes it is a little odd that The T-matrix is independent of particle position and of the incident wave. |
One way to solve this would be for Particle to have a The outer radius can be a method of the shape, rather than an attribute of the particle. Where is the outer radius used? |
That could work. The physical properties and shape (included outer and inner radius) are needed to generate the t-matrix, internal waves and place particles. Not sure I understand how the outer radius can be only a method of the shape, without storing it as a property as well. Could you perhaps give a code snippet =]? |
outer_radius(shape::Circle) = shape.radius
outer_radius(shape::Square) = shape.width/sqrt(2)
outer_radius(p::Particle) = outer_radius(p.shape) |
The machinery is currently in place, for each physics type and shape, you just need to implement the necessary |
I think we should: use the T-matrix to allow for any (smooth) particle.
For some details on the maths, see T-matrix.pdf, which also shows how to use a generic incident wave #10.
For the particle shall we just:
Do you envisage any efficiency problems with this?
The text was updated successfully, but these errors were encountered: