-
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
Use Vec() instead of complex number for non-complex SIEs. #80
Comments
I think this will be an improvement. Currently, we are using complex numbers to represent (i) the real & imaginary parts of a Complex numbers in Julia are Julian types, so I don't expect this will significantly alter performance. Instead, it will bring clarity to the situations above. It will also generalize to 3D. We should be able to distinguish between a line integral over a scalar field (∫ f ds) and a vector field (∫ F ⋅ dr). |
Perhaps the last part is a question... |
c=rand(Complex128,20)
v=unsafe_wrap(Array,reinterpret(Ptr{Vec{2,Float64}},pointer(c)),20)
v[1]=Vec(1,2)
c[1] # returns 1.0+2.0im |
(Note that |
Gotcha. |
Slightly off-topic, sorry, but does Vec refer to FixedSizeArrays? I've recently switched to using StaticArrays (following this discussion) for small vectors in 2D-3D. It is often convenient in code that the vectors in StaticArrays inherit from AbstractArray, whereas those in FixedSizeArrays don't. The constructors are also more friendly. (On the other hand, tracing dependencies in ApproxFun it seems FixedSizeArrays are imported via Plots, so switching may not be an option.) |
Yep, I was referring to FixedSizeArrays. It looks from that link that even @SimonDanisch agrees that StaticArrays is the way forward, and after spending a day adding special cases for Vec to ApproxFun, I also agree. Though it's 0.5 only so let's postpone this change til 0.4 support is dropped (which should wait til the type inference big is fixed) Sent from my iPhone
|
I see, I did not realize the 0.5 restriction of StaticArrays. |
ApproxFun now supports (for the most part) 1D domains embedded in R^2. This should be used here, partly to draw a distinction between
dz
andds
, which are still confusing.In this case, whether it's
dz
ords
would be inferred from the domain:This requires a bit of work in ApproxFun before it can be used. For example, I'd want the following to work:
The text was updated successfully, but these errors were encountered: