Skip to content

Commit 49836b6

Browse files
authored
Update shapes.jl
1 parent ac9a752 commit 49836b6

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/Common/shapes.jl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export Custom,Circle,Rectangle,Ellipse
1+
export Custom,Circle,Rectangle,Ellipse,CustomR
22
using SpecialFunctions
33
"""
44
Circle(d)
@@ -29,6 +29,15 @@ A custom inclusion
2929
struct Custom <: Geometry
3030
F::Array{Complex{Float64},2}
3131
end
32+
"""
33+
CustomR(f)
34+
A custom inclusion
35+
# Attributes
36+
* `f` : predefinded custom real space matrix
37+
"""
38+
struct Custom <: Geometry
39+
f::Array{Complex{Float64},2}
40+
end
3241
"""
3342
Ellipse(dx,dy)
3443
An elliptic inclusion
@@ -50,6 +59,9 @@ end
5059
function reciprocal(c::Custom,dnx,dny)
5160
return c.F
5261
end
62+
function reciprocal(c::CustomR,dnx,dny)
63+
return real2recip(dnx,dny,c.f)
64+
end
5365
function reciprocal(e::Ellipse,dnx,dny)
5466
radix=Matrix(.5*sqrt.((dnx*e.dx).^2+(dny*e.dy).^2))
5567
result=besselj.(1,2*pi*radix)./radix
@@ -69,6 +81,10 @@ function drawable(c::Custom)
6981
@warn "The drawable method is not implemented for Custom geometries."
7082
return 0,0
7183
end
84+
function drawable(c::CustomR)
85+
@warn "The drawable method is not implemented for Custom geometries."
86+
return 0,0
87+
end
7288
function drawable(c::Circle)
7389
phivals=2pi*(0:.01:1)
7490
return c.d*.5cos.(phivals),c.d*.5sin.(phivals)

0 commit comments

Comments
 (0)