2D on a circular domain with parallel map
For this example we will solve the head equation with a mangetic field aligned with the grid in a circular domain
\[ \mathbf{B} = (0,0,1)\]
In this case we expect the parallel operator to do nothing since $\mathbf{P}_f=\mathbf{P}_b=I$
using FaADE
We first need to create a domain to solve the PDE using
nx = ny = 21;
order = 2;
The interior grid will be a square,
g0lw = 0.25
D1 = Grid2D(
u -> [-g0lw, -g0lw] + u * ([g0lw, -g0lw] - [-g0lw, -g0lw]),
v -> [-g0lw, -g0lw] + v * ([-g0lw, g0lw] - [-g0lw, -g0lw]),
v -> [g0lw, -g0lw] + v * ([g0lw, g0lw] - [g0lw, -g0lw]),
u -> [-g0lw, g0lw] + u * ([g0lw, g0lw] - [-g0lw, g0lw]),
nx, ny)
Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.25 … -0.25 -0.25; -0.22500000000000003 -0.22500000000000003 … -0.22500000000000003 -0.22500000000000003; … ; 0.22499999999999998 0.22499999999999998 … 0.225 0.22499999999999998; 0.25 0.25 … 0.25 0.25], [-0.25 -0.22499999999999998 … 0.22499999999999998 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25; … ; -0.25 -0.22499999999999992 … 0.22499999999999995 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25], 0.05, 0.05, 21, 21, [0.2499999999999999 0.24999999999999967 … 0.2499999999999996 0.2499999999999999; 0.25000000000000006 0.24999999999999975 … 0.2499999999999999 0.25000000000000006; … ; 0.2500000000000013 0.2499999999999999 … 0.2499999999999999 0.2500000000000007; 0.25000000000000044 0.25000000000000017 … 0.25000000000000017 0.25000000000000044], [2.0000000000000027 2.000000000000002 … 2.0000000000000027 2.0000000000000027; 2.0000000000000004 2.0000000000000018 … 2.0000000000000004 2.0000000000000004; … ; 2.0000000000000004 2.0000000000000004 … 2.0000000000000004 2.0000000000000004; 1.9999999999999982 1.9999999999999982 … 1.9999999999999982 1.9999999999999982], [-8.326672684688678e-16 -0.0 … 0.0 8.326672684688678e-16; -3.0531133177191797e-15 -1.1102230246251577e-15 … 0.0 3.885780586188047e-15; … ; -2.2204460492503016e-15 -0.0 … 0.0 2.2204460492503068e-15; 8.326672684688659e-16 -0.0 … 0.0 -8.326672684688659e-16], [-8.326672684688678e-16 1.1102230246251581e-15 … -1.1102230246251583e-15 8.326672684688678e-16; -0.0 1.1102230246251577e-15 … -2.2204460492503143e-15 -0.0; … ; 0.0 0.0 … 0.0 0.0; 8.326672684688659e-16 6.383782391594646e-15 … -2.2204460492503115e-15 -8.326672684688659e-16], [1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982; 1.9999999999999991 2.0000000000000004 … 2.0000000000000004 1.9999999999999991; … ; 1.9999999999999893 2.0000000000000004 … 2.0000000000000004 1.9999999999999938; 1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982])
For the surrounding domains we need the shape of the circular domain. There is an inbuilt function for generating toroidal surfaces which we can use to construct the boundary curves,
R = 1.0
Tor = FaADE.Grid.Torus([R],[R],[1],[0])
FaADE.Grid.Torus{Float64}([1.0], [1.0], [1], [0])
Right domain
D2 = Grid2D(#u->[0.25, -u*0.5 + 0.25], # Bottom
u -> [g0lw, g0lw] + u * ([g0lw, -g0lw] - [g0lw, g0lw]),
v -> v * (Tor(π / 4, 0.0) - [g0lw, g0lw]) + [g0lw, g0lw], # Left
v -> v * (Tor(7π / 4, 0.0) + [-g0lw, g0lw]) + [g0lw, -g0lw], # Right
u -> Tor(u * (7π / 4 - 9π / 4) + 9π / 4, 0.0), # Top
nx, ny)
Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865477; 0.25 0.2755202982800016 … 0.7348856673200291 0.7604059656000306; … ; 0.25 0.2755202982800015 … 0.7348856673200291 0.7604059656000305; 0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.22500000000000003 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.24622240241650922 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477], 0.05, 0.05, 21, 21, [0.22855339059327265 0.26802911048174666 … 0.9785920684742284 1.0180677883626998; 0.25520298280001585 0.294521839292405 … 1.002261256155422 1.0415801126478192; … ; 0.25520298280001463 0.2945218392924056 … 1.0022612561554214 1.0415801126478135; 0.2285533905932732 0.268029110481744 … 0.9785920684742307 1.0180677883626998], [2.000000000000004 1.7054370712381166 … 0.46710656657911087 0.4489944445857478; 1.66317824217121 1.4411428685557914 … 0.4234904279931209 0.40750398666041693; … ; -1.66317824217124 -1.4411428685557903 … -0.4234904279931223 -0.4075039866604188; -1.9999999999999984 -1.7054370712381335 … -0.46710656657910976 -0.4489944445857464], [-2.0000000000000036 -1.7054370712381166 … -0.46710656657911315 -0.4489944445857493; -2.0000000000000004 -1.7329987033433316 … -0.5092544109286432 -0.4900304445161845; … ; -2.0000000000000004 -1.7329987033433298 … -0.5092544109286403 -0.49003044451618305; -1.9999999999999991 -1.7054370712381335 … -0.46710656657910976 -0.44899444458574855], [2.1876726427121165 1.979972417430856 … 1.1068091654513827 1.094038068171226; 1.9592247493118597 1.8153518453217952 … 1.1559406465912985 1.1455818659089523; … ; 1.959224749311869 1.8153518453217914 … 1.1559406465913016 1.1455818659089565; 2.187672642712116 1.979972417430863 … 1.1068091654513834 1.0940380681712263], [-9.108017018555845e-16 0.2077002252812524 … 1.0808634772607228 1.0936345745408618; 0.0 0.1730096033510473 … 0.9659627361068683 0.9784193452900326; … ; -0.0 -0.1730096033510488 … -0.9659627361068712 -0.9784193452900402; 9.108017018555823e-16 -0.20770022528124515 … -1.0808634772607277 -1.0936345745408673])
Top domain
D3 = Grid2D(#u->[u*0.5 - g0lw, g0lw], # Bottom
u -> [-g0lw, g0lw] + u * ([g0lw, g0lw] - [-g0lw, g0lw]),
v -> v * (Tor(3π / 4, 0.0) + [g0lw, -g0lw]) + [-g0lw, g0lw], # Left
v -> v * (Tor(π / 4, 0.0) - [g0lw, g0lw]) + [g0lw, g0lw], # Right
u -> Tor(u * (π / 4 - 3π / 4) + 3π / 4, 0.0), # Top
nx, ny)
Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136741 0.6494480483301835; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.25 0.2755202982800016 … 0.7348856673200295 0.7604059656000309; … ; 0.25 0.2755202982800015 … 0.7348856673200296 0.760405965600031; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865475], 0.05, 0.05, 21, 21, [0.2285533905932726 0.26802911048174655 … 0.9785920684742393 1.018067788362703; 0.25520298280001585 0.29452183929240516 … 1.0022612561554243 1.0415801126478128; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554232 1.0415801126478221; 0.2285533905932732 0.26802911048174594 … 0.9785920684742406 1.0180677883627118], [2.0000000000000036 1.7054370712381173 … 0.467106566579108 0.4489944445857453; 2.0000000000000004 1.7329987033433305 … 0.509254410928641 0.4900304445161848; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286427 0.49003044451618527; 1.9999999999999991 1.705437071238121 … 0.46710656657910504 0.44899444458573784], [2.0000000000000044 1.7054370712381173 … 0.4671065665791057 0.4489944445857418; 1.6631782421712136 1.441142868555785 … 0.4234904279931233 0.4075039866604156; … ; -1.6631782421712213 -1.4411428685557925 … -0.4234904279931204 -0.407503986660415; -1.999999999999998 -1.705437071238121 … -0.4671065665791073 -0.4489944445857414], [9.108017018555847e-16 -0.20770022528125145 … -1.0808634772607257 -1.0936345745408738; -0.0 -0.1730096033510491 … -0.9659627361068651 -0.9784193452900407; … ; 0.0 0.1730096033510491 … 0.9659627361068684 0.9784193452900319; -9.108017018555823e-16 0.20770022528124363 … 1.080863477260723 1.0936345745408738], [2.187672642712117 1.9799724174308566 … 1.10680916545138 1.094038068171232; 1.9592247493118597 1.815351845321794 … 1.1559406465912971 1.1455818659089594; … ; 1.9592247493118677 1.8153518453217952 … 1.1559406465912985 1.1455818659089492; 2.187672642712116 1.979972417430865 … 1.1068091654513827 1.094038068171232])
Left domain
D4 = Grid2D(#u->[-g0lw,u*0.5 - g0lw],
u -> [-g0lw, -g0lw] + u * ([-g0lw, g0lw] - [-g0lw, -g0lw]),
v -> v * (Tor(5π / 4, 0.0) - [-g0lw, -g0lw]) + [-g0lw, -g0lw],
v -> v * (Tor(3π / 4, 0.0) - [-g0lw, g0lw]) + [-g0lw, g0lw],
u -> Tor(u * (3π / 4 - 5π / 4) + 5π / 4, 0.0),
nx, ny)
Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200296 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.7348856673200295 -0.760405965600031; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], [-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136744 0.6494480483301838; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], 0.05, 0.05, 21, 21, [0.22855339059327265 0.2680291104817466 … 0.9785920684742337 1.0180677883626998; 0.2552029828000156 0.29452183929240555 … 1.0022612561554214 1.0415801126478073; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554263 1.0415801126478232; 0.2285533905932732 0.2680291104817459 … 0.9785920684742382 1.0180677883627083], [-2.000000000000004 -1.7054370712381168 … -0.4671065665791083 -0.4489944445857431; -1.6631782421712153 -1.441142868555783 … -0.42349042799312453 -0.4075039866604178; … ; 1.6631782421712213 1.4411428685557925 … 0.42349042799312137 0.4075039866604167; 1.999999999999998 1.7054370712381215 … 0.4671065665791085 0.44899444458574295], [2.0000000000000036 1.7054370712381168 … 0.4671065665791083 0.4489944445857464; 2.0000000000000004 1.732998703343332 … 0.5092544109286414 0.4900304445161836; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286411 0.4900304445161847; 1.9999999999999991 1.7054370712381215 … 0.4671065665791062 0.4489944445857394], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513859 -1.0940380681712352; -1.9592247493118617 -1.8153518453217916 … -1.1559406465913005 -1.1455818659089654; … ; -1.9592247493118677 -1.8153518453217952 … -1.1559406465912947 -1.1455818659089458; -2.187672642712116 -1.9799724174308653 … -1.106809165451381 -1.0940380681712283], [9.108017018555845e-16 -0.20770022528125193 … -1.0808634772607253 -1.0936345745408713; 0.0 -0.17300960335104695 … -0.9659627361068646 -0.9784193452900438; … ; -0.0 0.1730096033510491 … 0.9659627361068677 0.9784193452900309; -9.108017018555823e-16 0.20770022528124316 … 1.0808634772607246 1.0936345745408775])
Bottom domain
D5 = Grid2D(#u->[-u*0.5 + g0lw, -g0lw],
u -> [-g0lw, -g0lw] + u * ([g0lw, -g0lw] - [-g0lw, -g0lw]),
v -> v * (Tor(7π / 4, 0.0) - [g0lw, -g0lw]) + [g0lw, -g0lw],
v -> v * (Tor(5π / 4, 0.0) - [-g0lw, -g0lw]) + [-g0lw, -g0lw],
u -> Tor(u * (5π / 4 - 7π / 4) + 7π / 4, 0.0),
nx, ny)
Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474; 0.22499999999999995 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.2462224024165092 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.2728553390593274 … -0.6842514421272203 -0.7071067811865477], [-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200294 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.734885667320029 -0.7604059656000306; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], 0.05, 0.05, 21, 21, [0.22855339059327368 0.2680291104817465 … 0.9785920684742226 1.0180677883626972; 0.25520298280001585 0.2945218392924054 … 1.00226125615542 1.0415801126478168; … ; 0.2552029828000148 0.29452183929240544 … 1.0022612561554236 1.0415801126478255; 0.2285533905932732 0.2680291104817449 … 0.9785920684742245 1.0180677883626945], [-1.9999999999999944 -1.7054370712381175 … -0.46710656657911365 -0.44899444458574755; -2.0000000000000004 -1.7329987033433292 … -0.5092544109286421 -0.4900304445161834; … ; -2.0000000000000004 -1.732998703343327 … -0.5092544109286424 -0.4900304445161857; -1.9999999999999991 -1.7054370712381277 … -0.46710656657911276 -0.4489944445857455], [-1.999999999999995 -1.7054370712381175 … -0.46710656657911365 -0.4489944445857498; -1.6631782421712242 -1.4411428685557905 … -0.42349042799312175 -0.40750398666041726; … ; 1.6631782421712349 1.4411428685557892 … 0.42349042799311915 0.4075039866604156; 2.0000000000000084 1.7054370712381277 … 0.46710656657911276 0.4489944445857488], [-9.108017018555803e-16 0.207700225281252 … 1.0808634772607302 1.0936345745408722; -0.0 0.17300960335104706 … 0.9659627361068703 0.978419345290037; … ; 0.0 -0.17300960335104892 … -0.9659627361068702 -0.9784193452900288; 9.108017018555823e-16 -0.20770022528124393 … -1.0808634772607209 -1.0936345745408742], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513807 -1.0940380681712214; -1.9592247493118597 -1.8153518453217945 … -1.155940646591302 -1.145581865908955; … ; -1.9592247493118677 -1.8153518453217954 … -1.155940646591299 -1.1455818659089434; -2.187672642712116 -1.9799724174308644 … -1.10680916545139 -1.094038068171232])
Finally, we need to tell the grid how everything is connected, this can be done by setting a tuple of boundary objects,
joints = ((Joint(2, Right), Joint(3, Up), Joint(4, Left), Joint(5, Down)), #Domain 1
(Joint(1, Down), Joint(3, Left), Joint(5, Right)), #Domain 2
(Joint(1, Down), Joint(4, Left), Joint(2, Right)), #Domain 3
(Joint(1, Down), Joint(5, Left), Joint(3, Right)), #Domain 4
(Joint(1, Down), Joint(2, Left), Joint(4, Right))) #Domain 5
((Joint(2, FaADE.Helpers.NodeType{:Right, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Left, 2}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(3, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(2, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(5, FaADE.Helpers.NodeType{:Left, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(2, FaADE.Helpers.NodeType{:Left, 1}()), Joint(4, FaADE.Helpers.NodeType{:Right, 1}())))
We can then build the grid,
Dom = GridMultiBlock((D1, D2, D3, D4, D5), joints)
GridMultiBlock{Float64, 2, CurvilinearMetric, NTuple{5, Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}}, Tuple{NTuple{4, Joint}, Vararg{Tuple{Joint, Joint, Joint}, 4}}, Vector{Vector{Int64}}}((Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.25 … -0.25 -0.25; -0.22500000000000003 -0.22500000000000003 … -0.22500000000000003 -0.22500000000000003; … ; 0.22499999999999998 0.22499999999999998 … 0.225 0.22499999999999998; 0.25 0.25 … 0.25 0.25], [-0.25 -0.22499999999999998 … 0.22499999999999998 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25; … ; -0.25 -0.22499999999999992 … 0.22499999999999995 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25], 0.05, 0.05, 21, 21, [0.2499999999999999 0.24999999999999967 … 0.2499999999999996 0.2499999999999999; 0.25000000000000006 0.24999999999999975 … 0.2499999999999999 0.25000000000000006; … ; 0.2500000000000013 0.2499999999999999 … 0.2499999999999999 0.2500000000000007; 0.25000000000000044 0.25000000000000017 … 0.25000000000000017 0.25000000000000044], [2.0000000000000027 2.000000000000002 … 2.0000000000000027 2.0000000000000027; 2.0000000000000004 2.0000000000000018 … 2.0000000000000004 2.0000000000000004; … ; 2.0000000000000004 2.0000000000000004 … 2.0000000000000004 2.0000000000000004; 1.9999999999999982 1.9999999999999982 … 1.9999999999999982 1.9999999999999982], [-8.326672684688678e-16 -0.0 … 0.0 8.326672684688678e-16; -3.0531133177191797e-15 -1.1102230246251577e-15 … 0.0 3.885780586188047e-15; … ; -2.2204460492503016e-15 -0.0 … 0.0 2.2204460492503068e-15; 8.326672684688659e-16 -0.0 … 0.0 -8.326672684688659e-16], [-8.326672684688678e-16 1.1102230246251581e-15 … -1.1102230246251583e-15 8.326672684688678e-16; -0.0 1.1102230246251577e-15 … -2.2204460492503143e-15 -0.0; … ; 0.0 0.0 … 0.0 0.0; 8.326672684688659e-16 6.383782391594646e-15 … -2.2204460492503115e-15 -8.326672684688659e-16], [1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982; 1.9999999999999991 2.0000000000000004 … 2.0000000000000004 1.9999999999999991; … ; 1.9999999999999893 2.0000000000000004 … 2.0000000000000004 1.9999999999999938; 1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865477; 0.25 0.2755202982800016 … 0.7348856673200291 0.7604059656000306; … ; 0.25 0.2755202982800015 … 0.7348856673200291 0.7604059656000305; 0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.22500000000000003 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.24622240241650922 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477], 0.05, 0.05, 21, 21, [0.22855339059327265 0.26802911048174666 … 0.9785920684742284 1.0180677883626998; 0.25520298280001585 0.294521839292405 … 1.002261256155422 1.0415801126478192; … ; 0.25520298280001463 0.2945218392924056 … 1.0022612561554214 1.0415801126478135; 0.2285533905932732 0.268029110481744 … 0.9785920684742307 1.0180677883626998], [2.000000000000004 1.7054370712381166 … 0.46710656657911087 0.4489944445857478; 1.66317824217121 1.4411428685557914 … 0.4234904279931209 0.40750398666041693; … ; -1.66317824217124 -1.4411428685557903 … -0.4234904279931223 -0.4075039866604188; -1.9999999999999984 -1.7054370712381335 … -0.46710656657910976 -0.4489944445857464], [-2.0000000000000036 -1.7054370712381166 … -0.46710656657911315 -0.4489944445857493; -2.0000000000000004 -1.7329987033433316 … -0.5092544109286432 -0.4900304445161845; … ; -2.0000000000000004 -1.7329987033433298 … -0.5092544109286403 -0.49003044451618305; -1.9999999999999991 -1.7054370712381335 … -0.46710656657910976 -0.44899444458574855], [2.1876726427121165 1.979972417430856 … 1.1068091654513827 1.094038068171226; 1.9592247493118597 1.8153518453217952 … 1.1559406465912985 1.1455818659089523; … ; 1.959224749311869 1.8153518453217914 … 1.1559406465913016 1.1455818659089565; 2.187672642712116 1.979972417430863 … 1.1068091654513834 1.0940380681712263], [-9.108017018555845e-16 0.2077002252812524 … 1.0808634772607228 1.0936345745408618; 0.0 0.1730096033510473 … 0.9659627361068683 0.9784193452900326; … ; -0.0 -0.1730096033510488 … -0.9659627361068712 -0.9784193452900402; 9.108017018555823e-16 -0.20770022528124515 … -1.0808634772607277 -1.0936345745408673]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136741 0.6494480483301835; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.25 0.2755202982800016 … 0.7348856673200295 0.7604059656000309; … ; 0.25 0.2755202982800015 … 0.7348856673200296 0.760405965600031; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865475], 0.05, 0.05, 21, 21, [0.2285533905932726 0.26802911048174655 … 0.9785920684742393 1.018067788362703; 0.25520298280001585 0.29452183929240516 … 1.0022612561554243 1.0415801126478128; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554232 1.0415801126478221; 0.2285533905932732 0.26802911048174594 … 0.9785920684742406 1.0180677883627118], [2.0000000000000036 1.7054370712381173 … 0.467106566579108 0.4489944445857453; 2.0000000000000004 1.7329987033433305 … 0.509254410928641 0.4900304445161848; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286427 0.49003044451618527; 1.9999999999999991 1.705437071238121 … 0.46710656657910504 0.44899444458573784], [2.0000000000000044 1.7054370712381173 … 0.4671065665791057 0.4489944445857418; 1.6631782421712136 1.441142868555785 … 0.4234904279931233 0.4075039866604156; … ; -1.6631782421712213 -1.4411428685557925 … -0.4234904279931204 -0.407503986660415; -1.999999999999998 -1.705437071238121 … -0.4671065665791073 -0.4489944445857414], [9.108017018555847e-16 -0.20770022528125145 … -1.0808634772607257 -1.0936345745408738; -0.0 -0.1730096033510491 … -0.9659627361068651 -0.9784193452900407; … ; 0.0 0.1730096033510491 … 0.9659627361068684 0.9784193452900319; -9.108017018555823e-16 0.20770022528124363 … 1.080863477260723 1.0936345745408738], [2.187672642712117 1.9799724174308566 … 1.10680916545138 1.094038068171232; 1.9592247493118597 1.815351845321794 … 1.1559406465912971 1.1455818659089594; … ; 1.9592247493118677 1.8153518453217952 … 1.1559406465912985 1.1455818659089492; 2.187672642712116 1.979972417430865 … 1.1068091654513827 1.094038068171232]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200296 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.7348856673200295 -0.760405965600031; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], [-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136744 0.6494480483301838; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], 0.05, 0.05, 21, 21, [0.22855339059327265 0.2680291104817466 … 0.9785920684742337 1.0180677883626998; 0.2552029828000156 0.29452183929240555 … 1.0022612561554214 1.0415801126478073; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554263 1.0415801126478232; 0.2285533905932732 0.2680291104817459 … 0.9785920684742382 1.0180677883627083], [-2.000000000000004 -1.7054370712381168 … -0.4671065665791083 -0.4489944445857431; -1.6631782421712153 -1.441142868555783 … -0.42349042799312453 -0.4075039866604178; … ; 1.6631782421712213 1.4411428685557925 … 0.42349042799312137 0.4075039866604167; 1.999999999999998 1.7054370712381215 … 0.4671065665791085 0.44899444458574295], [2.0000000000000036 1.7054370712381168 … 0.4671065665791083 0.4489944445857464; 2.0000000000000004 1.732998703343332 … 0.5092544109286414 0.4900304445161836; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286411 0.4900304445161847; 1.9999999999999991 1.7054370712381215 … 0.4671065665791062 0.4489944445857394], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513859 -1.0940380681712352; -1.9592247493118617 -1.8153518453217916 … -1.1559406465913005 -1.1455818659089654; … ; -1.9592247493118677 -1.8153518453217952 … -1.1559406465912947 -1.1455818659089458; -2.187672642712116 -1.9799724174308653 … -1.106809165451381 -1.0940380681712283], [9.108017018555845e-16 -0.20770022528125193 … -1.0808634772607253 -1.0936345745408713; 0.0 -0.17300960335104695 … -0.9659627361068646 -0.9784193452900438; … ; -0.0 0.1730096033510491 … 0.9659627361068677 0.9784193452900309; -9.108017018555823e-16 0.20770022528124316 … 1.0808634772607246 1.0936345745408775]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474; 0.22499999999999995 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.2462224024165092 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.2728553390593274 … -0.6842514421272203 -0.7071067811865477], [-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200294 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.734885667320029 -0.7604059656000306; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], 0.05, 0.05, 21, 21, [0.22855339059327368 0.2680291104817465 … 0.9785920684742226 1.0180677883626972; 0.25520298280001585 0.2945218392924054 … 1.00226125615542 1.0415801126478168; … ; 0.2552029828000148 0.29452183929240544 … 1.0022612561554236 1.0415801126478255; 0.2285533905932732 0.2680291104817449 … 0.9785920684742245 1.0180677883626945], [-1.9999999999999944 -1.7054370712381175 … -0.46710656657911365 -0.44899444458574755; -2.0000000000000004 -1.7329987033433292 … -0.5092544109286421 -0.4900304445161834; … ; -2.0000000000000004 -1.732998703343327 … -0.5092544109286424 -0.4900304445161857; -1.9999999999999991 -1.7054370712381277 … -0.46710656657911276 -0.4489944445857455], [-1.999999999999995 -1.7054370712381175 … -0.46710656657911365 -0.4489944445857498; -1.6631782421712242 -1.4411428685557905 … -0.42349042799312175 -0.40750398666041726; … ; 1.6631782421712349 1.4411428685557892 … 0.42349042799311915 0.4075039866604156; 2.0000000000000084 1.7054370712381277 … 0.46710656657911276 0.4489944445857488], [-9.108017018555803e-16 0.207700225281252 … 1.0808634772607302 1.0936345745408722; -0.0 0.17300960335104706 … 0.9659627361068703 0.978419345290037; … ; 0.0 -0.17300960335104892 … -0.9659627361068702 -0.9784193452900288; 9.108017018555823e-16 -0.20770022528124393 … -1.0808634772607209 -1.0936345745408742], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513807 -1.0940380681712214; -1.9592247493118597 -1.8153518453217945 … -1.155940646591302 -1.145581865908955; … ; -1.9592247493118677 -1.8153518453217954 … -1.155940646591299 -1.1455818659089434; -2.187672642712116 -1.9799724174308644 … -1.10680916545139 -1.094038068171232])), ((Joint(2, FaADE.Helpers.NodeType{:Right, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Left, 2}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(3, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(2, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(5, FaADE.Helpers.NodeType{:Left, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(2, FaADE.Helpers.NodeType{:Left, 1}()), Joint(4, FaADE.Helpers.NodeType{:Right, 1}()))), [[21, 42, 63, 84, 105], [21, 42, 63, 84, 105]], 2)
To plot the domain,
using Plots
gridfig = plot()
for grid in Dom.Grids
scatter!(grid.gridx[:],grid.gridy[:],markersize=2)
end
gridfig
Before continuing we'll set up the boundary conditions,
Bxy(X, t) = 0.0
Dr = SAT_Dirichlet(Bxy, D2.Δy, FaADE.Up, order, D2.Δx, :Curvilinear) # Block 2 BCs
Du = SAT_Dirichlet(Bxy, D3.Δy, FaADE.Up, order, D3.Δx, :Curvilinear) # Block 3 BCs
Dl = SAT_Dirichlet(Bxy, D4.Δy, FaADE.Up, order, D4.Δx, :Curvilinear) # Block 4 BCs
Dd = SAT_Dirichlet(Bxy, D5.Δy, FaADE.Up, order, D5.Δx, :Curvilinear) # Block 5 BCs
SAT_Dirichlet{FaADE.Helpers.NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float64}, typeof(Main.Bxy), typeof(eachrow)}(FaADE.Helpers.NodeType{:Right, 2}(), 2, 2, Main.Bxy, 1600.0, [-400.0, 800.0], 0.05, 1.0, [-2.0], eachrow, 0.05, :Curvilinear)
For multiblock problems we store the boundaries in a dictionary, where the key is the index for the grid,
BCs = Dict(2 => (Dr,), 3 => (Du,), 4 => (Dl,), 5 => (Dd,))
Dict{Int64, Tuple{SAT_Dirichlet{FaADE.Helpers.NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float64}, typeof(Main.Bxy), typeof(eachrow)}}} with 4 entries:
5 => (SAT_Dirichlet{NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float6…
4 => (SAT_Dirichlet{NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float6…
2 => (SAT_Dirichlet{NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float6…
3 => (SAT_Dirichlet{NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float6…
Now for setting up the parallel map, first we specifiy the magnetic field,
function Bfield(X, x, p, t)
r = x[1]^2 + x[2]^2
X[1] = 2x[2] * exp(1 - r)
X[2] = -2x[1] * exp(1 - r)
if (x[1] == 0.0) && (x[2] == 0.0)
X[1] = 0.0
X[2] = 0.0
end
end
Bfield (generic function with 1 method)
this needs to be written in the format that Julias DifferentialEquations.jl takes,
dH(X, x, params, t) = Bfield(X, x, params, t)
dH (generic function with 1 method)
The field lines are defined in $(s,\theta)$ space, but our grid is in Cartesian space. Therefore we need to define the coordinate maps which take us from the grid to the field coordinates and then back
XtoB(x, y) = [sqrt(x^2 + y^2), atan(y, x)]
BtoX(r, θ) = [r * cos(θ), r * sin(θ)]
BtoX (generic function with 1 method)
now we can construct the parallel grids,
gridoptions = Dict("xbound" => [-10.0, 10.0], "ybound" => [-10.0, 10.0])
gdata = construct_grid(dH, Dom, [-1.0, 1.0])
Dict{Any, Any} with 5 entries:
5 => ParallelGrid{Float64, 2, ParGrid{Float64, Matrix{Float64}}, Matrix{Float…
4 => ParallelGrid{Float64, 2, ParGrid{Float64, Matrix{Float64}}, Matrix{Float…
2 => ParallelGrid{Float64, 2, ParGrid{Float64, Matrix{Float64}}, Matrix{Float…
3 => ParallelGrid{Float64, 2, ParGrid{Float64, Matrix{Float64}}, Matrix{Float…
1 => ParallelGrid{Float64, 2, ParGrid{Float64, Matrix{Float64}}, Matrix{Float…
For the parallel map, we'll specify one last function called intercept
, which will give the field lines a value if they leave the domain just in case,
intercept(u, x, y, t) = begin
if (sqrt(x^2 + y^2) ≈ 1.0)
tmp = zero(typeof(x))
return tmp
else
return u
end
end
intercept (generic function with 1 method)
then we create a Dict
of the options for the parallel map which tell the constructor to use CubicHermiteSpline
s for the interpolant and specify the intercept
interpotions = Dict("interpolant" => :chs, "intercept" => intercept)
Dict{String, Any} with 2 entries:
"intercept" => intercept
"interpolant" => :chs
now we construct the map
PData = ParallelMultiBlock(gdata, Dom, order, κ=1.0, interpopts=interpotions)
ParallelMultiBlock{Float64, 2, NTuple{5, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}}, NTuple{5, typeof(Main.intercept)}, Matrix{Float64}}(Dict{Int64, ParallelData{Float64, 2}}(5 => ParallelData{Float64, 2, FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}, FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}, typeof(Main.intercept)}(FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}(FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([-0.2277748488820298 -0.28037246642115893 … 0.2157653225730372 0.38268343236508984; -0.2154664819665235 -0.26792678614758847 … 0.2851363415814691 0.45399049973954686; … ; -0.2794528437076896 -0.2828601181538249 … 0.9569155832411376 0.9510565162951536; -0.2704043339969284 -0.2651248774078232 … 0.943316157419331 0.9238795325112865], [-0.2704043339969284 -0.26512487740782315 … 0.9433161574193306 0.923879532511287; -0.258261675264252 -0.254464166187877 … 0.9238082314787113 0.8910065241883678; … ; 0.18716571744578403 0.23775392415084837 … -0.13797444648980461 -0.30901699437494756; 0.2277748488820298 0.2803724664211585 … -0.21576532257303715 -0.3826834323650904], [5 4 … 3 3; 5 4 … 3 3; … ; 4 4 … 2 2; 4 3 … 2 2]), FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112868; 0.2794528437076896 0.28286011815382467 … -0.9569155832411373 -0.9510565162951538; … ; 0.21546648196652401 0.26792678614758786 … -0.28513634158146406 -0.45399049973954675; 0.2277748488820298 0.2803724664211584 … -0.21576532257303568 -0.3826834323650897], [0.2277748488820298 0.28037246642115893 … -0.21576532257303632 -0.3826834323650897; 0.18716571744578403 0.2377539241508484 … -0.13797444648980445 -0.30901699437494723; … ; -0.2582616752642518 -0.25446416618787704 … 0.9238082314787126 0.8910065241883678; -0.2704043339969284 -0.26512487740782315 … 0.9433161574193308 0.9238795325112868], [2 3 … 4 4; 2 2 … 4 4; … ; 5 2 … 3 3; 5 2 … 3 3])), 1.0, 1.0, Main.intercept, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 833
x: [-0.7071067811865477, 0.7071067811865474], y: [-1.0, -0.25]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, 0.05, 0.05, FaADE.Derivatives.CompositeH{2, Float64, Vector{Float64}, FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}}((FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1), FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1)), [21, 21]), [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0;;], FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}(nothing, false, [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0]), [0.0]), 4 => ParallelData{Float64, 2, FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}, FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}, typeof(Main.intercept)}(FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}(FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([-0.2704043339969284 -0.26512487740782315 … 0.943316157419331 0.9238795325112865; -0.2582616752642518 -0.254464166187877 … 0.9238082314787112 0.8910065241883678; … ; 0.18716571744578403 0.2377539241508481 … -0.13797444648980478 -0.30901699437494756; 0.2277748488820298 0.28037246642115893 … -0.21576532257303538 -0.3826834323650904], [0.2277748488820298 0.28037246642115893 … -0.21576532257303715 -0.3826834323650904; 0.21546648196652401 0.26792678614758847 … -0.28513634158147033 -0.45399049973954697; … ; 0.2794528437076896 0.2828601181538249 … -0.9569155832411378 -0.9510565162951536; 0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112865], [4 3 … 2 2; 4 3 … 2 2; … ; 3 3 … 5 5; 3 2 … 5 5]), FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([0.2277748488820298 0.28037246642115893 … -0.21576532257303568 -0.3826834323650897; 0.1871657174457845 0.2377539241508484 … -0.13797444648980378 -0.30901699437494734; … ; -0.2582616752642518 -0.2544641661878769 … 0.9238082314787114 0.8910065241883679; -0.2704043339969284 -0.26512487740782315 … 0.943316157419331 0.9238795325112866], [-0.2704043339969284 -0.26512487740782315 … 0.9433161574193308 0.9238795325112868; -0.27945284370768975 -0.28286011815382467 … 0.9569155832411373 0.9510565162951536; … ; -0.21546648196652401 -0.2679267861475877 … 0.2851363415814703 0.45399049973954664; -0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236509], [5 2 … 3 3; 5 5 … 3 3; … ; 4 5 … 2 2; 4 5 … 2 2])), 1.0, 1.0, Main.intercept, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 830
x: [-1.0, -0.25], y: [-0.7071067811865475, 0.7071067811865476]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, 0.05, 0.05, FaADE.Derivatives.CompositeH{2, Float64, Vector{Float64}, FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}}((FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1), FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1)), [21, 21]), [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0;;], FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}(nothing, false, [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0]), [0.0]), 2 => ParallelData{Float64, 2, FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}, FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}, typeof(Main.intercept)}(FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}(FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.923879532511287; 0.2582616752642518 0.254464166187877 … -0.9238082314787117 -0.8910065241883678; … ; -0.18716571744578403 -0.23775392415084795 … 0.13797444648980445 0.30901699437494745; -0.2277748488820298 -0.28037246642115893 … 0.2157653225730372 0.38268343236508984], [-0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236508995; -0.21546648196652401 -0.26792678614758847 … 0.2851363415814692 0.45399049973954686; … ; -0.2794528437076896 -0.2828601181538247 … 0.9569155832411373 0.9510565162951536; -0.2704043339969284 -0.26512487740782315 … 0.9433161574193306 0.923879532511287], [2 5 … 4 4; 2 5 … 4 4; … ; 5 5 … 3 3; 5 4 … 3 3]), FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([-0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236509; -0.1871657174457845 -0.2377539241508484 … 0.1379744464898049 0.30901699437494734; … ; 0.2582616752642518 0.2544641661878768 … -0.9238082314787116 -0.8910065241883678; 0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112868], [0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112868; 0.27945284370768975 0.28286011815382467 … -0.9569155832411377 -0.9510565162951538; … ; 0.21546648196652401 0.26792678614758747 … -0.28513634158146867 -0.45399049973954675; 0.2277748488820298 0.28037246642115893 … -0.21576532257303632 -0.3826834323650897], [3 4 … 5 5; 3 3 … 5 5; … ; 2 3 … 4 4; 2 3 … 4 4])), 1.0, 1.0, Main.intercept, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 834
x: [0.25, 1.0], y: [-0.7071067811865477, 0.7071067811865476]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, 0.05, 0.05, FaADE.Derivatives.CompositeH{2, Float64, Vector{Float64}, FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}}((FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1), FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1)), [21, 21]), [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0;;], FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}(nothing, false, [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0]), [0.0]), 3 => ParallelData{Float64, 2, FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}, FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}, typeof(Main.intercept)}(FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}(FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([0.2277748488820298 0.28037246642115893 … -0.21576532257303538 -0.3826834323650904; 0.21546648196652401 0.26792678614758847 … -0.28513634158146944 -0.45399049973954686; … ; 0.2794528437076896 0.2828601181538249 … -0.9569155832411377 -0.9510565162951536; 0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.923879532511287], [0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112865; 0.2582616752642518 0.254464166187877 … -0.9238082314787115 -0.8910065241883678; … ; -0.18716571744578403 -0.2377539241508481 … 0.13797444648980417 0.30901699437494756; -0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236508995], [3 2 … 5 5; 3 2 … 5 5; … ; 2 2 … 4 4; 2 5 … 4 4]), FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([-0.2704043339969284 -0.26512487740782315 … 0.943316157419331 0.9238795325112866; -0.27945284370768975 -0.28286011815382467 … 0.9569155832411378 0.9510565162951535; … ; -0.21546648196652401 -0.2679267861475877 … 0.28513634158147017 0.45399049973954664; -0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236509], [-0.2277748488820298 -0.28037246642115893 … 0.21576532257303538 0.38268343236509; -0.1871657174457845 -0.2377539241508484 … 0.13797444648980478 0.30901699437494734; … ; 0.2582616752642518 0.2544641661878769 … -0.9238082314787113 -0.8910065241883678; 0.2704043339969284 0.26512487740782315 … -0.943316157419331 -0.9238795325112868], [4 5 … 2 2; 4 4 … 2 2; … ; 3 4 … 5 5; 3 4 … 5 5])), 1.0, 1.0, Main.intercept, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 833
x: [-0.7071067811865475, 0.7071067811865476], y: [0.25, 1.0]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, 0.05, 0.05, FaADE.Derivatives.CompositeH{2, Float64, Vector{Float64}, FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}}((FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1), FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1)), [21, 21]), [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0;;], FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}(nothing, false, [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0]), [0.0]), 1 => ParallelData{Float64, 2, FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}, FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}, typeof(Main.intercept)}(FaADE.ParallelOperator.ParallelGrid{Float64, 2, FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}, Matrix{Float64}}(FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([-0.2704043339969284 -0.2582616752642518 … 0.18716571744578403 0.2277748488820298; -0.27945284370768975 -0.26533374150481637 … 0.17563574067782886 0.21546648196652401; … ; -0.21546648196652401 -0.17563574067782836 … 0.2653337415048167 0.2794528437076896; -0.2277748488820298 -0.18716571744578403 … 0.2582616752642518 0.2704043339969284], [0.2277748488820298 0.21546648196652401 … 0.2794528437076896 0.2704043339969284; 0.1871657174457845 0.17563574067782856 … 0.26533374150481664 0.2582616752642518; … ; -0.2582616752642518 -0.26533374150481626 … -0.1756357406778283 -0.18716571744578403; -0.2704043339969284 -0.2794528437076896 … -0.21546648196652401 -0.2277748488820298], [4 4 … 3 3; 4 4 … 3 3; … ; 5 5 … 2 2; 5 5 … 2 2]), FaADE.ParallelOperator.ParGrid{Float64, Matrix{Float64}}([0.2277748488820298 0.18716571744578403 … -0.2582616752642518 -0.2704043339969284; 0.21546648196652401 0.17563574067782886 … -0.26533374150481637 -0.27945284370768975; … ; 0.2794528437076896 0.26533374150481653 … -0.17563574067782856 -0.21546648196652401; 0.2704043339969284 0.2582616752642518 … -0.18716571744578403 -0.2277748488820298], [-0.2704043339969284 -0.2794528437076896 … -0.21546648196652401 -0.2277748488820298; -0.2582616752642518 -0.26533374150481664 … -0.17563574067782856 -0.1871657174457845; … ; 0.18716571744578403 0.17563574067782936 … 0.26533374150481637 0.2582616752642518; 0.2277748488820298 0.21546648196652401 … 0.2794528437076896 0.2704043339969284], [5 5 … 4 4; 5 5 … 4 4; … ; 2 2 … 3 3; 2 2 … 3 3])), 1.0, 1.0, Main.intercept, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 800
x: [-0.25, 0.25], y: [-0.25, 0.25]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, 0.05, 0.05, FaADE.Derivatives.CompositeH{2, Float64, Vector{Float64}, FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}}((FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1), FaADE.Derivatives.DiagonalH{Float64, Vector{Float64}}([0.5], 1.0, 0.05, 21, 1)), [21, 21]), [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0;;], FaADE.ParallelOperator.MagneticField{Nothing, :EQUILIBRIUM, Float64, Matrix{Float64}}(nothing, false, [0.0 0.0 0.0; 0.0 0.0 0.0; 0.0 0.0 0.0]), [0.0])), (Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 800
x: [-0.25, 0.25], y: [-0.25, 0.25]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 834
x: [0.25, 1.0], y: [-0.7071067811865477, 0.7071067811865476]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 833
x: [-0.7071067811865475, 0.7071067811865476], y: [0.25, 1.0]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 830
x: [-1.0, -0.25], y: [-0.7071067811865475, 0.7071067811865476]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
, Bivariate Cubic Hermite Spline Interpolation
Number of points: 441
Number of Delaunay triangles: 833
x: [-0.7071067811865477, 0.7071067811865474], y: [-1.0, -0.25]
f: [0.0, 0.0]
fx: [0.0, 0.0], fy: [0.0, 0.0]
), (Main.intercept, Main.intercept, Main.intercept, Main.intercept, Main.intercept), [[0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0]], [0.0, 0.0, 0.0, 0.0, 0.0], :chs)
Since we're in a circular domain with $u=0$ boundary conditions, we need a source term for something to happen, we'll add a circular source term
function F(X,t)
x,y = X
tmp = (2*(2x^2 - 1) + 2*(2y^2 - 1)) * exp(1 - (x^2 + y^2)) * (1 - exp(-2π^2*t))
tmp2 = -2π^2 * (exp(1 - (x^2 + y^2)) - 1) * exp(-2π^2*t)
return -(tmp + tmp2)
end
F (generic function with 1 method)
Finally we can set the initial condition, time step and construct the Problem2D
object
κ_perp = 1.0
u₀(x, y) = 0.0
Δt = 1.0e-4;
t_f = 100Δt;
P = Problem2D(order,u₀,κ_perp,κ_perp,Dom,BCs,source=F,parallel=PData)
2 dimensional PDE Problem
now we can call the solver,
soln = solve(P,Dom,Δt,t_f)
FaADE.solvers.solution{Float64, Vector{Matrix{Float64}}, GridMultiBlock{Float64, 2, CurvilinearMetric, NTuple{5, Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}}, Tuple{NTuple{4, Joint}, Vararg{Tuple{Joint, Joint, Joint}, 4}}, Vector{Vector{Int64}}}, Problem2D{Float64, 2, Float64, FaADE.Helpers.SourceTerm{typeof(Main.F)}, Dict{Int64, Tuple{SAT_Dirichlet{FaADE.Helpers.NodeType{:Right, 2}, :Curvilinear, Float64, Vector{Float64}, typeof(Main.Bxy), typeof(eachrow)}}}, ParallelMultiBlock{Float64, 2, NTuple{5, CubicHermiteSpline.BivariateCHSInterpolation{Float64, DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{DelaunayTriangulation.Triangulation{Matrix{Float64}, Set{Tuple{Int64, Int64, Int64}}, Vector{Int64}, DelaunayTriangulation.ZeroWeight{Float64}, Int64, Tuple{Int64, Int64}, Set{Tuple{Int64, Int64}}, Tuple{}, Dict{Tuple{Int64, Int64}, Tuple{Vector{Int64}, Int64}}, Dict{Int64, Vector{Int64}}, Dict{Int64, UnitRange{Int64}}, Dict{Int64, DelaunayTriangulation.RepresentativeCoordinates{Int64, Float64}}, DelaunayTriangulation.TriangulationCache{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Nothing}, Vector{Int64}, Set{Tuple{Int64, Int64}}, Vector{Int64}, Set{Tuple{Int64, Int64, Int64}}, NTuple{4, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, Tuple{SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}, NTuple{27, SubArray{Float64, 1, Memory{Float64}, Tuple{UnitRange{Int64}}, true}}}, Nothing}}}, NTuple{5, typeof(Main.intercept)}, Matrix{Float64}}}}([[[0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0], [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0]], [[0.25288316534237504 0.25540265949108665 … 0.25540282485446114 0.2528832740739924; 0.2554026146913346 0.2600830212897901 … 0.2600831758411671 0.2554027459605569; … ; 0.25540275282445113 0.2600831938502 … 0.26008316131829495 0.2554027052177625; 0.252883292154301 0.2554028505041465 … 0.2554028681449562 0.2528832866201997], [0.2528753858298679 0.24727926696966585 … 0.01192206513071768 -9.61857946276922e-20; 0.25540317123139533 0.24849351652200305 … 0.01208073062993887 1.1571583094074121e-21; … ; 0.25540315362022703 0.24849344414681834 … 0.012080711219689004 1.0136723692834371e-19; 0.2528753934896869 0.24727927136623945 … 0.011922065130736475 -1.0996157489546663e-23], [0.25287537865930004 0.24727926489115562 … 0.011922065130736865 -4.39400923332999e-22; 0.25540304906533745 0.2484934554575631 … 0.012080730629937135 -1.0893234763443024e-21; … ; 0.25540300825889345 0.24849336548018827 … 0.012080711219649928 4.5257401846751136e-23; 0.2528753917513296 0.2472792669696659 … 0.011922065130717684 -9.618579462769222e-20], [0.25287526946972716 0.24727918107624797 … 0.011922065130639597 -1.6359582733105852e-21; 0.2554029624660699 0.24849338864214163 … 0.012080730629854734 1.0233058579092452e-19; … ; 0.25540312803674653 0.2484934295215137 … 0.01208071121968748 -1.0450431606053943e-19; 0.2528753757725293 0.24727926489115568 … 0.011922065130736865 -4.39400923332999e-22], [0.2528753970069895 0.24727927136623945 … 0.011922065130736476 -1.0996157489546663e-23; 0.25540305591850687 0.24849345411911103 … 0.012080730629934868 -1.0402606867880505e-19; … ; 0.25540291768775975 0.24849330523427474 … 0.012080711219592213 -1.5858796600263498e-21; 0.25287527108103686 0.24727918107624797 … 0.011922065130639599 -1.6359582733105852e-21]]], GridMultiBlock{Float64, 2, CurvilinearMetric, NTuple{5, Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}}, Tuple{NTuple{4, Joint}, Vararg{Tuple{Joint, Joint, Joint}, 4}}, Vector{Vector{Int64}}}((Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.25 … -0.25 -0.25; -0.22500000000000003 -0.22500000000000003 … -0.22500000000000003 -0.22500000000000003; … ; 0.22499999999999998 0.22499999999999998 … 0.225 0.22499999999999998; 0.25 0.25 … 0.25 0.25], [-0.25 -0.22499999999999998 … 0.22499999999999998 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25; … ; -0.25 -0.22499999999999992 … 0.22499999999999995 0.25; -0.25 -0.22499999999999998 … 0.22499999999999998 0.25], 0.05, 0.05, 21, 21, [0.2499999999999999 0.24999999999999967 … 0.2499999999999996 0.2499999999999999; 0.25000000000000006 0.24999999999999975 … 0.2499999999999999 0.25000000000000006; … ; 0.2500000000000013 0.2499999999999999 … 0.2499999999999999 0.2500000000000007; 0.25000000000000044 0.25000000000000017 … 0.25000000000000017 0.25000000000000044], [2.0000000000000027 2.000000000000002 … 2.0000000000000027 2.0000000000000027; 2.0000000000000004 2.0000000000000018 … 2.0000000000000004 2.0000000000000004; … ; 2.0000000000000004 2.0000000000000004 … 2.0000000000000004 2.0000000000000004; 1.9999999999999982 1.9999999999999982 … 1.9999999999999982 1.9999999999999982], [-8.326672684688678e-16 -0.0 … 0.0 8.326672684688678e-16; -3.0531133177191797e-15 -1.1102230246251577e-15 … 0.0 3.885780586188047e-15; … ; -2.2204460492503016e-15 -0.0 … 0.0 2.2204460492503068e-15; 8.326672684688659e-16 -0.0 … 0.0 -8.326672684688659e-16], [-8.326672684688678e-16 1.1102230246251581e-15 … -1.1102230246251583e-15 8.326672684688678e-16; -0.0 1.1102230246251577e-15 … -2.2204460492503143e-15 -0.0; … ; 0.0 0.0 … 0.0 0.0; 8.326672684688659e-16 6.383782391594646e-15 … -2.2204460492503115e-15 -8.326672684688659e-16], [1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982; 1.9999999999999991 2.0000000000000004 … 2.0000000000000004 1.9999999999999991; … ; 1.9999999999999893 2.0000000000000004 … 2.0000000000000004 1.9999999999999938; 1.9999999999999982 2.0000000000000004 … 2.0000000000000004 1.9999999999999982]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865477; 0.25 0.2755202982800016 … 0.7348856673200291 0.7604059656000306; … ; 0.25 0.2755202982800015 … 0.7348856673200291 0.7604059656000305; 0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.22500000000000003 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.24622240241650922 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477], 0.05, 0.05, 21, 21, [0.22855339059327265 0.26802911048174666 … 0.9785920684742284 1.0180677883626998; 0.25520298280001585 0.294521839292405 … 1.002261256155422 1.0415801126478192; … ; 0.25520298280001463 0.2945218392924056 … 1.0022612561554214 1.0415801126478135; 0.2285533905932732 0.268029110481744 … 0.9785920684742307 1.0180677883626998], [2.000000000000004 1.7054370712381166 … 0.46710656657911087 0.4489944445857478; 1.66317824217121 1.4411428685557914 … 0.4234904279931209 0.40750398666041693; … ; -1.66317824217124 -1.4411428685557903 … -0.4234904279931223 -0.4075039866604188; -1.9999999999999984 -1.7054370712381335 … -0.46710656657910976 -0.4489944445857464], [-2.0000000000000036 -1.7054370712381166 … -0.46710656657911315 -0.4489944445857493; -2.0000000000000004 -1.7329987033433316 … -0.5092544109286432 -0.4900304445161845; … ; -2.0000000000000004 -1.7329987033433298 … -0.5092544109286403 -0.49003044451618305; -1.9999999999999991 -1.7054370712381335 … -0.46710656657910976 -0.44899444458574855], [2.1876726427121165 1.979972417430856 … 1.1068091654513827 1.094038068171226; 1.9592247493118597 1.8153518453217952 … 1.1559406465912985 1.1455818659089523; … ; 1.959224749311869 1.8153518453217914 … 1.1559406465913016 1.1455818659089565; 2.187672642712116 1.979972417430863 … 1.1068091654513834 1.0940380681712263], [-9.108017018555845e-16 0.2077002252812524 … 1.0808634772607228 1.0936345745408618; 0.0 0.1730096033510473 … 0.9659627361068683 0.9784193452900326; … ; -0.0 -0.1730096033510488 … -0.9659627361068712 -0.9784193452900402; 9.108017018555823e-16 -0.20770022528124515 … -1.0808634772607277 -1.0936345745408673]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136741 0.6494480483301835; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], [0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476; 0.25 0.2755202982800016 … 0.7348856673200295 0.7604059656000309; … ; 0.25 0.2755202982800015 … 0.7348856673200296 0.760405965600031; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865475], 0.05, 0.05, 21, 21, [0.2285533905932726 0.26802911048174655 … 0.9785920684742393 1.018067788362703; 0.25520298280001585 0.29452183929240516 … 1.0022612561554243 1.0415801126478128; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554232 1.0415801126478221; 0.2285533905932732 0.26802911048174594 … 0.9785920684742406 1.0180677883627118], [2.0000000000000036 1.7054370712381173 … 0.467106566579108 0.4489944445857453; 2.0000000000000004 1.7329987033433305 … 0.509254410928641 0.4900304445161848; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286427 0.49003044451618527; 1.9999999999999991 1.705437071238121 … 0.46710656657910504 0.44899444458573784], [2.0000000000000044 1.7054370712381173 … 0.4671065665791057 0.4489944445857418; 1.6631782421712136 1.441142868555785 … 0.4234904279931233 0.4075039866604156; … ; -1.6631782421712213 -1.4411428685557925 … -0.4234904279931204 -0.407503986660415; -1.999999999999998 -1.705437071238121 … -0.4671065665791073 -0.4489944445857414], [9.108017018555847e-16 -0.20770022528125145 … -1.0808634772607257 -1.0936345745408738; -0.0 -0.1730096033510491 … -0.9659627361068651 -0.9784193452900407; … ; 0.0 0.1730096033510491 … 0.9659627361068684 0.9784193452900319; -9.108017018555823e-16 0.20770022528124363 … 1.080863477260723 1.0936345745408738], [2.187672642712117 1.9799724174308566 … 1.10680916545138 1.094038068171232; 1.9592247493118597 1.815351845321794 … 1.1559406465912971 1.1455818659089594; … ; 1.9592247493118677 1.8153518453217952 … 1.1559406465912985 1.1455818659089492; 2.187672642712116 1.979972417430865 … 1.1068091654513827 1.094038068171232]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200296 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.7348856673200295 -0.760405965600031; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], [-0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475; -0.22500000000000003 -0.24622240241650914 … -0.6282256459136742 -0.6494480483301837; … ; 0.22499999999999998 0.2462224024165091 … 0.6282256459136744 0.6494480483301838; 0.25 0.27285533905932735 … 0.6842514421272201 0.7071067811865476], 0.05, 0.05, 21, 21, [0.22855339059327265 0.2680291104817466 … 0.9785920684742337 1.0180677883626998; 0.2552029828000156 0.29452183929240555 … 1.0022612561554214 1.0415801126478073; … ; 0.2552029828000148 0.29452183929240516 … 1.0022612561554263 1.0415801126478232; 0.2285533905932732 0.2680291104817459 … 0.9785920684742382 1.0180677883627083], [-2.000000000000004 -1.7054370712381168 … -0.4671065665791083 -0.4489944445857431; -1.6631782421712153 -1.441142868555783 … -0.42349042799312453 -0.4075039866604178; … ; 1.6631782421712213 1.4411428685557925 … 0.42349042799312137 0.4075039866604167; 1.999999999999998 1.7054370712381215 … 0.4671065665791085 0.44899444458574295], [2.0000000000000036 1.7054370712381168 … 0.4671065665791083 0.4489944445857464; 2.0000000000000004 1.732998703343332 … 0.5092544109286414 0.4900304445161836; … ; 2.0000000000000004 1.7329987033433287 … 0.5092544109286411 0.4900304445161847; 1.9999999999999991 1.7054370712381215 … 0.4671065665791062 0.4489944445857394], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513859 -1.0940380681712352; -1.9592247493118617 -1.8153518453217916 … -1.1559406465913005 -1.1455818659089654; … ; -1.9592247493118677 -1.8153518453217952 … -1.1559406465912947 -1.1455818659089458; -2.187672642712116 -1.9799724174308653 … -1.106809165451381 -1.0940380681712283], [9.108017018555845e-16 -0.20770022528125193 … -1.0808634772607253 -1.0936345745408713; 0.0 -0.17300960335104695 … -0.9659627361068646 -0.9784193452900438; … ; -0.0 0.1730096033510491 … 0.9659627361068677 0.9784193452900309; -9.108017018555823e-16 0.20770022528124316 … 1.0808634772607246 1.0936345745408775]), Grid2D{Float64, CurvilinearMetric, Matrix{Float64}}([0.25 0.27285533905932735 … 0.6842514421272199 0.7071067811865474; 0.22499999999999995 0.24622240241650914 … 0.6282256459136746 0.649448048330184; … ; -0.22499999999999998 -0.2462224024165092 … -0.6282256459136747 -0.6494480483301841; -0.25 -0.2728553390593274 … -0.6842514421272203 -0.7071067811865477], [-0.25 -0.27285533905932735 … -0.6842514421272203 -0.7071067811865477; -0.25 -0.2755202982800016 … -0.7348856673200294 -0.7604059656000308; … ; -0.25 -0.2755202982800015 … -0.734885667320029 -0.7604059656000306; -0.25 -0.27285533905932735 … -0.6842514421272201 -0.7071067811865475], 0.05, 0.05, 21, 21, [0.22855339059327368 0.2680291104817465 … 0.9785920684742226 1.0180677883626972; 0.25520298280001585 0.2945218392924054 … 1.00226125615542 1.0415801126478168; … ; 0.2552029828000148 0.29452183929240544 … 1.0022612561554236 1.0415801126478255; 0.2285533905932732 0.2680291104817449 … 0.9785920684742245 1.0180677883626945], [-1.9999999999999944 -1.7054370712381175 … -0.46710656657911365 -0.44899444458574755; -2.0000000000000004 -1.7329987033433292 … -0.5092544109286421 -0.4900304445161834; … ; -2.0000000000000004 -1.732998703343327 … -0.5092544109286424 -0.4900304445161857; -1.9999999999999991 -1.7054370712381277 … -0.46710656657911276 -0.4489944445857455], [-1.999999999999995 -1.7054370712381175 … -0.46710656657911365 -0.4489944445857498; -1.6631782421712242 -1.4411428685557905 … -0.42349042799312175 -0.40750398666041726; … ; 1.6631782421712349 1.4411428685557892 … 0.42349042799311915 0.4075039866604156; 2.0000000000000084 1.7054370712381277 … 0.46710656657911276 0.4489944445857488], [-9.108017018555803e-16 0.207700225281252 … 1.0808634772607302 1.0936345745408722; -0.0 0.17300960335104706 … 0.9659627361068703 0.978419345290037; … ; 0.0 -0.17300960335104892 … -0.9659627361068702 -0.9784193452900288; 9.108017018555823e-16 -0.20770022528124393 … -1.0808634772607209 -1.0936345745408742], [-2.1876726427121165 -1.9799724174308564 … -1.1068091654513807 -1.0940380681712214; -1.9592247493118597 -1.8153518453217945 … -1.155940646591302 -1.145581865908955; … ; -1.9592247493118677 -1.8153518453217954 … -1.155940646591299 -1.1455818659089434; -2.187672642712116 -1.9799724174308644 … -1.10680916545139 -1.094038068171232])), ((Joint(2, FaADE.Helpers.NodeType{:Right, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Left, 2}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(3, FaADE.Helpers.NodeType{:Left, 1}()), Joint(5, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(4, FaADE.Helpers.NodeType{:Left, 1}()), Joint(2, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(5, FaADE.Helpers.NodeType{:Left, 1}()), Joint(3, FaADE.Helpers.NodeType{:Right, 1}())), (Joint(1, FaADE.Helpers.NodeType{:Left, 2}()), Joint(2, FaADE.Helpers.NodeType{:Left, 1}()), Joint(4, FaADE.Helpers.NodeType{:Right, 1}()))), [[21, 42, 63, 84, 105], [21, 42, 63, 84, 105]], 2), [0.0001, 0.0001], [0.0, 0.01], 2 dimensional PDE Problem, 0.009112168147984837, [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 … 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1])
Finally we can plot the solution, since it's symmetric about the origin we'll just plot a contour across the centre line,
fig = plot()
plot!(Dom.Grids[1].gridx[:,11], soln.u[2][1][:,11])
plot!(Dom.Grids[2].gridx[11,:], soln.u[2][2][11,:])
plot!(Dom.Grids[4].gridx[11,:], soln.u[2][4][11,:])
fig
This page was generated using Literate.jl.