1
- function map = annulusmap(rgn )
2
- % ANNULUSMAP Solve the nonlinear system for D-SC parameter.
3
- % ANNULUSMAP(RGN) solves the nonlinear system for D-SC parameter of a
4
- % doubly connected region RGN as created by DSCPOLYGONS.
5
- %
6
- % See also DSCPOLYGONS.
7
-
8
- % Copyright by Alfa Heryudono, 2003.
9
-
10
- % Get inner and outer polygons from region rgn
11
- [p1 p0 ] = get(rgn );
12
-
13
- % Making the bridge to old subroutine :-) (I am lazy to clean the code
14
- % right now)
15
- map.region = rgn ; % store rgn. Needed by plot. Too many unnecessary assignment. clean code later.
16
-
17
- % Check if the outer polygon is unbounded (ISHAPE = 1)
18
- if isinf(p0 )==1
19
- % Truncate Infinite vertices.
20
- p0 = truncate(p0 );
21
- map.M = length(p0 ); map.N = length(p1 );
22
- map.Z0 = vertex(p0 ).' ; map.Z1 = vertex(Z1 ).' ;
23
- map.ALFA0 = angle(p0 )' ; map.ALFA1 = 2 - angle(p1 )' ;
24
- map.ISHAPE = 1 ;
25
- else
26
- p0 = truncate(p0 );
27
- map.M = length(p0 ); map.N = length(p1 );
28
- map.Z0 = vertex(p0 ).' ; map.Z1 = vertex(p1 ).' ;
29
- map.ALFA0 = angle(p0 )' ; map.ALFA1 = 2 - angle(p1 )' ;
30
- map.ISHAPE = 0 ;
1
+ classdef annulusmap
2
+ % ANNULUSMAP Conformal map to doubly connected polygonal region.
3
+ % ANNULUSMAP(POLYOUTER,POLYINNER) creates a Schwarz-Christoffel annulus
4
+ % map to the region bounded by polygons POLYOUTER and POLYINNER.
5
+ %
6
+ % ANNULUSMAP(POLYOUTER,POLYINNER,'truncate') will truncate any unbounded
7
+ % sides. Otherwise an error is thrown for unbounded regions.
8
+
9
+ % Copyright by Toby Driscoll, 2014
10
+ % Written by Alfa Heryudono, 2003 and Toby Driscoll, 2014.
11
+
12
+ properties
13
+ boundary
14
+ M , N , Z0 , Z1 , ALFA0 , ALFA1
15
+ isUnbounded
16
+ qwork
17
+ u , c , w0 , w1 , phi0 , phi1
18
+ end
19
+
20
+ properties (Dependent )
21
+ % backward compatibility
22
+ ISHAPE
23
+ end
24
+
25
+ methods
26
+
27
+ function map = annulusmap(outerPolygon ,innerPolygon ,varargin )
28
+
29
+ map.boundary = { outerPolygon , innerPolygon };
30
+
31
+ if isinf(outerPolygon )
32
+ if (nargin < 3 ) || ~isequal(varargin{1 },' truncate' )
33
+ error(' Region must be bounded, or extra option given.' )
34
+ else
35
+ outerPolygon = truncate(outerPolygon );
36
+ map.isUnbounded = true ;
37
+ end
38
+ else
39
+ map.isUnbounded = false ;
40
+ end
41
+
42
+ map.M = length(outerPolygon ); map.N = length(innerPolygon );
43
+ map.Z0 = vertex(outerPolygon ).' ;
44
+ map.Z1 = vertex(innerPolygon ).' ;
45
+ map.ALFA0 = angle(outerPolygon )' ;
46
+ map.ALFA1 = 2 - angle(innerPolygon )' ;
47
+
48
+ % Generate the Gauss-Jacobi weights & nodes
49
+ nptq = 8 ;
50
+ map.qwork = qinit(map ,nptq );
51
+
52
+ % Solve parameter problem.
53
+ iguess = 0 ; % (0 nonequally spaced guess or 1 equally spaced guess)
54
+ linearc = 1 ; % (0 line path or 1 circular path)
55
+ [map .u ,map .c ,map .w0 ,map .w1 ,map .phi0 ,map .phi1 ] = ...
56
+ dscsolv(iguess ,nptq ,map .qwork ,map .isUnbounded ,linearc ,map );
57
+
58
+ end
59
+
60
+ function I = get .ISHAPE(map )
61
+ I = map .isUnbounded ;
62
+ end
63
+ end
31
64
end
32
-
33
- % Generate the Gauss-Jacobi weights & nodes
34
- nptq = 8 ;
35
- map.qwork = qinit(map ,nptq );
36
-
37
- % Solve D-SC parameter
38
- iguess = 0 ; % (0 nonequally spaced guess or 1 equally spaced guess)
39
- linearc = 1 ; % (0 line path or 1 circular path)
40
- [map .u ,map .c ,map .w0 ,map .w1 ,map .phi0 ,map .phi1 ] = dscsolv(iguess ,nptq ,map .qwork ,map .ISHAPE ,linearc ,map );
41
-
42
- map = class(map ,' annulusmap' );
0 commit comments